Presentation is loading. Please wait.

Presentation is loading. Please wait.

Prototype Design Pattern A Creational design pattern.

Similar presentations


Presentation on theme: "Prototype Design Pattern A Creational design pattern."— Presentation transcript:

1 Prototype Design Pattern A Creational design pattern

2 Why use Prototype pattern? Difficult to instantiate/create new objects Complex parameter, lengthy instantiation time Usually used to catalog Library has multiple instances of books, movies, periodicals - many of which share information

3 How to use Prototype Create an abstract superclass/interface with a clone() method Create subclasses that override that clone() method Instantiate one object from each class Clone that object Caste that object to the superclass type

4


Download ppt "Prototype Design Pattern A Creational design pattern."

Similar presentations


Ads by Google