Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Difference between Prototype and Templet pattern

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !!!
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
If you look closely at this tiny ad, you will see five bicycles and a naked woman:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic