Presentation is loading. Please wait.

Presentation is loading. Please wait.

Domain Driven Design Using.NET Dave Rael. What’s wrong with this code? Public void CallMethodThatMightThrowScaryException(int carelessInputWithoutValidation)

Similar presentations


Presentation on theme: "Domain Driven Design Using.NET Dave Rael. What’s wrong with this code? Public void CallMethodThatMightThrowScaryException(int carelessInputWithoutValidation)"— Presentation transcript:

1 Domain Driven Design Using.NET Dave Rael

2 What’s wrong with this code? Public void CallMethodThatMightThrowScaryException(int carelessInputWithoutValidation) { MethodThatMightThrowScaryException(carelessInputWithoutValidation); } catch (Exception exception) { HandleException(exception); }

3 “There is no try.”

4

5 Why Domain-Driven? Collaboration Ubiquitous Language Using Composition to address complexity in large systems “Not all of a large system will be well-designed.” –Eric Evans “Is BDD the same as TDD? Yes. If you’re a programmer, and your entire team is programmers, and all your stakeholders are programmers…” –Dan North http://dannorth.net/2012/05/31/bdd-is-like-tdd-if/ http://dannorth.net/2012/05/31/bdd-is-like-tdd-if/

6 The alternative – One database schema to rule them all

7 Pain!

8 Bounded Contexts

9 Bounded Contexts (or Services) (or Silos)

10 Domain-Driven Design Ubiquitous Language Bounded Contexts Domain Events Top-Level System Architecture

11 Domain Driven Design Ubiquitous Language Aggregates CQRS Architecture/Implementation Within a Bounded Context

12 Fitting It Together public interface IDomainDrivenDesign { } public abstract class ServiceOrientedArchitecture : IDomainDrivenDesign { } public class YourDomain : ServiceOrientedArchitecture { }

13 Commands Sent rather than Published Imperative Issued with authority to command (within a bounded context) DestroyPlanetCommand LaunchProtonTorpedoesCommand

14 Events Published rather than Sent Past-tense Describe an event that has already happened “Look what I have done!” PlanetDestroyedEvent ProtonTorpedoesLaunchedEvent UrineDepositedInToiletEvent

15 Commands And Events Bus.Send (); Bus.Reply (); Bus.Publish ();

16 Stuff to Clone Loans https://github.com/raelyard/Loans.git https://github.com/raelyard/Loans.PublicEvents.git Fines https://github.com/raelyard/Fines.git https://github.com/raelyard/Fines.PublicEvents.git http://optimizedprogrammer.com/blog/presentations-on-domain-driven-design

17 You will use a Domain-Driven Design Approach


Download ppt "Domain Driven Design Using.NET Dave Rael. What’s wrong with this code? Public void CallMethodThatMightThrowScaryException(int carelessInputWithoutValidation)"

Similar presentations


Ads by Google