Talk:Prototype pattern

message: The sentence that compares the Prototype DP to the Abstract Factory DP can be understood in two ways and needs clarification. Thanks.  — Preceding unsigned comment added by 132.68.50.212 (talk) 13:51, 21 February 2013 (UTC)
thread_title:  Sentence misunderstood 

message: What is GOF (references to an unidentified book)? Tom Peters 09:59, 18 January 2006 (UTC)
replies: text: "Gang of Four": Design Patterns: Elements of Reusable Object-Oriented Software--Malcohol (talk) 09:23, 21 April 2008 (UTC)
thread_title:  References 

message: The example link is dead ... 
Please use link http://wwwswt.informatik.uni-rostock.de/deutsch/Lehre/Uebung/Beispiele/PatternExamples/patexamples.htm
The example link is dead ... 
Please use link http://wwwswt.informatik.uni-rostock.de/deutsch/Lehre/Uebung/Beispiele/PatternExamples/patexamples.htm
62.39.121.226 13:31, 7 October 2005 (UTC)
thread_title:  Link Dead 

message: I wonder why the GoF authors say that Prototype is more complexe than Factory Method which relies on a hierarchy parallel to the Product hierarchy! I think there is a confusion between several problems that the pattern solves. First, Prototype solves the same problem as Factory Method, namely creating instances of classes without naming them. Second, it can be used to build objects faster or more easily by copying already built ones. There certainely are other uses for this pattern.
If the goal is to decouple clients from the classes to instantiate then I do not see why it would be more complex than Factory Method: on the contrary it is much simpler (no parallel hierarchy). The clone method is in fact a misnomer is this case: you do not need to clone a prototype p but simply want a new object of the same (dynamic) type as p. MikalZiane 13:05, 26 June 2006 (UTC)
thread_title:  Prototype complexity 

message: <I>"This pattern is used for example when the inherent cost of creating a new object in the standard way (e.g., using the 'new' keyword) is prohibitively expensive for a given application."</I> - This sounds a bit misleading to me. The IMHO most common reason to use a clone() method instead of new is that you do not know the concrete type of the object, i.e. it is impossible to use new.
The article lists a non-software example of the prototype pattern.  Not to seem too picky here, but couldn't we list some actual *software* cases where the design pattern is useful?    —Preceding unsigned comment added by 67.183.113.131 (talk) 05:27, 17 August 2010 (UTC)
thread_title:  Reasons to use clone 

message: === Java Code ===
==== Java example question ====
The introduction to the article says: To implement the pattern, declare an abstract base class that specifies a pure virtual clone() method.However, in the Java example the Cookie class is not declared abstract. Isn't this inconsistent with the introduction to the article?
210.23.150.138 (talk) 22:45, 4 November 2009 (UTC)
thread_title:  Language Specific Issues 

message: ==== Java example question ====
The introduction to the article says: To implement the pattern, declare an abstract base class that specifies a pure virtual clone() method.However, in the Java example the Cookie class is not declared abstract. Isn't this inconsistent with the introduction to the article?
210.23.150.138 (talk) 22:45, 4 November 2009 (UTC)
thread_title:  Java Code 

message: The introduction to the article says: To implement the pattern, declare an abstract base class that specifies a pure virtual clone() method.However, in the Java example the Cookie class is not declared abstract. Isn't this inconsistent with the introduction to the article?
210.23.150.138 (talk) 22:45, 4 November 2009 (UTC)
thread_title:  Java example question 

message: === Structure - Class Diagram ===
Sorry if I'm mistaken, but in the diagram, isn't the Client class implementing the Prototype superclass? (Due to the white triangle shape of the arrow).
Sorry also for the bad English.
Alpha (talk) 12:02, 16 February 2008 (UTC)
thread_title:  Non language programming issues 

message: Sorry if I'm mistaken, but in the diagram, isn't the Client class implementing the Prototype superclass? (Due to the white triangle shape of the arrow).
Sorry also for the bad English.
Alpha (talk) 12:02, 16 February 2008 (UTC)
thread_title:  Structure - Class Diagram 

message: === JavaScript ===
Wouldn't it make sense to give an example in JavaScript, which supports much of this natively? See http://steve-yegge.blogspot.com/2008/10/universal-design-pattern.html Jon (talk) 13:15, 13 February 2009 (UTC)
thread_title:  Languages used for examples 

message: Wouldn't it make sense to give an example in JavaScript, which supports much of this natively? See http://steve-yegge.blogspot.com/2008/10/universal-design-pattern.html Jon (talk) 13:15, 13 February 2009 (UTC)
thread_title:  JavaScript 

message: Earlier the article was edited to remove all but the not very appropriate Java example, with the claim that other examples were available in the external links. Later, the external links were removed as being link spam. So as a result of two quality improvement efforts, the quality went way down. Either non-spam links need to be added, or former links restored (I looked briefly and there was useful information/example code to be had without having to buy anything), or multiple language examples need to be included. I prefer the latter, as different languages have different features which dramatically affect what patterns are needed, how useful they are, etc. Saying "Wikipedia is not a programming manual" is kind of missing the point - different human languages cover the same page, because different humans think in different languages. The same goes for programming languages - if you want everyone reading the article to understand it, you either need a universal and probably not "real" programming language, or you need multiple real languages. Jodawi (talk) 21:05, 16 July 2011 (UTC)
thread_title:  All non-Java examples now unavailable 

message: Javascript is today's most popular programming language, and that makes it the flagship of prototypal inheritance patterns. Javascript gleaned the pattern from Self. So I corroborate the above points regarding language citations and examples. To include a sample implementation in Java is nearly non-sensical... to provide that sample *alone* is just ridiculous. To wit: http://twitter.com/#!/emjayess/status/92640484299780096 emjayess (talk) 17:48, 17 July 2011 (UTC)
thread_title:  Self, Javascript 

message: I would like to share the following UML diagrams I have published on Design Patterns Open Online Learning. Your comments are welcomed!
In the above UML class diagram, 
the Client class that requires a Product object doesn't instantiate the Product1 class directly.
Instead, the Client refers to the Prototype interface for cloning an object.
The Product1 class implements the Prototype interface by creating a copy of itself.
The UML sequence diagram shows the run-time interactions: 
The Client object calls clone() on a prototype:Product1 object, which creates and returns a copy of itself (a product:Product1 object).
Vanderjoe (talk) 13:14, 10 August 2017 (UTC)
thread_title:  UML class and sequence diagram