Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Prototype:Creational Patterns

 
Lambardar singh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i read about the Prototype pattern, unable to figure out what exactly can be achieved using it. What situation is it used in. All i understood is that the class creating instances is supplied a prototypical instance. Then using cloning it creates instances. What exactly is achieved? What circumstances does it add value to use Prototype pattern for object creation. Please, could you elaborate more on Prototype pattern?

Thanks,
Lambardar
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at this older thread which also covers the prototype pattern. It just might help.
 
Lambardar singh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Frank it is helpful. The last two messages on the thread first one by you and the second one by another Pattern enthusiast really made sense. So the key is using clone instead of calling complex constructors. The Font selector and textarea example as well as the Pluggable look and feel example are very illustrative.
Thanks
 
Frank Carver
Sheriff
Posts: 6920
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic