Unitiv Partial
Unitiv Partial
Unitiv Partial
Domain-Driven Design
to business.
infrastructure.
• Domain-driven design talks about two kinds of design tools,
design tools.
Context:
Model –
• Bounded Context –
domain.
and factories. They have all coined and made popular by Domain-
Driven design.
Tactical Design- A navigation map of the language of MODEL-DRIVEN
DESIGN
• Entity –
• Value Objects –
identity.
• Services –
A service is a stateless class that fits somewhere else other than an entity or value
and values objects but it is neither related to an entity nor values objects.
• Aggregates –
When we have bigger project, object graph becomes big, The bigger object graph
lifecycle of an aggregate.
Advantages of Domain-Driven Design :
It provides flexibility
automation.
developers integrate their code changes early and often to the main
security.
How to get started with Continuous
Integration
• One of the primary benefits of adopting CI is that it will save you time
early. It’s also a great way to reduce the amount of time spent on fixing
To get the full benefits of CI, you will need to automate your tests to
be able to run them for every change that is made to the main
repository.
do everything at once if you’re just getting started. You can start small
with unit tests and work on extending your coverage over time.
Unit tests are narrow in scope and typically verify the behaviour of
Acceptance tests are similar to the integration tests but they focus on
UI tests will make sure that the application functions correctly from a
user perspective.
Testing triangle
Unit tests are fast and cheap to implement as they're mostly doing
the number of complex UI tests and rely on good Unit testing at the
possible.
Run your tests automatically:
every change that gets pushed back to the main branch. To do so,
you will need to have a service that can monitor your repository
solutions that you can choose from both on-premise and in the
Cloud.
In the past, you typically had to install a separate CI server like
Bamboo or Jenkins, but now you can find solutions on the Cloud
that are much simpler to adopt. For instance, if your code is hosted
concurrency.
Use code coverage to find untested code:
with a test coverage tool that will give you an idea of how much of
coverage tool will help you find untested code but it is the quality
of your tests that will make the difference at the end of the day.
Refactoring is an opportunity to add tests:
that may be impacted. This will provide you with a safety net to
ensure that the original behavior has not been affected after you've
production.
layers.
Application Layer
Infrastructure Layer
User Interface (or Presentation Layer)
Responsible for showing information to the user and interpreting the user's commands. The
external actor might sometimes be another computer system rather than a human user.
Application Layer Defines the jobs the software is supposed to do and directs the expressive
domain objects to work out problems. The tasks this layer is responsible for are meaningful to
the business or necessary for interaction with the application layers of other systems.
This layer is kept thin. It does not contain business rules or knowledge, but only coordinates
tasks and delegates work to collaborations of domain objects in the next layer down. It does
not have state reflecting the business situation, but it can have state that reflects the progress
Responsible for representing concepts of the business, information about the business
situation, and business rules. State that reflects the business situation is controlled and
used here, even though the technical details of storing it are delegated to the infrastructure.
Infrastructure Layer
Provides generic technical capabilities that support the higher layers: message sending for
the application, persistence for the domain, drawing widgets for the UI, and so on. The
infrastructure layer may also support the pattern of interactions between the four layers
• Services
• Packages
• Modules
• Value objects
• Value objects are attributes that describe the state of something else. They have no conceptual
identity, they describe a characteristic of another object. They are properties of other objects.
• Value objects are different than entities in how they need to be tracked. If only the value is
relevant, we are in presence of a value object. If it is also relevant what value we are referring
• A VALUE OBJECT can give information about an ENTITY. It should be conceptually whole.
• Entities
model. They exist on their own right, they can not be swapped by another
object with the same data, they are crucial in the domain logic.
• Associations
implementations.
the domain.
Driven Design Hands‐on Models
An interesting software design technique to understand and solve
cases. As it is now getting older and hype level decreasing, many of us forget
that the DDD approach really helps in understanding the problem at hand
adds many technical concepts, like entities, value objects and aggregate root
developing them separately from the beginning with the help of bounded
object:
• Aggregates: Hold several objects in a root object and can control their
Aggregates are entities that own other entities or association objects. But
web-shop we have a product, lets say a t-shirt, who has variants, lets say
The owned objects can only be reached through the aggregate root;
The owned objects can be used by external objects, but these can not
at some point, to maintain the domain objects clear and clean of logic
provide encapsulation.
Lifecycle of a domain object
Lifecycle of a domain object
Repositories: