![]() ![]() Move complex queries into Value Objects to reduce side effects. Furthermore, all Value Object operations should be functions as they are immutable and have no state. Where possible, return Value Objects from functions so you don't have to maintain its life-cycle. Commands should not return domain data - leave that to functions. Commands cause change of state and should be kept separate from queries (CQRS). ![]() ![]() Function should be able to be called repeatedly and deeply nested. Functions are predictable and safe. Functions do not affect the state of an object and are therefore 'side-effect-free'. Describe purpose and effect but not how it is achieved and always with Ubiquitous language. Specs defined in terms of interfaces decouple designs and help clear logjams by using prototypes.ġ0 - Supple Design - Relieve the client from having to know about the implementation by using Intention Revealing Interfaces. Specifications work well with repositories by specifying criteria to select against, esp with ORMs. Specifications determine if an object satisfies a condition, the logic having probably been extracted from an attribute of the property. The Specification Pattern provides a way of expressing conditional rules explicitly in the model (predicates) whilst keeping the logic in the domain layer. DIFFMERGE 3.3 CODEOr if requirements conversation revolves around the constraint but they are hidden in procedural code within the object. Constraints do not belong in the object if they require data that doesn't fit in the object's definition. Explicit Constraints, such as invariants, should be extracted in the design so that their intention is more obvious by using descriptive method names within the object. Business books on the domain are a great source of information when the domain expert is not available. Usually contradictions from opposing domain experts can reveal deeper insight to the domain. Actively engage domain experts in the search, play with ideas or use them for validation. When the missing concept is not on the surface of conversations with domain experts, try digging around the most awkward part of the design - i.e. Watch for puzzled expressions on domain experts faces when you mention particular phrases. It is a warning when the experts use vocabulary that is not present in the design. Listen to the language the domain experts use. Breakthroughs can lead to a cascade of more breakthroughs.ĩ - Making Implicit Concepts Explicit - Developers need to sensitize to the hints revealing implicit concepts and sometimes search them out. Watch for opportunities to gain deeper insight and do not hesitate to make even minor improvements. Concentrate on knowledge crunching and cultivating robust Ubiquitous Language. Part III Refactoring Toward Deeper Insight 8 - Breakthrough - Breakthroughs cannot be forced, the usually occur after many modest refactorings. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |