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

Gopal Das

Founder at GopalDas.Org
He is a technology evangelist, Salesforce trainer, blogger, and working as a Salesforce Technical Lead. After working in Java based project implementation, he jumped to the Salesforce system on a whim and never looked back. He fell in love with Salesforce’s flexibility, scalability, and power. He expanded his knowledge of the platform and became a Certified App Builder, Administrator, Platform Developer I, SalesCloud Consultant while leading the Salesforce implementation and technology needs. He has worked in a wide variety of applications/services like desktop, web and mobile applications.
Gopal Das
Follow me

Leave a Reply

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