Link Details

Link 879931 thumbnail
User 975993 avatar

By egenesky
Published: Nov 20 2012 / 08:18

Recommendation: This is still a useful pattern for a limited number of scenarios. In particular, the ability to hand out a copy of the instance from a cache means that we don’t have to worry about multi threading.
  • 7
  • 0
  • 561
  • 444


Add your comment
User 771987 avatar

Steve Mcduff replied ago:

0 votes Vote down Vote up Reply

Prototypes are useful to create "templates" presented in user interfaces. In your example, the UI might offer a DVD template or a book template populated with convenient default values. When users want to create new DVDs, they copy/paste the template and evolve their new copy. From a code perspective, a call to the clone method makes the copy/paste simple.

Add your comment

Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (7)

Voters Against This Link (0)

    Java Performance Optimization
    Written by: Pierre-Hugues Charbonneau
    Featured Refcardz: Top Refcardz:
    1. Design Patterns
    2. OO JS
    3. Cont. Delivery
    4. Java EE7
    5. HTML5 Mobile
    1. Node.js
    2. Debugging JavaScript
    3. OO JS
    4. JSON
    5. Ajax