• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between Prototype and Templet pattern

 
Apratim Khandalkar
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Can whats is the exact difference between proptotype and template design pattern and which are the situations where these is can be used???
Please help !!!
 
Bajji Pat
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prototype is used when you are to clone an object i.e. creating customized objects, whereas a template design pattern is used when you want your objects to abide to a specific sequence of processing (etc. an algorithm)
[ May 05, 2006: Message edited by: Bajji Pat ]
 
Thomas Taeger
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Apratim Khandalkar:
Hi all,
Can whats is the exact difference between proptotype and template design pattern and which are the situations where these is can be used???
Please help !!!

Again: Don't you want to share YOUR thoughts first instead of just asking? Only by arguing yourself you will learn anythng.

Thomas
 
don brown (aka brownie brownie)
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is no similarity between these two patterns

prototype is used when object construction is expensive. instead of building 100 expensive objects from scratch build 1 and then customize
it to generate the other 99. the initial '1' is the prototype.

template is used when you are writing framework code and you want to let application code provide part of an algorithm. so the application developer writes a plug-in that implements a hook that the framework
calls.
 
Apratim Khandalkar
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Thomas ,,
You are right from next time i will take care that i will first share my thoughts and then ask
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic