Software Architecture in Practice

Read this section to learn about the main elements, patterns, quality attributes, and principles of software architecture, including encapsulation, polymorphism, and dependencies. Pay attention to design patterns and their importance in software design.

3. General Software Abstractions & Relations

  • Encapsulation - helps decrease the amount of coupling between each component by information hiding 
  • Polymorphism - helps increase the cohesion of communication and relationship between objects 
  • Dependencies - dependent libraries and packages

 

Types of Coupling 
  • Afferent coupling - number of responsibilities; incoming 
  • Efferent coupling - number of dependencies; outgoing

 

Code Quality Measurements 
  • Instability - ratio of efferent coupling to afferent and efferent coupling 
  • Cyclomatic complexity - number of branches that a method may have, measures the complexity of methods

 

Cyclomatic Complexity 

E - N + 2 * P 

where 

- E is the number of edges 

- N is the number of nodes 

- P is the number of nodes with exit paths