Showing posts with label cohesion. Show all posts
Showing posts with label cohesion. Show all posts

Tuesday, 11 January 2011

Basics of software design

What are the characteristics of good design? How can we identify the gaps in design? How to review other designs? We shall try to find answers to those questions.
The fowling characteristics are considered to be adhered in a good design.

• Strong cohesion
• Loose coupling
• No redundancy
• Testability of all the features by itself.

Strong cohesion

In computer programming, cohesion is a measure of how strongly-related the functionality expressed by the source code of a software module is. Cohesion of class/method is about having single responsibility and fulfilling it. It is not about how strongly they are related to each other.

Loose coupling

In computing and systems design a loosely coupled system is one where each of its components has, or makes use of, little or no knowledge of the definitions of other separate components.
The coupling can be observed in the code wherever (as class variables, method parameters or return types or method variables) class is accessed from other class. Worst form of coupling is one class accessing base type and sub type of a class hierarchy). Except while constructing the object, everywhere else the base type should be used.

let us continue...