$30 off During Our Annual Pro Sale. View Details »

Finding The Sweet Spot BNE

Andrew Best
December 02, 2017

Finding The Sweet Spot BNE

DDD, CQRS, and ORMs - Finding the sweet spot between these development techniques

Andrew Best

December 02, 2017
Tweet

More Decks by Andrew Best

Other Decks in Programming

Transcript

  1. View Slide

  2. #dddbne
    Please support our sponsors

    View Slide

  3. Fill out your feedback
    To go into the draw for prizes, please
    remember to complete your feedback at:
    http://www.dddbrisbane.com/feedback
    No feedback = No Prizes!
    #dddbne

    View Slide

  4. 2 December 2017 | Andrew Best

    View Slide

  5. Domain Driven Design
    At it’s heart, DDD is about
    TAMING COMPLEXITY
    It allows us to reason about the software we are building,
    explicitly modelling our problem domain in unambiguous terms
    and supplying well-defined semantics for its concepts.
    December 17 2

    View Slide

  6. Meet the > Our domain model facilitates the real-world process
    requirements from our problem domain – This is what it
    should be doing
    > Our applications’ demands on their persisted state extend
    beyond our domain model – Task-based UIs, Reporting,
    Exporting, etc.
    > Often the domain model becomes the single façade over our
    persistence layer – it is set to work servicing these additional
    demands as well
    > It then becomes MORE COMPLEX
    > It then becomes HARDER TO REASON ABOUT
    > And then you add an ORM
    December 17

    View Slide


  7. Object/relational mapping is
    the Vietnam of Computer
    Science
    Ted Neward
    http://blogs.tedneward.com/post/the-vietnam-of-computer-science/

    View Slide

  8. The Codes, Part One:
    Death to the
    Repository!

    View Slide

  9. CQRS >Event Sourcing
    >Eventual Consistency
    >Asynchronous Messaging
    >Separate Persistence
    Mechanisms
    December 17

    View Slide

  10. CQRS >Using separate conceptual
    models to read and write
    information.
    >fin
    December 17

    View Slide

  11. The Codes, Part Two:
    The Sweet Spot

    View Slide

  12. CQRS >Read and write concerns truly
    separated
    >Can co-evolve without side
    effects
    >Minimal additional complexity
    >Use the best tool for the job
    December 17

    View Slide

  13. DDD >No longer have composite
    UI/other concerns polluting
    our domain
    >Disconnect our domain model
    >Can better enforce
    consistency boundaries
    >Further reading:
    http://dddcommunity.org/library/verno
    n_2011/
    December 17

    View Slide

  14. Abstraction >Removed the potential foot-
    gun of complex EF queries
    >Improved query transparency
    >Can write tailored, specific
    queries that suit individual
    demands
    >But what about that type
    safety we just gave up?
    December 17

    View Slide

  15. The Codes, Part
    Three:

    View Slide

  16. Thank You!
    @_AndrewB
    https://github.com/andrewabest

    View Slide