with B.S. in Computer Science and MBA from Ohio State University • Worked in the Telecommunications, E- Commerce, and Financial industries • Experience with distributed systems, cloud native, and mobile technologies
I like to think about Clean code being concerned with the micro e.g. readability, naming conventions, comments • While Clean Architecture is concerned with the macro, the relative composition of components and classes within a software system
I like to think about Clean code being concerned with the micro e.g. readability, naming conventions, comments • While Clean Architecture is concerned with the macro, the relative composition of components and classes within a software system • If only there was someone we could look to for an answer…
same thing as me. He asks others.. • “Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer’s intent, but is full of crisp abstractions and straightforward lines of control” - Grady Booch
are working on clean code when each routine pretty much turns out to be what you expected. You can call it beautiful code when the code also make it look like the language was made for the problem.” - Ward Cunningham
these statements because they emphasize intent, clarity, and simplicity. • We don’t program by ourselves: we are part of a team and others will work on your code as much as you do
these statements because they emphasize intent, clarity, and simplicity. • We don’t program by ourselves: we are part of a team and others will work on your code as much as you do • “Uncle Bob” mentions the “Boy Scout Rule” - leave things better than you found them
and stick with it • Reading inconsistently indented and formatted code is a mental drain • Invest the time in setting up a code style template for your IDE of choice and then distribute to the team via source control and use tools like Checkstyle to enforce it
one reason to change i.e. Single Responsibility Principle • A useful heuristic that I use is to describe what a class does in a sentence. If I use And/Or, then the class does too much
legacy code • How do we transform bad code into clean code? Think “Boy Scout Rule” • The only surefire way to transform bad code is to have tests that verify the behavior and invariants
legacy code • How do we transform bad code into clean code? Think “Boy Scout Rule” • The only surefire way to transform bad code is to have tests that verify the behavior and invariants • By having tests in place, we can employ stepwise refinement to improve the code
micro and what practices we should follow to ensure that the low-level constructs are well- made, let’s step back and take a look at the bigger picture to ensure that they are assembled in a consistent, reinforcing fashion
micro and what practices we should follow to ensure that the low-level constructs are well- made, let’s step back and take a look at the bigger picture to ensure that they are assembled in a consistent, reinforcing fashion • Fundamentally an architecture must support:
micro and what practices we should follow to ensure that the low-level constructs are well- made, let’s step back and take a look at the bigger picture to ensure that they are assembled in a consistent, reinforcing fashion • Fundamentally an architecture must support: • The use cases and operation of the system
micro and what practices we should follow to ensure that the low-level constructs are well- made, let’s step back and take a look at the bigger picture to ensure that they are assembled in a consistent, reinforcing fashion • Fundamentally an architecture must support: • The use cases and operation of the system • The maintenance of the system
micro and what practices we should follow to ensure that the low-level constructs are well- made, let’s step back and take a look at the bigger picture to ensure that they are assembled in a consistent, reinforcing fashion • Fundamentally an architecture must support: • The use cases and operation of the system • The maintenance of the system • The development of the system
micro and what practices we should follow to ensure that the low-level constructs are well- made, let’s step back and take a look at the bigger picture to ensure that they are assembled in a consistent, reinforcing fashion • Fundamentally an architecture must support: • The use cases and operation of the system • The maintenance of the system • The development of the system • The deployment of the system
Grady’s quote is how he alludes to the goal of minimizing the cost of change • Our job isn’t only to build software that meets the stated requirements, but to build it in such a way that it minimizes the effort and resources to maintain/change it in the future i.e. Behavior vs. Structure
Grady’s quote is how he alludes to the goal of minimizing the cost of change • Our job isn’t only to build software that meets the stated requirements, but to build it in such a way that it minimizes the effort and resources to maintain/change it in the future i.e. Behavior vs. Structure • How do we achieve this?
resources out there to help you become better software architects, too many to possibly mention here, and so we will touch on those that I feel have provided the most value to me
that are widely established and practiced • “…SOLID principles tell us how to arrange the bricks into walls and rooms…” - Uncle Bob • Reminds us that all good software is layered and relies on composition, something we will revisit shortly.
one reason • Open/Closed principle - classes open for extension, closed for modification • Liskov Substitution principle - subtypes should be substitutable without altering correctness
one reason • Open/Closed principle - classes open for extension, closed for modification • Liskov Substitution principle - subtypes should be substitutable without altering correctness • Interface Segregation Principle - prefer small abstractions over larger ones
one reason • Open/Closed principle - classes open for extension, closed for modification • Liskov Substitution principle - subtypes should be substitutable without altering correctness • Interface Segregation Principle - prefer small abstractions over larger ones • Dependency Inversion Principle - depend only on abstractions
that change for the same reason and at the same interval • Common Reuse Principle - don’t depend on things that you don’t use • Component Dependency Principles
that change for the same reason and at the same interval • Common Reuse Principle - don’t depend on things that you don’t use • Component Dependency Principles • Avoid dependency cycles at all costs
that change for the same reason and at the same interval • Common Reuse Principle - don’t depend on things that you don’t use • Component Dependency Principles • Avoid dependency cycles at all costs • Depend on abstractions
decouple from the various dimensions that are involved: development, deployment, and operation • Like most software development/architecture, it is more art than science
decouple from the various dimensions that are involved: development, deployment, and operation • Like most software development/architecture, it is more art than science • It boils down to how to balance/delay the decision making process as much as possible for those items which aren’t essential
decouple from the various dimensions that are involved: development, deployment, and operation • Like most software development/architecture, it is more art than science • It boils down to how to balance/delay the decision making process as much as possible for those items which aren’t essential • At the end of the day, a proposed architecture should reveal the use cases of the system it supports
have discussed take time to learn • At first you will probably struggle how to balance the options that you have against your requirements. • Over time you will gain a feel for what decisions are the most important vs. those that can be deferred.
have discussed take time to learn • At first you will probably struggle how to balance the options that you have against your requirements. • Over time you will gain a feel for what decisions are the most important vs. those that can be deferred. • Most importantly remember that it is incumbent on a software architect to be vocal with respect to the Structure of a system vs. the Behavior.