Tags » Design Patterns

Is Getter DI A Good Idea?

Sometimes, you may hear about dependency injection done via a getter method, which subclasses override or mock frameworks fake for testing. It allows the class to have a set dependency that is actually hard coded, but can be “injected” if need be. 602 more words


Design Pattern: Flyweight

The Flyweight Design Pattern allows you to share instances of the same object across multiple calls.

In the example on this post I’m reusing a rectangle with the same color, that makes the color property “intrinsic”. 233 more words


Design Pattern: Bridge

The Bridge Design Pattern allows you to decouple the implementation from the abstraction. It means that we can have the implementation separated from our classes and reuse them rather than implementing another hierarchy level. 179 more words


Design Patterns in Apex: Strategy Pattern

1. What does it do?

The strategy pattern allows an algorithm’s behaviour to be chosen at runtime. It can be used to define a family of algorithms that solve a common goal. 1,017 more words


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… 204 more words



MVC Pattern stands for Model-View-Controller Pattern. This pattern is used to separate application’s concerns.

  • Model – Model represents an object or JAVA POJO carrying data. It can also have logic to update controller if its data changes.
  • 323 more words

Singleton Design Pattern

Singleton pattern is one of the simplest design patterns in Java. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object. 197 more words