Monthly Archives: September 2014

Unit of Work

  According to Martin Fowler “Maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems.” Unit of work is one of the most used patterns defined in Patterns of Enterprise Application Architecture (PoEAA). It maintains a list of business objects in memory… Read More »

Factory Method Pattern

According to Gang of Four: Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.  According to Wikipedia “The factory method pattern uses factory methods to deal with creating objects without specifying the exact class of object that will be created. This is done… Read More »

Repository Pattern

In Martin Fowler’s Patterns of Enterprise Application Architecture (PoEAA) defined Repository pattern as follows: “Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects.”  We can explain it as follows: The repository mediates between the data source layer and the business layers of the application. It queries the data… Read More »

Abstract Factory Pattern

Definition: According to Gang of Four “Provide an interface for creating families of related or dependent objects without specifying their concrete classes” According to Wikipedia “The abstract factory pattern provides a way to encapsulate a group of individual factories that have a common theme without specifying their concrete classes” So we can simplify Abstract Factory Pattern as follows: Abstract… Read More »

Gentle Introduction of GOF Design Patterns (Part – 02)

In previous post we discussed about the definition of GOF design patterns, its essential elements and how to define them. In this post we will discuss about different types of patterns. Types of Design Pattern »    Gang of four (Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides ) defined 23 patterns in their book: “Design Patterns: Elements of… Read More »

Gentle Introduction of GOF Design Patterns (Part – 01)

According Christopher Alexander “Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice” We can simplify design pattern… Read More »

Service Locator Pattern

According to Wikipedia “The service locator pattern is a design pattern used in software development to encapsulate the processes involved in obtaining a service with a strong abstraction layer. This pattern uses a central registry known as the “service locator”, which on request returns the information necessary to perform a certain task.” We can simplify the definition as follows: »   … Read More »

Dependency Injection – Interface Injection

What is Interface Injection? »    Also known as Method injection. »    In this case Dependency declared inside the dependent class in the form of interface. »    So any class that implements that interface can be substituted into dependent class. »    Dependency is injected as the parameter of method. »    Useful where the whole class does… Read More »