OOAD Workshop 11Complete the Analysis Class Model ~ Entity Classes

Student Originated SoftwareFall 2005

OO Analysis & Design (OOAD) Workshop Exercise 11

Complete the Design Class Model ~ Entity Classes

Due ….

Determine the operations in the classes, along with the signature for those operations. The result of this activity is the system's Analysis Class Model -- i.e., the artifact from which '1st-cut' system code can be produced for a variety of implementation languages. Selecting an implementation language usually precedes this activity.

Major Goals

  • Consider the various classes in the domain model, in the context of the language chosen for development.
  • To complete the Analysis Class Model, allocating and refining messages from the Sequence Diagram into operations of appropriate classes.
  • To add necessary detail to the attributes of the classes in the Analysis Class Model.
  • To produce the initial class definition code for the system's entity classes in a target language (in our case, Java).

Overview

In our development process, the Analysis Class Model represents the major work product. In this exercise, we will focus *only* on completing the Analysis Class Model for the entity objects of the Sequence Diagrams. Having completed your analysis of the collaborations, you should have identified all of the domain entities and about 90 percent of the entity attributes as the Domain Model.

In this exercise, you will transform the Domain Model entities into entity classes of the Analysis Class Model, with the operations supplied from the Sequence Diagrams.

Inputs:

  • Sequence Diagrams: EU-Bid
  • Domain Model: EU-Bid
/

Outputs:

  • Analysis Class Model: EU-Bid Entity Classes
  • Java code: EU-Bid Entity Classes ('1st-cut' )

Steps

1.Begin the Analysis Class Model from the Domain Model.
2.Select the target language, and re-consider the domain classes, in the context of the target language. Are there any classes that appear ‘naturally’, or any that disappear?
3.Reflect needed associations as operations and variables.
4.Define operations of classes.
5.Convert associations on the Domain Model to the appropriate classes, operation(s) and attribute(s). For details on this, see ('IS-A' and other relationship types)
6.Create appropriate collections (or classes) for any class-scoped variables.
7.Refine the property details.
8.Review and refine the navigability of associations.
9.Produce the 1st-cut code.

Details

1.Begin the Analysis Class Model from the Domain Model.

Apply the following transforms to the constructs of the Domain Model to produce a Class Model. For each entity on the Domain Model, draw a class box on the class model diagram.

1. In the first compartment of the class box, write the entity class name. Remove any 'white space' characters and write the name in 'TitleCase,' beginning with an upper-case letter.

2. In the second compartment, list the attribute names. Remove any 'white space' characters and write the attribute name in 'TitleCase,' beginning with a lower-case letter.

2.Select the target language, and re-consider the domain classes, in the context of the target language.
Are there any classes that appear ‘naturally’, or any that disappear? An example might be a very simple aggregated class in an OOP implementation.
3.Reflect associations asoperations and named variables.

In the second compartment for an entity class, add entries for the names of classes associated with this class. Use the rolename (if there is one) or (if no rolename) the name of the associated class. Remove any 'white space' characters and write the name in 'TitleCase,' beginning with the prefix 'my'. In the third compartment for an entity class, add corresponding entries for operations that will “get” those values. Note: if the association multiplicity is 'many' suffix the name with 's' (to indicate that it is a collection-valued variable). You might want to defer whether or not such associations are implemented as variables until implementation.

4.Define operations of classes.

Each message to an object on the Sequence Diagram becomes an operation of the class of that object. {Note: If you are using a tool, such as Rose, this step can be done automatically.)

1.In the third compartment of the class box, write the operation name suffixed with '( )'.

2.If the operation uses arguments, list each and assign its type.

3.If the operation returns a value, specify this.

4.In the documentation for the class, write a brief description of the operation.

5.Convert associations to the appropriate classes, operation(s) and variable(s).

For transforming the supertype/subtype relationship types in an OOP, use the appropriate class hierarchy constructs.

For transforming the aggregation association types in Java, see UMLtoJavaMapping.pdf.

6.Create appropriate collections (or classes) for any class-scoped variables.

For example, if you have on a sequence diagram, in the column for Class X an operation like “findAllXs”, you may want to create a class that will provide this (and other functionality) for the collection of all instances of that class. Sometimes such behavior can be placed in a CTL class. This is a design call, but one that you will want to make relatively early in a design/implementation iteration.

7.Refine the property details.

For each property (attribute and association) in the class model:

a) Define its visibility (typically "private").

b) Define its type.

c) State its initial value (if any).

d) Specify its containment property -- typically, 'by value' rather than 'by reference.'

e) Is it static? final? derived? (defaults are "no")

8.Review and refine the navigability of associations.

For each use case, you might now wish to review whether you have provided all and only the appropriate navigation among classes.

9. Produce the 1st-cut code.

Note: If you are using a tool, such as Rose or ArgoUML, this step can be done automatically. If you are not using a tool such as Rose or Argo UML, then skip this step.

OOAD Exer11.doc1 of 2rev. [1a] 10/14/2018

prepared for TESC/SOS-Fallcontains material ©ARCorp. used with permissions.