Download presentation
Presentation is loading. Please wait.
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.