Lecture 1
Lecture 1
Architecture
LECTURE 1
Software Design and
Architecture
Understanding how to:
•Architect a system to serve the needs of its users
•Write code that's easy to change
•Write code that's easy to maintain
•Write code that's easy to test
Software Design and
Architecture
Even though you know how to write code to make things work at
least once, the bigger challenge is to figure out how to write code
that makes it easy to change in order to keep up with the current
requirements.
And since the needs of our users changes often, it's important to
make sure that software was designed in order to be
changed.
• being consistent
• preferring meaningful variable, method and class names over
writing comments
• ensuring code is indented and spaced properly
• ensuring all of the tests can run
• writing pure functions with no side effects
• not passing null
Clean Code
My definitive explanation of clean code consists of:
Learning Resources
"
Clean Archi
tecture
"
(10th edition)
Stage 3 : Object-Oriented
Programming
•Object-Oriented programming enable us to create a plugin
architecture and build flexibility into our projects.
•OOP comes with the 4 principles of OOP that help us create rich
domain models.
o Encapsulation,
o Inheritance,
o Polymorphism
o Abstraction
Learning Resources
• validation logic
• invariant rules
• domain events
• use cases
• complex queries
• and business logic
Object-Relational
mapper
If we simply use an ORM
like Sequelize or TypeORM a
s the model, all that
important stuff to gets left
to interpretation on where it
should go, and it finds itself
in some unspecified layer
between (what should be a
rich) model and
the controller.
solidbook.io
Enterprise Patterns
For each of those things that MVC fails to address, in Domain-Driven Design
specifically, there exist several enterprise patterns to solve them. For
example:
• Entities describe models that have an identity.
• Value Objects are models that have no identity and can be used in order to
encapsulate validation logic.
• Domain Events are events that signify some relevant business event
occurring and can be subscribed to from other components.
Depending on the architectural style you've chosen, there are going to be a ton of
other enterprise patterns for you to learn in order to implement that pattern to it's
fullest potential.
Learning Resources
• Patterns of Enterprise Application Architecture, by
Martin Fowler
• Enterprise Integration Patterns, by Gregor Hohpe
• Domain Driven Design, by Eric Evans
• Implementing Domain-Driven Design, by Vaughn
Vernon
References
•Wikipedia: List of architectural styles and patterns
•Architectural styles vs. architectural patterns vs. design
patterns
•The Clean Architecture