Design Patterns in Apex: Introduction

One area which I wish to cover on this blog is using design patterns in Salesforce. Although the common patterns are thoroughly documented on the internet, there are very few articles that are specific to Salesforce – and whilst the patterns are generally language/platform agnostic, one of the most important steps in using a pattern is decided when to use it. Hopefully some of the suggestions and examples in upcoming posts will cover this.

Not all patterns are useful when working on the platform, but I hope to cover some of the more common ones:

  • Strategy
  • Singleton
  • Factory
  • Facade
  • Adaptor

As I didn’t come from a developer / computer science background, I have had to learn these as I have gone along – sometimes using them without even know they were a pattern! Some of the best non-Salesforce specific resources are the following:

  • Derek Banas YouTube videos
    • This guy is a very gifted teacher, his videos are absolutely invaluable. He covers most of the design patterns, as well as a whole host of other topics.
  • Head First Design Patterns
    • Don’t judge a book by its cover! This book is fantastic at explaining the patterns in a (cheesy) but accessible way. I actually own it both on Kindle and paperback – I would definitely recommend the latter as it is code/image/diagram heavy.


One thought on “Design Patterns in Apex: Introduction

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s