Web developers have been itching to develop with HTML5 but have been held back by legacy browsers. Google Chrome Frame can help break this impasse by allowing applications...
Editor's Note: This post was written by Jim McNelis and Vinay Thakker of Dito , a provider of Google Apps deployment, training, integration, and support services, and makers...
Today we’re releasing Google Sites API , version 1.2, which includes two top requested new features: Web address mappings Web address mappings are now programmatically accessible in the...
Introducing the Store Locator Library for Google Maps API
In this screen cast, Chris Broadfoot gives an overview of the Store Locator library, a new open-source utility library that makes it simple for developers to create useful, valuable store locators. Documentation: goo.gl Follow Chris on G+: chrisbroadfoot.id.au
From:
GoogleDevelopers
Views:
197
0
ratings
Time:
03:42
More in
Science & Technology
Geocoding - finding the geographical location of a given address - is one of the most popular features of the Google Maps API. Both the JavaScript Maps APIs...
Following up on our recent post about the new Doc List capability in Google Apps Script, we thought we’d take a moment to look a little more closely...
If you’ve thought about adding Google Buzz buttons to your site, but didn’t want to have to hack together something the way Mashable and TechCrunch did, you’re in...
La gran final del Developer Bus en Colombia, la innovación desde las tecnologías Google (spanish)
Toda la innovación del Developer Bus en Colombia con la presentación de los proyectos, la devolución del jurado y el gran ganador de la edición de Bogotá.#DevBusLatAm #DevBusBogota +Desarrolla...
From:
GoogleDevelopers
Views:
0
0
ratings
Time:
00:00
More in
Science & Technology
Editor's Note: This post was written by Gilad Goraly from ScheduleOnce, a company that provides meeting scheduling solutions for Google Calendar. We invited ScheduleOnce to share their experiences...
Google Summer of Code TM , our flagship program to introduce college students to open source development, opens today. Over the past five years, we've seen more than...
We've just announced the list of accepted mentoring organizations for Google Summer of Code™ 2010 . Congratulations to all of our future mentors! After reviewing just over 365...
I have been writing few post with code refactoring features in Visual Studio 2010. This post also will be part of series and this post will be last of the series. In this post I am going explain two features 1) Encapsulate Field and 2) Extract Interface. Let’s explore both features in details. Encapsulate Field: This is a nice code refactoring feature provides by Visual Studio 2010. With help of this feature we can create properties from the existing private field of the class. Let’s take a simple example of Customer Class. In that I there are two private field called firstName and lastName. Below is the code for the class. public class Customer
{
private string firstName;
private string lastName;
public string Address { get; set; }
public string City { get; set; }
}
Now lets encapsulate first field firstName with Encapsulate feature. So first select that field and goto refactor menu in Visual Studio 2010 and click on Encapsulate Field. Once you click that a dialog box will appear like following.
Now once you click OK a preview dialog box will open as we have selected preview reference changes. I think its a good options to check that option to preview code that is being changed by IDE itself. Dialog will look like following.
Once you click apply it create a new property called FirstName. Same way I have done for the lastName and now my customer class code look like following.
public class Customer
{
private string firstName;
public string FirstName
{
get { return firstName; }
set { firstName = value; }
}
private string lastName;
public string LastName
{
get { return lastName; }
set { lastName = value; }
}
public string Address { get; set; }
public string City { get; set; }
}
So you can see that its very easy to create properties with existing fields and you don’t have to change anything there in code it will change all the stuff itself.
Extract Interface:
When you are writing software prototype and You don’t know the future implementation of that then its a good practice to use interface there. I am going to explain here that How we can extract interface from the existing code without writing a single line of code with the help of code refactoring feature of Visual Studio 2010. For that I have create a Simple Repository class called CustomerRepository with three methods like following.
public class CustomerRespository
{
public void Add()
{
// Some code to add customer
}
public void Update()
{
//some code to update customer
}
public void Delete()
{
//some code delete customer
}
}
In above class there are three method Add,Update and Delete where we are going to implement some code for each one. Now I want to create a interface which I can use for my other entities in project. So let’s create a interface from the above class with the help of Visual Studio 2010. So first select class and goto refactor menu and click Extract Interface. It will open up dialog box like following.
Here I have selected all the method for interface and Once I click OK then it will create a new file called ICustomerRespository where it has created a interface. Just like following.
Here is a code for that interface.
using System;
namespace CodeRefractoring
{
interface ICustomerRespository
{
void Add();
void Delete();
void Update();
}
}
Now let's see the code for the our class. It will also changed like following to implement the interface.
public class CustomerRespository : ICustomerRespository
{
public void Add()
{
// Some code to add customer
}
public void Update()
{
//some code to update customer
}
public void Delete()
{
//some code delete customer
}
}
Isn't that great we have created a interface and implemented it without writing a single line of code. Hope you liked it. Stay tuned for more.. Till that Happy Programming.
The Google Annotations Gallery is an exciting new Java open source library that provides a rich set of annotations for developers to express themselves. Do you find the...
We’ve had a great showing from students around the world for Google Summer of Code ™ this year. In all, we accepted 1,026 students from 69 countries worldwide...
We’re incredibly proud of the diversity of applications and tools making use of the Google Analytics Export API. We also know that several of you have been asking...
Google App Engine is a powerful system, designed to take all the pain of infrastructure management and performance scaling out of web application programming. App Engine applications are...
Location, location, location . In case you haven’t noticed, we’re really excited about all the ways location can make mobile apps and websites more useful. With Google Latitude...
In April, we announced Google Cloud Print, a service that enables any app (web, mobile, desktop), on any device, OS, or browser, to print to any printer. Development...
If you’re attending Google I/O next month, you’ve likely taken a gander at this year’s sessions and made a mental note of ones you’d like to attend. (Or...
We recently added a new feature to Apps Script: the ability to interact with your Google Docs List. With this new integration, scripts can create, rename, or move...
When it comes to code, Google's support has made a big difference to the Tor Project . Providing privacy and helping to circumvent censorship online is a challenge...
Google I/O 2011: How to Get Your Startup Idea Funded by Venture Capitalists
Don Dodge, Joe Kraus, Paul Buchheit, Seth Priebatsch Have an idea and want to start a company? Learn how to attract investors, and what they want to see before writing a check. Hear from entrepreneurs who have raised money and VCs who have funded them.
From:
GoogleDevelopers
Views:
16911
146
ratings
Time:
01:00:27
More in
Science & Technology