Design Principles
I have been reading the Matrin Fowler's book on Applying UML & Patterns for quite a long time now. I just thought might want to share some of the experience from the book with you.
Today's post is gonna talk about some of the design principles which are considered as base for any object oriented design.
This will be the first part of the multi-part series of learning GRASP principles.
Read more
Basically it deals with the problems related to "fat" interfaces. "Fat" interfaces are those which has methods which can be divided into two or more groups. In other words they are not cohesive in nature. We should avoid such interfaces because it creates dependencies between different components and clients even if they dont require them.
Read More for examples and details
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
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