How to build applications using a domain driven architecture
How to BuildBusinessApplicationsLeveraging aDomain DrivenArchitecture
Who are we?•Brian Anderson• Founded OST project-based App Dev team (http://ostusa.com /@OSTgr)• 15+ years business and software development consulting experience• Crowe Chizek• SageStone -> NuSoft - > RCM Technologies• OST• Co-founder of Tourneytopia.com, PayItSquare.com andTourneyLogic.com• Twitter: @brianmatic, Github: https://github.com/brianmatic•Brian Scaturro• Consultant @OSTgr• Worked for OneUpWeb on the bay in Traverse City• Author of Paratest – https://github.com/brianium/paratest• Avid reader and open source developer• Twitter: @scaturr, Github: https://github.com/brianium
Here we goDevelopinggreenfield apps ishardMost get locked into an architecture that doesntscale and change becomes difficult and slow asthe system grows.
Why does this happen so often?Too many timesapplication architectsfocus on the technicalproblems instead ofdesigning for theproblem domain.“The most significantcomplexity of manyapplications is not technical.It is in the domain itself, theactivity or business of theuser" – Evans
Example Architecture•Tiers• UI• Business• Data Access• Database•Does this architecturerepresent thebusiness?•No…
How to do it right?•Domain Driven Design•Focus on the domain model first.•What the heck is the domain model?• Official definition:• A domain model in problem solving and software engineering isa conceptual model of all the topics related to a specific problem. It describesthe various entities, their attributes, roles, and relationships, plus theconstraints that govern the problem domain•Let us just show you…
Let’s Model• Idea = Trello.mini• Wireframes• Domain Model
Onion Architecture•The domainmodel is thecore.•Build yourarchitecturearound it.
OST Open Source Contributions•nDriven•.Net-based•https://github.com/OSTUSA/ndriven•nDriven CLI – command line interface for creatinga nDriven boilerplate project.• https://github.com/OSTUSA/ndriven-cli•Driven•PHP-based•https://github.com/OSTUSA/driven
Let’s code it• nDriven – Baseline Onion Architecture Project• Setup a new project• Develop the domain model• Look at how easy it is to interact with• Make the domain model persist to a db in the Infrastructure layer• DB schema• Create a DB through a migration• Map models to DB• Leverage the Repository design pattern• Finally, build the Presentation layer• Develop against the domain model• Use an MVC framework• Users expect modern client side interactions• It has to have a responsive design that works on all devices