CS616 Software Engineering II

Lecture 10

Larman Part5 Elaboration: Iteration 3

Chapter 27 Refining the Domain Model


Association Classes

An association class may be useful in the Domain Model if:

       An attribute is related to an association

       Instances of the association class have a life-time dependency on the association

       There is a many-to-many association between two concepts, and information associated with the association itself.


UML signifies an association using a dashed line:

ServiceContract and its attributes are related to the association between a Store and an AuthorizationService, and lifetime of service contract depends on the relationship


Aggregation and Composition

       Aggregation is a kind of an association used to model whole-part

relationships between things

       The whole is called the composite


       UML shows aggregation with a hollow or filled diamond at the composite end of the relationship:


Composite Aggregation Filled Diamond

       Composite aggregation (composition) means that the part only belongs to one composite object

       e.g. hand is composition relationship to a finger

       UML: filled diamond composite solely owns the part:

       If multiplicity end is exactly one, the part may not exist separate from composite.

       If multiplicity end is 0 .. 1, the part may exist separate from composite.


Shared Aggregation Hollow Diamond

       Shared aggregation means that the multiplicity at the composite end may be more than 1.

       The part may be in many composite instances


Show aggregation when:

       The lifetime of the part is bound within the lifetime of the composite

       There is a logical whole-part physical or logical assembly

       Some properties of the composite propagate to the parts

       Operations applied to the composite propagate to the parts


Aggregation in POS Domain Model

       SalesLineItems are part of a composite Sale

       ProductCatalog is an aggregate of ProductSpecifications



Time Intervals


Association Role Names

       Each end of an association is a role with properties




Qualified Associations

       A qualifier may be used in an association

       It distinguishes the set of objects at the far end of the association based on a qualifier value

       An association with a qualifier is a qualified association.

       e.g. ProductSpecifications may be distinguished in a ProductCatalog by their itemID

Reflexive Associations

Concept may have association to itself reflexive association

Ordered elements

Using Packages to Organize the Domain Model




How to Partition a Domain Model into Packages

Place elements together that:

POS Domain Model


Core/Misc Package




Chapter 28 Adding new SSDs and Contracts

Additional SSDs and contracts for current iteration

Chapter 29 Modeling Behavior in Statechart Diagrams

UML includes statechart diagrams to illustrate the events and states of things

Events, States, and Transitions

Statechart Diagrams

       UML notation:

       Include initial pseudo-state


       Statechart diagram shows lifecycle of an object

       Statechart diagram applied to classes, use cases

Use Case Statechart Diagram


Classes that Benefit from Statechart diagrams

State-independent and state-dependent objects


Common state-dependent Classes