In this talk, we will discuss
How a good module look like (Discussion on module boundaries - Reusable code).
Properties of good reusable code.
Principles that help get the module boundaries right (cohesion principles)
Principles to manage dependencies between the modules (coupling principles).
Tools that can be used to decouple the code base. (We will be using IntelliJ Idea DSM to visualise the code base dependencies and to break them).
Techniques that can help to prevent future issues.
We won't be covering all the principles or every aspect of the given principles due to time constrain. Main goal of the talk is to provide actionable points and to have a healthy discussion around the same.
14. How changes affect clients
Change Option 1 Option 2 Option3
Changes In Switch or
Interface
Yes Yes Yes
Changes in Light
Implementation
Yes Yes Only Clients using
Light
Changes in Fan
Implementation
Yes Yes Only Clients using
Fan
19. ISP and OCP
ISP - “Make fine grained interfaces that are client specific.”
Interface consumer and Interfaces are named and packaged together.
OCP - “Software entities (classes, modules, functions, etc.) should be open for
extension but closed for modification.”
Abstraction modules allows to satisfy Opposing requirements for a Reusable
code.
20. Real life examples
JPA - Hibernate
JDBC - MySQL client, PostgreSQL clients etc.
Slf4j - Log4j, Logback etc.
Kubernetes - CNI, CRI, CSI, CPI etc
22. CCP - “Classes that change together are packaged together.”
“ When we make a change we want to be able to jump to a single clear point in
the system and make the change.”
- Refactoring: Improving the Design of Existing Code, Ch 03. Bad
Smells. Divergent Change
For, Layered architecture one change per layer.
The Common Closure Principle
35. Example Application codebase
Orchestration framework which uses the DAG as inputs. Different type of nodes
are supported like REST API services, or message passing brokers (like Kafka
etc).
41. References
Agile Software Development, Principles, Patterns, and Practices
Clean Architecture: A Craftsman's Guide to Software Structure and Design
Refactoring: Improving the Design of Existing Code
Building Evolutionary Architectures, 2nd Edition