Dia 1 - PowerPoint PPT Presentation

1 / 33
About This Presentation
Title:

Dia 1

Description:

DDD with C# 3.0 features: Solar System Simulation. Andre ... Rebecca Wirfs-Brock: Object Design. Eric Evans: Domain Driven Design. Blogs. http://born2code.net ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 34
Provided by: wil69
Category:
Tags: brock | dia

less

Transcript and Presenter's Notes

Title: Dia 1


1
DDD with C 3.0 features Solar System Simulation
Andre Boonzaaijer, Pieter-Joost van de
Sande aboonzaaijer, pjvdsande_at_sogyo.nl http//b
orn2code.net http//whiletrue.nl
http//sogyo.nl
2
Todays agenda
  • DDD short intro
  • Case Problem definition
  • Case C (2.0) solution
  • Case C 3.0 extensions
  • Demo

3
What is Domain Driven?
4
Its not Layering
Presentation Layer
Data Layer
5
Layering
Presentation Layer
Business logic
Data Layer
6
Layering
Presentation Layer
Data Layer
Business logic
7
Layering
Presentation Layer
Business logic
Data Layer
8
Layering
/- 2 years
Presentation Layer
Business logic
Data Layer
9
Layering
/- 2 years
Presentation Layer
Business logic
/- 5 years
Data Layer
10
Layering
/- 2 years
Presentation Layer
?
Business logic
/- 5 years
Data Layer
11
Layering
Where?
Presentation Layer
Printing
Email
Business logic
Email
SMS
Data Layer
12
Layering
Presentation Layer
Business logic
Data Layer
13
Sunflower
14
Case
  • Build a runnable solar system simulator
  • 1 star in the centre
  • Configurable amount of planets (mass is max 1 of
    the stars mass)
  • Laws of physics
  • F M a
  • Fg M1M2 / d2
  • Starting point Random generated
  • Draft a domain model.

15
Gravity
(x,y)
force 0 Foreach body in universe force
body.getForce(x,y) body.move(force)
16
Domain
17
Wrapping the domain
Bootstrapper / Host
User Interface
Clock
Database
18
User Interface
19
Clock
  • Standard implementation
  • Configurable interval
  • Start(), Stop(), Tick event

20
Database
  • O/R bridging
  • Table per domain class
  • Column for public properties (discussion)
  • Associations converted to foreign keys

?
21
Bootstrap
  • Instantiation (create form, clock and universe
    components)
  • Event subscription

22
Domain in C 3.0
23
Domain in C 3.0
24
Universe class Methods
  • TimerPassed() method
  • - Classic
  • - Lambda

25
Universe class Methods
  • GetPlanetsInRange() Method

26
Universe class Methods
  • GetPlanetsInRange() Method Lambda

27
Universe class Methods
  • GetPlanetsInRange() Method LINQ

28
Form1 class Methods
DrawUniverse Who is responsible? UI.DrawUniverse
() vs Universe.Draw()
29
Universe.Draw() Extension
30
Universe.Draw() Extension
31
Extension Methods How
  • Add a Static class to your namespace
  • Add static methods for each extension
  • Add a this parameter to the ext. method

32
Refences
  • DDD Masterclass (http//domaindrivendesign.nl)
  • Rebecca Wirfs-Brock Object Design
  • Eric Evans Domain Driven Design
  • Blogs
  • http//born2code.net
  • http//whiletrue.nl
  • http//software-innovators.nl

33
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com