DDD Flashcards
(41 cards)
What is the key to controlling complexity in software development?
A good domain model that goes beyond surface vision and introduce an underlying structure.
Why should concepts not be separated from their implementation in domain modelling?
The greatest value a domain model provides a ubiquitous language that ties domain experts and technologists together.
What is domain driven design in large strokes?
Its both a way of thinking and a set of priorities, aimed at accelerating software projects that have to deal with complicated domains.
How does extreme programming view design?
It is important. But it resists upfront design. It rather puts effort into a project’s ability to change course rapidly. When we can change course rapidly we can settle with the simplest thing that could work, and then continuously refactor the solution. This is an antidote to analysis paralysis.
What is a model?
A model is a selectively simplified and consciously structured form of knowledge. An appropriate model makes sense of information and focuses it on a problem.
A domain model is a rigorously organized and selective abstraction of the knowledge inside a domain experts head. Domain modelling is not a matter of making as realistic as possible, rather a loosely representation to a particular purpose.
What is the heart of software?
Its ability to solve domain-related problems for its users. All other features support this basic purpose. Complexity at the heart of software has to be tackled head-on. To do otherwise is to risk irrelevance.
What are the ingredients of effective modeling?
- Binding the model and the implementation - crude prototype users can see and comment on.
- Cultivating a language based on the model.
- Developing a knowledge-rich model. The model was not just a data schema; it was integral to solving a complex problem. It captures knowledge of various kinds.
- Distilling the model. Concepts are dropped from the model when they are not important or useful. A new model can be made to concepts that do not belong.
- Brainstorming and experimenting.
What role do prototypes and early versions play when modelling the domain?
Feed experience back into the team, change interpretations and validate hypothesis.
What are the disadvantages of simply receiving a feature list from experts and just build them?
Developers only learn what the application should do and not the fundamental principles behind it. The application will never arrive at a point where powerful features unfold as corollaries to older features.
Why can even what looks like a simple domain turn out complex?
Domain experts are usually not aware of how complex their mental processes are. They navigate a lot of rules, reconcile contradictions and fill in the gaps with common sense.
What advantages are there to using an explicit model and design to model business rules?
- In order to bring the design to this stage, the programmers and everyone else involved will have to come to understand the nature of the business rules as a distinct and important business rule, not just and obscure calculation.
- Programmers can show business experts technical artifacts, even code, that should be intelligible to domain experts. Thereby, closing the feedback loop.
What are the dangers of translation between domain experts and developers?
Translation muddles model concepts, which may lead to destructive refactoring of code. The indirectness of translations makes it hard to develop clear modules that need to fit together since developers and domain experts may interpret translation in their own way.
A project faces serious problems when its language is fractured (developers and domain experts do not understand each other).
What is the vocabulary of a ubiquitous language ?
It includes that names of classes and prominent operations. The language includes terms to discuss rules that have been made explicit in the model.
With a ubiquitous language, the model is not just a design artifact. It becomes integral to everything the developers and domain experts do together.
How is a ubiquitous language formed?
Cultivated in the intersection of jargons between developers and domain experts. Conversations between developers, discussions among domain experts and expressions in code are all based on the same language, derived from a shared domain model. That is updated and evolve over time as developers process information from domain experts and domain experts accept/protest interpretations of their information.
What are the limits of code as a “design document/documentation”?
It can overwhelm the reader with detail. The behavior is not always obvious and the meaning/intention/reason for a behavior can be hard to convey.
What is the problem with only using an analysis model (analyzing the problem domain to gain understanding)?
Some knowledge crunching happens during such analysis, but most of it is lost when coding begins, when developers are forced to come up with new abstractions for the design.
What is the danger of viewing domain analysis and development as separate processes?
If we think of analysis and development as separate processes then the connection between the two will loosen and its impossible to maintain the relationship as the design changes. Additionally, developers might not have adequate access to domain experts.
Insights gained in the two do not feed into the other.
What is the specification pattern?
The specification pattern is about encapsulating a piece of domain knowledge into a single unit (called specification) which we can then reuse during:
1. data retrieval
2. in-memory validation (controversial because of “always-valid model guideline”) but can be used to work on-top of valid objects to perform validations before performing certain domain operations.
3. creation of new objects
4. bulk updates, combined with a command that uses the preconditions from the specification.
What is the command pattern?
The command pattern encapsulates the knowledge of how to update domain model data. But the term is overloaded a means different things in different contexts:
CQRS (command-query-responsibility-segregation): a command is a class that represents an operation.
CQS (command-query-separation): any method that creates a side effect.
GoF (Gang of Four): a command is a class that encapsulates all information needed to perform an action.
What is the always-valid domain model guideline?
Says that domain model class should guard themselves from ever becoming invalid. This means validating input before instantiating objects.
Why is it a bad idea to separate workers into modellers and programmers when working with a model-driven design?
If developers do not feel responsible for the model and do not realize how their refactoring changes the model, then the model could become weaker. Modellers loose understanding of the constraints on implementations their model results in.
Why is it necessary to isolate the domain?
The part of the software that actually deals with problems from the domain is usually only a small portion. We need to decouple this central part of the system to avoid confusing the domain concepts with other concepts related only to software technology.
What are some ways architectural frameworks can get in the way of development?
By making too many assumptions that constrain domain design choices or by making the implementation so heavyweight that development slows down.
A lot of the downsides of frameworks can be avoided by applying them selectively to solve difficult problems without looking for a one-size-fits-all solution. Elaborate frameworks can straitjacket application developers.
What is the main criteria for an architecture in order to support domain-driven design?
If the architecture isolates the domain-related code in a way that allows a cohesive domain design loosely coupled to the rest of the system, then that architecture can probably support domain-driven design.