The prototype pattern

The prototype design pattern is used to create a new object of a class based on an existing object of the same class. It helps avoid the repetitive code used to initialize a newly created object.

Developers of Universal Call Center solved many problems associated with the creation of an object, using design patterns, such as the factory method, singleton, abstract factory method, and builder pattern. Now, they are confident about how to simplify, manage, and solve problems created while instantiating objects. They were working on the module of an application where they needed to create a duplicate copy of the Apex helper class used to perform various operations.

The following is a code snippet of a wrapper class, which simply ...

Get Apex Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.