Saturday, November 13, 2010

..........Prototype Pattern[CD]

When creating an object is very time consuming or complex in some way than we can just make the clone of existing object. This is called Prototype pattern.

public class PersonData : ICloneable
{

public Object clone()
{

try
{
return this.MemberwiseClone();
}
catch(Exception e)
{
Console.Writeline(e.Message);
return null;
}
}
}

No comments:

Followers

Link