File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes Prototype:Creational Patterns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Prototype:Creational Patterns" Watch "Prototype:Creational Patterns" New topic
Author

Prototype:Creational Patterns

Lambardar singh
Greenhorn

Joined: Aug 06, 2003
Posts: 3
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

Joined: Jan 07, 1999
Posts: 6920
Take a look at this older thread which also covers the prototype pattern. It just might help.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Lambardar singh
Greenhorn

Joined: Aug 06, 2003
Posts: 3
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

Joined: Jan 07, 1999
Posts: 6920
Glad I could help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Prototype:Creational Patterns