Favorite Physicists
Other notables: Stephen Hawking, Edwin Hubble |
Favorite Mathematicians
Other notables: Daphne Koller, Benoit Mandelbrot |
|
|
Design Principles
A Sample Tightly-Coupled Application
Design Patterns
A class should have only one reason to change
Also applies to modules and methods
If we don't separate responsibilities, a change to the details of one aspect of an application requires that another area be changed, which requires another...
Entities should depend on abstractions, not on concrete implementations
If we allow the details of an implementation to leak out, a change to the implementation of one aspect of an application requires that another area be changed, which requires another...
Our App Violates SRP
Our App Violates DIP
The 3 primary aspects of this application, the input, output & business-rules are tightly coupled
An abstract solution to a well known problem
Facade - A simplified view of an API that fronts a more complicated interface
Repository - A somewhat standardized facade that fronts a data-store
Goals of a Repository
Differences from other Facades
Our App Violates SRP
Our App Still Violates DIP
An implementation of the Dependency Inversion Principle that provides the concrete implementations of abstract dependencies to client objects
Tools for implementing Dependency Injection - Configured to hold the concrete implementations of dependencies
Goals of DI Frameworks
Usage
Our App Violates SRP
Our App Violates DIP
We now have a new set of mixed concerns (SRP violation)
An implementation of a facade that fronts an algorithm or other logic
Goals of a Strategy
Differences from other Facades
|
|
Demos & Articles
Patterns
Tooling