4. SRP
States that every module or class should have
responsibility over a single part of the
functionality provided by the software, and that
responsibility should be entirely encapsulated
by the class
6. OCP
Objects or entities should be open for
extension, but closed for modification
Bertrand Meyer
7. OCP
States that software entities (classes, modules,
functions, etc.) should be open for extension,
but closed for modification, that is, such an
entity can allow its behavior to be extended
without modifying its source code
9. LSP
Let f(x) be a property of objects X of type T.
Then f(y) should be true for objects Y of type S
where S is a subtype of T
Barbara Liskov
10. LSP
States that if S is a subtype of T, then objects of
type T may be replaced with objects of type S
without altering any of the desirable properties
of that program (correctness, task performed)
16. DIP
A. High-level modules should not depend on
low-level modules. Both should depend on
abstractions.
B. Abstractions should not depend on details.
Details should depend on abstractions.
18. What Is IoC?
In software engineering, IoC describes a design in which
custom-written portions of a computer program receive the
flow of control from a generic, reusable library.
Wikipedia
24. What Makes Your Software Testable?
• SRP. Since type is doing only one job, you can
clearly understand what should be tested.
• LSP. Since types used can be replaced with
subtypes, mocks and stubs can be used instead
of real types.
• ISP. Since there are more granular client-specific
interfaces, you know exactly what to mock.
25. Let’s Review Some Concepts
• Reusable. Higher-level
components can be reused if
lower-lever components change
with time to meet the
requirements.
• Extensible. Software is easily
extended with new components
and features because design is
based on abstractions.
• Replaceable. Lower-level
components can be replaced to
meet new requirements without
modifying existing code.
• Loosely Coupled. Allows
components to perform on their
own with as little knowledge as
possible about other
components.
• Cohesive. Build you software
easily with different components
as building blocks.
• Testable. It is easy to understand
what and how to test in each
component because components
are loosely-coupled.
27. What can you read at home?
• Wikipedia about SOLID
https://en.wikipedia.org/wiki/SOLID_%28object-oriented_design%29
• Nice article about SOLID with examples
https://scotch.io/bar-talk/s-o-l-i-d-the-first-five-principles-of-object-oriented-design
• Dive deeper into SOLID
http://www.butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
• SOLID explanation with examples:
http://www.codemag.com/article/1001061
• Simple explanation of DI for beginners
http://www.jamesshore.com/Blog/Dependency-Injection-Demystified.html
• IoC and DI
http://martinfowler.com/articles/injection.html