Month: June 2016

About Cohesion

Cohesion is a measure of the degree to which the elements of a module belong together. Yourdon & Constantine in Structured Design, 1979 In essence, cohesion is a measure of ensuring that one element (one class) has a single responsibility. Measuring cohesion is tricky (as pretty much everything else in SE). The metrics tend to

Continue Reading

How to assess complexity of your software

No Silver Bullet — Essence and Accidents of Software Engineering Fred Brooks This is one of the famous quotes by Turing Award-winning Fred Brooks. The complexity of software is tough to define. It is a measure of your program which is partially about the size and partially about understandability (clarity) of the code. A complex

Continue Reading

Singleton

Singleton is also a very popular design pattern, although when not used appropriately it does become an anti- pattern. It is used when we need an object to be unique and easily accessible from all parts of the application e.g. database handler or loggers are frequently used. It is often considered an anti-pattern because is

Continue Reading

Callback

Callback design pattern allows us to avoid "freezing" the rest of the application if a method takes too long to return. It is very useful if running computationally-expensive or time unpredictable methods. It does generally involve running in a separate thread/task. The solution involves creating IXCallback interface which contains method called whn the slow operation

Continue Reading

Command Stack

Command stack is a design pattern if we need to support for undo/redo operations. There are two aspects to this design pattern ICommand interface where we can define the behaviour of the execution and undo operation and a CommandStack which is a generic. Create an ICommand interface with methods execute() and undo() All undoable/redoable actions

Continue Reading