latest and trendiest? a template in visual studio? the best best practice? no! much better! i...
TRANSCRIPT
![Page 1: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/1.jpg)
![Page 2: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/2.jpg)
Developing core-business applications with DDDJimmy Nilsson, factor10
DEV-B311
![Page 3: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/3.jpg)
About meDeveloper/architectjimmynilsson.com/blog
Twitter: @JimmyNilsson
Author”Applying Domain-Driven Design and Patterns” and”.NET Enterprise Design”
CompanyCo-founder and CEO for factor10
![Page 4: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/4.jpg)
Context
Exponential effect!
Dare to challenge!TDomain-Driven Design (DDD)
![Page 5: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/5.jpg)
How we as humans/developers are
![Page 6: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/6.jpg)
![Page 7: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/7.jpg)
![Page 8: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/8.jpg)
![Page 9: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/9.jpg)
![Page 10: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/10.jpg)
![Page 11: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/11.jpg)
![Page 12: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/12.jpg)
![Page 13: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/13.jpg)
Why Domain-Driven Design?Latest and trendiest?A template in Visual Studio?The best best practice?
No! Much better!
I believe that DDD can help very much in creating business value.
![Page 14: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/14.jpg)
What is software development all about? $Why?
What?
How?
”Code!”
? ? ? And so on…
$
![Page 15: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/15.jpg)
Basic software economics
Complexity
Productivity
Question is, is it essential complexity or accidental complexity?
![Page 16: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/16.jpg)
Not just code in control
...the size is of tremendous importance!
The size…- drives cost- drives bugs- drives delays- drives team size, which drives code size…
![Page 17: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/17.jpg)
What is Domain-Driven Design?Domain-Driven Design is an approach to the
development of complex software in which we:
• Focus on the core domain
• Explore models in a creative collaboration of domain practitioners and software practitioners
• Speak a ubiquitous language within an explicitly bounded context
http://domainlanguage.com/ddd/patterns/DDD_Reference_2011-01-31.pdf
![Page 18: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/18.jpg)
Problem and chosen solution
Model
UmlAsASketch
UbiquitousLanguage Code
Model, code, etc... How do they fit together?
UI
![Page 19: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/19.jpg)
Demo
Ubiquitous language and bounded context
![Page 20: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/20.jpg)
Argh! Why not come up
with ten more words
for describing the same thing…
Why on Earth does
he care about that?
It’s just words…
![Page 21: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/21.jpg)
Ubiquitous language with Behavior-Driven Development (BDD)As an insurance brokerI want to know who my gold customers areSo that I sell more
Given customer Sven Svensson existsWhen he buys insurance XYZ for 10000 USDThen he becomes a gold customer
![Page 22: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/22.jpg)
Demo
Learning and collaborating
![Page 23: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/23.jpg)
Sigh, he’s coming with that now!?
Sigh, he’s coming with that now!?
![Page 24: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/24.jpg)
A comparison between domain-driven design and database-driven design, a few simple examples
”Customers have rentals”Customer Rental
![Page 25: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/25.jpg)
Some typical T-SQL...IF (SELECT COUNT(*) FROM RentalLines
INNER JOIN Products ON RentalLines.ProductId = Products.Id WHERE RentalId = inserted.Id AND RequiredAge > @ageOfCustomer) > 0 BEGIN
ROLLBACK RAISERROR... RETURN
END
UPDATE Rentals SET Status = 4 WHERE Id = inserted.IdAND Status = 3SELECT @anError = @@ERROR, @aRowCount = @@ROWCOUNT
...
![Page 26: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/26.jpg)
Another approach, first try...public bool CanCheckOut(){ if (status != RentalStatus.New) return false;
if (Customer.Age < highestRequiredAgeOfAnyOfTheChosenFilms())
return false;
return true;} public void CheckOut(){ if (! CanCheckOut()) throw new...
...
status = RentalStatus.CheckedOut;}
![Page 27: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/27.jpg)
Transaction Script vs Domain Model
vs
![Page 28: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/28.jpg)
If I can only talk about one tactical pattern…
![Page 29: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/29.jpg)
Value Objects
![Page 30: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/30.jpg)
Like this?var stinasEggs = 7 * 12;
var pellesEggs = 3 * 20;
var theNumberOfEggsInTheBasket = stinasEggs + pellesEggs;
Assert.AreEqual(144, theNumberOfEggsInTheBasket);
![Page 31: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/31.jpg)
Or like this?var stinasEggs = Amount.Dozen(7);
var pellesEggs = Amount.Score(3);
var theNumberOfEggsInTheBasket = stinasEggs + pellesEggs;
Assert.AreEqual(144, theNumberOfEggsInTheBasket.Count);
![Page 32: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/32.jpg)
Architectural styles for implementing DDD
![Page 33: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/33.jpg)
Classic layering (n-tier)
UI Facade EntitiesData
AccessTables
Most often very little focus
Traveling recordsets...
![Page 34: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/34.jpg)
Starting point now for layering
UI Domain Model
![Page 35: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/35.jpg)
Relaxed focus on layering, more focus on……bounded contexts!
With application databases instead of integration databasesAnd balancing loose coupling and high cohesion
![Page 36: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/36.jpg)
Maybe you now believe you can benefit from DDD... Now what?
What follows is definitely not a prescriptive guidance...
…just an example!
![Page 37: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/37.jpg)
Demo
“Process”
![Page 38: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/38.jpg)
Time report…
![Page 39: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/39.jpg)
“Process” or more like a typical flowA little strategic design
A story and scenarioUI sketchingSome UmlAsASketchTransform the scenario into an acceptance test
Test drive the needed pieces
Next story, and so on...
![Page 40: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/40.jpg)
SummaryChallenge
Domain-Driven Design
![Page 41: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/41.jpg)
Related contentAll the presentations at this track:Cesar de la Torre: Positioning Microsoft Development Technologies for Custom Application Development (DEV-B204)Per Rovegård: Real Experience and Architectural DDD Patterns Applied on .NET (DEV-B343)Julie Lerman: Entity Framework in Core Business Applications and DDD Approaches (DEV-B336)Greg Young: .NET Event Driven Applications, CQRS and Event Sourcing in Mission-Critical Applications (DEV-B401)Miguel Castro: Understanding Dependency Injection and Those Pesky Containers (DEV-B207)BooksEric Evans: Domain-Driven DesignJimmy Nilsson: Applying Domain-Driven Design and PatternsVaughn Vernon: Implementing Domain-Driven Design
Find Me Later At this trackor at [email protected]
![Page 42: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/42.jpg)
msdn
Resources for Developers
http://microsoft.com/msdn
Learning
Microsoft Certification & Training Resources
www.microsoft.com/learning
TechNet
Resources
Sessions on Demand
http://channel9.msdn.com/Events/TechEd
Resources for IT Professionals
http://microsoft.com/technet
![Page 43: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/43.jpg)
Complete an evaluation on CommNet and enter to win!
![Page 44: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/44.jpg)
Evaluate this session
Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize
![Page 45: Latest and trendiest? A template in Visual Studio? The best best practice? No! Much better! I believe that DDD can help very much](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f335503460f94c4ffe3/html5/thumbnails/45.jpg)
© 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.