120 likes | 359 Views
Domain-Driven Design. Chapters 10-13 Refactoring Towards Deeper Insight. Patterns. Intention-revealing Interfaces Side-effect Free Functions Assertions Conceptual Contours Standalone Classes Closure of Operations Strategy, Composite. Assertions in Java.
E N D
Domain-Driven Design Chapters 10-13 Refactoring Towards Deeper Insight CS527 - lecture 15
Patterns • Intention-revealing Interfaces • Side-effect Free Functions • Assertions • Conceptual Contours • Standalone Classes • Closure of Operations • Strategy, Composite CS527 - lecture 15
Assertions in Java • New Java statement in version 1.4 • assert exp1; • assert exp1: exp2; • If exp1 is false, throw an exception and give it exp2 as an argument • http://java.sun.com/j2se/1.4/docs/guide/lang/assert.html CS527 - lecture 15
Conceptual contours • Choose a design that does not have to change when you add new features. • If new features don’t fit into your design, it proves the design was deficient, so go ahead and rewrite it. CS527 - lecture 15
Principles • Model must be readable. • Focus on what model looks like, not on what implementation of model looks like. • Each piece should be simple. • Declarative style CS527 - lecture 15
Analysis Patterns • Arlow, J & Neustadt, I. (2004) Enterprise Patterns and MDA: Building Better Software With Archetype Patterns and UML, Addison-Wesley. • Fowler, M. (1997). Analysis Patterns, Addison-Wesley. • Hay, D. C. (1996). Data Model Patterns - Conventions of Thought. Dorset House Publishing. • Hay, D.C. (2006) Data Model Patterns – A Metadata Map. Morgan Kaufmann. • Silverston, Len & W.H. Inmon & Kent Graziano (1997) The Data Model Resource Book: A Library of Logical Data Models and Data Warehouse Designs, John Wiley and Sons. • Silverston, Len (2001) The Data Model Resource Book Volume 2: A Library of Universal Data Models by Industry Type, John Wiley and Sons CS527 - lecture 15
Action Action time * Party * Location CS527 - lecture 15
Proposed and Implemented Actions Action Proposed Action Implemented Action CS527 - lecture 15
Completed, Abandoned, Suspended Actions Status * Action Completed Abandoned Suspended Time Period * CS527 - lecture 15
Plan dependent Proposed Action * * consequences Plan CS527 - lecture 15
Resource Allocation Action Resource Type Proposed Action Implemented Action Resource Allocation quantity books uses * * CS527 - lecture 15
Declarative Style Employee rate earned PayCheck * TimeCard * TimeCardItem time Invoice Customer charged billed paid owed * Payment charged = timeCardItem.time * timeCardItem.timeCard.employee.rate * 3 CS527 - lecture 15