Software Design

Annotated Reading

(1) Design Principles

  • The Open Close Principle emphasizes the low cohesion through an interface that hides the internals of a module and the abstraction of that interface that supports extensions. The former closes the internal modifications done to the module while the the latter allows the support of several variations of the interface.
  • The Dependency Inversion Principle states that modules should depend on abstract interfaces. Abstract interfaces hide the implementation details such that the modifications are not propagated.
  • The Interface Segregation Principle states that interfaces should have high cohesion such that the classes using them depend on a single responsibility.
  • The Single Responsibility Principle states that classes should be high cohesive such that when it is necessary to change them all the code contributes to the same responsibility.
  • The Liskov’s Substitution Principle states that the classes that depend on a class interface do not need to be changed when the classes are extended, they can also use the extended classes, there is low coupling between the client and the possible extensions.

(2) Workflows of Refactoring, by Martin Fowler

  • Presents other reasons for refactoring besides Test-Driven Development.
  • Preparatory refactoring emphasizes the introduction of code, which will be removed at the end, just to easy the change.

(3) Refactoring a javascript video store, by Martin Fowler

  • Refactoring an unstructured code into a set of functions
  • Shows different possible structures for the same functionality
  • A step by step application of refactorings