Apex Design Patterns

The following are a list of design patterns supported in a Force.com.

Singleton – minimizing object instantiation for improved performance and to mitigate impact of governor limits

Strategy – defining a family of algorithms, enscapsulating each one and making them interchangeable and selectable at runtime

Decorator – extending the functionality of an sObject in Apex

Facade – simplifying the execution of classes with complex interfaces (e.g. web service callouts)

Composite – treating a group of objects in a similar manner to a single instance of that object

Bulk State Transition – efficiently tracking the change of a field value in a trigger and executing functionality based on this change

Gopal Das
Follow me

Leave a Reply

Your email address will not be published. Required fields are marked *