1 / 16

Introduction to Domain Driven Design

Introduction to Domain Driven Design. Ganesh Subramanian 22/12/2010 http://sysin.wordpress.com http://dynamicquerygen.sourceforge.net. Problem. Problem. Diverse Characters to solve one problem Everybody talks in different language

elita
Download Presentation

Introduction to Domain Driven Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction toDomain Driven Design Ganesh Subramanian 22/12/2010 http://sysin.wordpress.com http://dynamicquerygen.sourceforge.net

  2. Problem

  3. Problem • Diverse Characters to solve one problem • Everybody talks in different language • Ultimate Result- Delivered solution is brittle and Fragile

  4. Solution • Everybody who are involved should talk in one Language • Step 1 : Agree on language terminology and definitions • Step 2: Call on the language expert • Step 3 : Use Business model to device the language

  5. Domain Driven Design What is DDD? • Not a technology or a methodology • A way of thinking and a set of priorities, aimed at accelerating software projects that have to deal with complicated domains • Primary focus on the domain and domain logic • Complex domain designs based on a model.

  6. Traditional Architecture Presentation Layer Infrastructure Layer Business Layer Data Access Layer

  7. Layered Architecture

  8. Layered Architecture (contd…) • User Interface • Responsible for showing information to the user and interpreting the user's commands • Application • Does not contain business rules or knowledge • Coordinates tasks and delegates work to domain objects • Does not have state reflecting the business situation • Interacts with application layer of other systems • Domain • Contains business logic and rules • Reflects the state of business situation • Heart of business software • Infrastructure • Provides generic technical capabilities that support the higher layers • Persistence, Sending Emails, libraries, utilities etc…

  9. Building Blocks

  10. DDD in Practice Shopping Cart Application

  11. Shopping Cart Application

  12. Shopping Cart Domain Model

  13. Building Blocks Revisited • Entity • A noun with an identity • Mutable - State can change over time • Can be associated with other entities and value objects • Can’t be shared • Value Object • A noun without an identity • Immutable - State can’t change • Can be associated with other entities • Can be shared • Aggregate • One root entity per aggregate • Associated entities can refer to root but not other entities in the aggregate • All operations are done through root

  14. Building Blocks Revisited (Contd…) • Service • Has operations that conceptually doesn’t below to an domain object • Stateless • Interface is defined in terms of other elements of the domain model • A service can be part of any layer (Application, Domain, Infrastructure) • Factory • Creates the entities and value objects • Use only when the entity creation is complex • Repository • Collection of entities • Takes care of updating an entity • Takes care of retrieving an already persisted entity • One repository per aggregate root

  15. Layers in Shopping cart App

  16. Questions ???

More Related