Friday, June 6, 2014

Prototype Pattern in Java


Simple Note

From reference:
The prototype pattern is a creational design pattern in software development. It is used when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects. This pattern is used to:
* avoid subclasses of an object creator in the client application, like the abstract factory pattern does.
* avoid the inherent cost of creating a new object in the standard way (e.g., using the 'new' keyword) when it is prohibitively expensive for a given application.

Program

https://github.com/benbai123/JSP_Servlet_Practice/tree/master/Practice/JAVA/DesignPattern/src/prototype

Run TestMain.java to test.

There are several default membership packages of a gym and you can always talk to salesmen to obtain a customized package that better for you.

Reference:

Prototype pattern

Design patterns in the test of time: Prototype

No comments:

Post a Comment