oodkpage

The Software Design Knowledge Page

BETA

jgarzas@gmail.com

Where exactly is the enormous amount of practical knowledge accumulated regarding microarchitectural software design?

MANTENIBILITY RULES

If there is any software design element (class, methods, code, and so on) duplicate then eliminate the duplication

If there are dependencies on concrete classes then these dependencies should be on abstractions.

If an object has different behaviour according to its internal state then places each one of these behaviours in a separate class.

If a hierarchy of classes has too many levels then

reduce the level of inheritance using composition or redesign

If there are unused or little used items then eliminate it

If a super class knows any of its subclasses then eliminate it.

If a class collaborates with too many others then reduce the number of collaborations.

If a change in an interface has an impact on many clients then create specific interfaces for each client.

If there is not an abstract class between an interface and its implementation then create an abstract class with an implementation by default between the interface and the class that implements it.

If a service has many parameters then create various methods, reducing the list or put these into an object.

If a class is too large then reduce its size by sharing out functionality over other classes.

If any element of the user interface is in domain entities then place these elements in a separate entity.

If a class rejects something that it inherited then avoid it, generally for delegation.

If the attributes of a class are public or protected then make them private and access to them through services.