{"_id":"5600931e1503430d007cc939","githubsync":"","user":"56000e979e7ccf0d000a1e66","__v":8,"category":{"_id":"560e3ce7ad6b200d00ff471c","pages":["560e403bc4e4ae0d00b42ed7","560e4066ad6b200d00ff471e","5615e7f2a6767c0d0016699b","56a44cd75fb2530d00421b6f"],"project":"56000f0d8c0c9d0d00dcad21","__v":4,"version":"56000f0e8c0c9d0d00dcad24","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-10-02T08:14:31.057Z","from_sync":false,"order":2,"slug":"architecture-foundations","title":"Architecture Foundations"},"project":"56000f0d8c0c9d0d00dcad21","version":{"_id":"56000f0e8c0c9d0d00dcad24","project":"56000f0d8c0c9d0d00dcad21","__v":13,"createdAt":"2015-09-21T14:07:10.176Z","releaseDate":"2015-09-21T14:07:10.176Z","categories":["56000f0e8c0c9d0d00dcad25","56008f2497f69f1700f21a36","560091601503430d007cc936","560e0d8054af2b0d005bbe92","560e3ce7ad6b200d00ff471c","560e3cf2c4e4ae0d00b42ed1","561c81d0e822e12b00e1fe00","561c81e9e822e12b00e1fe01","561c823d20b4a92b007d5147","56257f8951bf1c0d001f660a","562d5f165bd25e0d0054dbd4","562d68d5d38b650d0044472a","56421aebb0dc090d00f88438"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-21T23:30:38.094Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"#### What is a domain?\n*The field for which a system is built.*\n\nAirport management, insurance sales, coffee shops, orbital flight, you name it.\nIt's not unusual for an application to span several different domains. For example,\nan online retail system might be working in the domains of shipping (picking\nappropriate ways to deliver, depending on items and destination), pricing\n(including promotions and user-specific pricing by, say, location), and\nrecommendations (calculating related products by purchase history).\n\n#### What is a model?\n*\"A useful approximation to the problem at hand.\" -- Gerry Sussman*\n\nAn `Employee` class is not a real employee. It models a real employee. We know\nthat the model does not capture everything about real employees, and that's not\nthe point of it. It's only meant to capture what we are interested in for the\ncurrent context.\n\nDifferent domains may be interested in different ways to model the same thing.\nFor example, the salary department and the human resources department may model\nemployees in different ways.\n\n#### What is Domain-Driven Design (DDD)?\nIt is a development approach that deeply values the domain model and connects\nit to the implementation. DDD was coined and initially developed by Eric Evans\nin his great book [Domain-Driven Design: Tackling Complexity in the Heart of Software](http://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215).\n\n*You can read more about DDD here:*\n\n* [An Introduction to Domain Driven Design](http://www.methodsandtools.com/archive/archive.php?id=97)\n* [Domain Driven Design Quickly - Great Book!](http://www.infoq.com/minibooks/domain-driven-design-quickly)\n* [Common DDD mistakes](http://www.infoq.com/news/2015/07/ddd-mistakes)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Effective Aggregate Design\"\n}\n[/block]\nWIP Notes:\n- Avoid transactional errors in multi-user environment\n- http://dddcommunity.org/library/vernon_2011/\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Subscribe to domain events to integrate bounded contexts\"\n}\n[/block]","excerpt":"Structure, practices and terminology for making design decisions in complex software.","slug":"basics","type":"basic","title":"Domain Driven Design"}

Domain Driven Design

Structure, practices and terminology for making design decisions in complex software.

#### What is a domain? *The field for which a system is built.* Airport management, insurance sales, coffee shops, orbital flight, you name it. It's not unusual for an application to span several different domains. For example, an online retail system might be working in the domains of shipping (picking appropriate ways to deliver, depending on items and destination), pricing (including promotions and user-specific pricing by, say, location), and recommendations (calculating related products by purchase history). #### What is a model? *"A useful approximation to the problem at hand." -- Gerry Sussman* An `Employee` class is not a real employee. It models a real employee. We know that the model does not capture everything about real employees, and that's not the point of it. It's only meant to capture what we are interested in for the current context. Different domains may be interested in different ways to model the same thing. For example, the salary department and the human resources department may model employees in different ways. #### What is Domain-Driven Design (DDD)? It is a development approach that deeply values the domain model and connects it to the implementation. DDD was coined and initially developed by Eric Evans in his great book [Domain-Driven Design: Tackling Complexity in the Heart of Software](http://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215). *You can read more about DDD here:* * [An Introduction to Domain Driven Design](http://www.methodsandtools.com/archive/archive.php?id=97) * [Domain Driven Design Quickly - Great Book!](http://www.infoq.com/minibooks/domain-driven-design-quickly) * [Common DDD mistakes](http://www.infoq.com/news/2015/07/ddd-mistakes) [block:api-header] { "type": "basic", "title": "Effective Aggregate Design" } [/block] WIP Notes: - Avoid transactional errors in multi-user environment - http://dddcommunity.org/library/vernon_2011/ [block:api-header] { "type": "basic", "title": "Subscribe to domain events to integrate bounded contexts" } [/block]