DevLOVE Beautiful Development - 第一幕 陽の巻
Upcoming SlideShare
Loading in...5
×
 

DevLOVE Beautiful Development - 第一幕 陽の巻

on

  • 4,947 views

 

Statistics

Views

Total Views
4,947
Views on SlideShare
4,862
Embed Views
85

Actions

Likes
14
Downloads
45
Comments
1

4 Embeds 85

https://twitter.com 74
http://coderwall.com 5
http://s.deeeki.com 3
http://www.mashme.tv 3

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

DevLOVE Beautiful Development - 第一幕 陽の巻 DevLOVE Beautiful Development - 第一幕 陽の巻 Presentation Transcript

  • DDD Pt.IIBuilding Blocks ~DDD ~ ( ) - tricreo.jp / Jiemamy Project - jiemamy.org 2011.04.09 @
  • • (@daisuke_m)• Jiemamy / java-ja• Apache Mahout• Java / OO / DDD•
  • works• @IT — Jiemamy• • Java • Java• Java: The Good Parts ( )• DDD ( )
  • DDD http://d.hatena.ne.jp/daisuke-m/20110407/1302156870• Jiemamy Project••• DDD•• Jiemamy version 0.3• baseunits library (timeandmoney)
  • Jiemamy• ER • Eclipse (UI ) • DB , SQL ( ) • SQL… • XML I/O, DDD ( )
  • Agenda• DDD overview• Isolating the Domain• Model• LifeCycle
  • §0 DDD overview• DDD • GoF • PoEAA
  • DDD PATTERNS• STRATEGY • OPEN HOST SERVICE• COMPOSITE • CORE DOMAIN• BOUNDED CONTEXT • GENERIC SUBDOMAINS• CONTINUOUS INTEGRATION • DOMAIN VISION STATEMENT• CONTEXT MAP • HIGHLIGHTED CORE• SHARED KERNEL • COHESIVE MECHANISMS• CUSTOMER/SUPPLIER DEVELOPMENT TEAMS • SUGGESTED CORE• CONFORMIST • ABSTRACT CORE• ANTICORRUPTION LAYER • EVOLVING ORDER• SEPARATE WAYS • SYSTEM METAPHOR• OPEN HOST SERVICE • RESPONSIVILITY LAYERS• PUBLISHED LANGUAGE • KNOWLEDGE LEVEL• INTEGRATION • PLUGGABLE COMPONENT FRAMEWORK
  • DDD PATTERNS• UBIQUITOUS LANGUAGE • FACTRIES• MODEL-DRIVEN DESIGN • REPOSITORIES• HANDS-ON MODELERS • SPECIFICATION• LAYERED ARCHITECTURE • INTENTION-REVEALING INTERFACES• THE SMART UI "ANTI-PATTERN" • SIDE-EFFECT-FREE FUNCTION• ENTITIES• VALUE OBJECTS • ASSERTIONS• SERVICES • CONCEPTUAL CONTOURS• MODULES • STANDALONE CLASSES• AGGREGATES • CLOSURE OF OPERATIONS
  • ••••( )
  • • • •
  • Domain or Not••• HISTORY••••
  • • UI• DB•• DB
  • ••••
  • • →• →• ® • •• ® • •
  • •••
  • •• •• Model Driven Design ( ) •
  • Model or Not• LibHTTP • User• Search • File• FacebookLogin • String• Translation • StringBuilder• FoobarLogic • YearMonth
  • §1•• • • UI
  • LAYERED ARCHITECTURE•• ;•
  • Jiemamy DiagramEditor TableView DbObjectEditPart maven-jiemamy-plugin UI jiemamy eclipse plugin ExecuteMojo Application jiemamy-diagram JmDiagram JmNode / JmConnection SqlStatement jiemamy-sql Domain Token JmTable / JmView JmColumn jiemamy-core JmForeignKeyConstraint woodstoxSqlExecutor / UUIDProvider XMLInputFactory Infrastructure XMLValidationSchema jiemamy-commons apache commons
  • THE SMART UI "ANTI-PATTERN"• DDD• •• light MDD
  • UI DBUser#save(); → DBtoString() ! "<span>...</span>"
  • §2••• 3 • ENTITY (E) • VALUE OBJECT (VO) • SERVICE
  • • •• • Table knows Columns / Column knows Table • Emp knows Dept / Dept knows Emps
  • class Emp { class Dept { String name; String name; Dept dept; List<Emp> members;} } Dept tech = new Dept(" "); Emp kato = new Emp(" "); kato.setDept(tech); tech.addMember(kato);
  • • Declaration & Reference• Repository
  • ENTITY (E)••• vs• (SE) vs ( )
  • • 31 32 31 (File / DB) 32 (On Memory)•• Serialize / Deserialize clone…
  • ENTITY• Table • Order• Column • Customer• ForeignKey• Employee• Department
  • ENTITY••• ID• equals hashCode ID
  • • ENTITY• ID• • •
  • EColumn col = ...; // ← ENTITYtableFoo.addColumn(col);tableBar.addColumn(col);// somethingtableFoo.getColumn(...).setName("AAA");tableBar
  • • ID• (v0.2)•
  • VALUE OBJECT (VO)••• new String("foo") vs new String("foo")• man.getName(): String• equals hashCode property
  • VALUE OBJECT• Integer• BigDecimal• String• Color• Date / TimePoint• Status (OPEN / PROGRESS / CLOSED)
  • VALUE OBJ.••• Immutable • Flyweight
  • SERVICE• E VO• E VO Service • E VO •
  • SERVICE•• (UL)•• →
  • • E / VO• E / VO• E / VO • Transaction Script •
  • • Infrastructure Service ( ) • E-mail •• Application Service • Excel export •• Domain Service ••
  • MODULE••
  • Java package•• 1•
  • MVC• com.example.foobar •com.example.foobar • model • foo • FooModel • FooModel • BarModel • FooView • view UL • FooController • FooView • bar • BarView • BarModel • controller • BarView • FooController • BarController • BarController
  • MVC• com.example.foobar •com.example.foobar • model • foo • FooModel • FooModel • BarModel • FooView • view UL • FooController • FooView • bar • BarView • BarModel • controller • BarView • FooController • BarController • BarController
  • §3 LifeCycle• Object • new GC • INSERT DELETE•
  • §3 LifeCycle
  • E• LifeCycle Object LifeCycle• User• JVM
  • AGGREGATE•• …
  • •• Table• Column Entity• Column Table• ObjColumn → Table
  • FACTORY••• new• Object Object•
  • • Obj.• Object LifeCycle• • Object
  • Obj.• • Obj. • Obj.• Factory Obj.
  • REPOSITORY• • • • • Repository
  • • Entity LifeCycle• LC Entity• new • On Memory Collection • Database
  • Repos. Collection• DB• Repository Collection• store / delete / find (resolve) ...
  • Declaration & ReferenceCREATE TABLE FOOBAR ( FOO INTEGER, BAR VARCHAR(32), Decl. = Entity PRIMARY KEY (FOO), FOREIGN KEY (BAR) Ref. = VO (ID) REFERECE BAZ (QUX)); Table has-a Column(s) and ... PrimaryKey has-a ColumnReference
  • • /• ENTITY / VO / SERVICE• FACTORY / REPOSITRY• DDD