Design Patterns

Design patterns is a critical subject in building great application software. I’ve seen great developers often ignorant about design patterns. Often developers ask how to be a great software designer. Most of the times, my answer was that it requires ‘design thinking’. Design thinking is slightly different from coding a module or cracking a problem. It’s essentialy disciplined view of the system being built. In order to get into the plane of design thinking, it’s crucial to understand the existing documented design patterns. Once, you are aware of these, your design thinking would allow you to compose the elementary designs and come up with design solutions for real world problems.

I attempt to capture the important pieces of the puzzle. As with my style throughout this blog, am going to be cryptic highlighting just the critical points leaving the details for googling.

Basic Object Oriented Design Patterns
GOF (Gang Of Four) “Design Patterns: Elements of Reusable Object-Oriented Software ” is one of the highly influential book in the field of object orient elementary design patterns. Most of the patterns presented in this topic have been adapted from this book.

My C# implementation on the above book can be found at github.

Object creational design patterns

(Click on the above sub-title link for detailed notes.)

These set of patterns deal with the creation of objects.These patterns essentially give you controls such as limiting the number of instances of the class, time of instance creation – on demand vs lazy, initialization on object creation, selection of concrete implementation to be instantiated at run time and so on.

  • Limiting number of instance
    • Singleton
    • Multiton
    • Singleton registry
    • Object pool
  • Initialization
    • Lazy initialization
    • Prototype
    • Dependency injection
  • Selection of concrete implementation
    • Factory
    • Factory method
    • Abstract factory
    • Lazy factory
  • Object construction
    • Builder
    • Self builder

Behavioral design patterns

(Click on the above sub-title link for detailed notes.)

Behavioral design patterns deal with the communication of objects. Patterns of this type vary with assignment of responsibilities to the communicating objects and the way they interact with each other. Following patterns are covered in the above link.

  • Chain of responsibility
  • Command pattern
  • Interpreter pattern
  • Mediator pattern
  • Iterator pattern
  • Observer pattern
  • Visitor pattern
  • Template pattern
  • Strategy pattern
  • State pattern
  • Momento pattern
  • Null object pattern
  • Scheduled task pattern

Structural design patterns

(Click on the above sub-title link for detailed notes.)

Structural design patterns are software patterns that help in solving standard problems in creating static structure of classes through inheritance and composition.

  • Adapter pattern
  • Facade pattern
  • Decorator pattern
  • Bridge pattern
  • Composite pattern
  • Flyweight pattern
  • Proxy pattern
  • Marker interface pattern
OSGi design patterns

OSGi Design Patterns

(Refer the above link for details)

  • Service publisher and service consumer.
  • Components which requires mandatory configuration object.
  • Service listener pattern.
  • Filtered service listener.
  • Factory pattern.
  • Config factory pattern.
  • Extender pattern.
  • Service deployment.
  • Event admin
  • Wire admin
  • Named dynamic extension pattern (Query builder case).
  • Dynamic implementation selection of a service.
  • Overriding OOTB servlet in AEM.
Cloud Computing design patterns

A set of fundamental patterns from the book “Cloud Computing Patterns, 2014, Springer publication”. Do check – Cloud computing patterns.

IOT design patterns

Fundamental patterns that govern the design of IOT systems – IOT design patterns