April 2008 Entries
Singleton pattern is one of the most used design patterns in any system. The pattern states that
"Ensure a class only has one instance, and provide a global point of access to it."
Although it is simple to implement this pattern, I have explained the pattern with a real world example and diagrams. Read more for details
In this article I will discuss about one of the Structural pattern in GoF series which is composite pattern.
Composite pattern defines class hierarchies consisting of primitive objects and composite objects. Primitive objects can be composed into more complex objects, which in turn can be composed, and so on recursively.
It makes the client simple. Clients can treat composite structures and individual objects uniformly. Read more for examples and diagrams
In this series I will be explaining UML diagrams and their usage which is most commonly used and beneficial to any developer to understand the design and implementation models of their applications at various stages of application lifecycle
The article explains the UML diagrams and their relationships with a diagram.
In my previous post I talked about one of the other design principle, The Open Closed Principle.
Continuing with same series today I would be talking about the Single Responsibility Principle (SRP) which states that
"There should never be more than one reason for a class to change."
The article demonstrates the principle with UML diagrams and a C# code example
Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
Sometimes we want to add responsibilities to individual objects, not to an entire class.One way to add responsibilities is with inheritance. Inheritence will cause all the objects of that derived class to change.
A more flexible approach is to enclose the component in another object that adds the border. The enclosing object is c
This article is part of our series of design patterns. The definition of Template pattern states that
Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.
The article demonstrates the pattern with UML diagrams and a C# code example
As Ivar Jacobson said: "All systems change during their life cycles. This must be borne in mind when developing systems expected to last longer than the first version."
Bertrand Meyer gave us guidance as long ago as 1988 when he coined the now famous open-closed principle.
SOFTWARE ENTITIES (CLASSES,MODULES,FUNCTIONS,ETC.)SHOULD BE OPEN FOR EXTENSION,
BUT CLOSED FOR MODIFICATION
When a single change to a program results in a cascade of changes to dependent mo
MVC stands for Model View Controller Pattern
This pattern is extensively used while architecting an enterprise J2EE applications.
When to use Strategy Pattern
When we have multiple implementations(algorithms)
When we follow composition relationship(has-a) in place of the inheritance relationship(is-a relationship)
When we have a variety of behaviors but these are not applicable to all the objects