24
Structural Modeling Chapter 7

Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Embed Size (px)

Citation preview

Page 1: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Structural Modeling

Chapter 7

Page 2: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Key Ideas

A structural or conceptual model describes the structure of the data that supports the business processes in an organization..The structure of data used in the system is represented through CRD cards, class diagrams, and object diagrams.

Page 3: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

STRUCTURAL MODELS

Page 4: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Purpose of Structural Models

Reduce the “semantic gap” between the real world and the world of softwareCreate a vocabulary for analysts and usersRepresent things, ideas, and concepts of importance in the application domain

Page 5: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Classes

Templates for creating instances or objects

ConcreteAbstract

Typical examples:Application domain, user interface, data structure, file structure, operating environment, document, and multimedia classes

Page 6: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Attributes

Units of information relevant to the description of the classOnly attributes important to the task should be included

Page 7: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Operations

Action that instances/objects can takeFocus on relevant problem-specific operations (at this point)

Page 8: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Relationships

GeneralizationEnables inheritance of attributes and operations

AggregationRelates parts to wholes

AssociationMiscellaneous relationships between classes

Page 9: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

CLASS-RESPONSIBILITY-COLLABORATION CARDS

Page 10: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Responsibilities and Collaborations

ResponsibilitiesKnowingDoing

CollaborationObjects working together to service a request

Page 11: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

A CRC Card

Front: Class name: ID: Type:

Description:

Responsibilities : Collaborators:

Back:

Attributes:

Relationships:

Generalization (a-kind-of):

Aggregation (has-parts):

Other Associations:

Page 12: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

CLASS DIAGRAMS

Page 13: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Example Class Diagram

Page 14: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Class Diagram Syntax

A CLASS

AN ATTRIBUTE

AN OPERATION

AN ASSOCIATION

Class 1

-attribute

+operation ()

Attribute name/derived attribute name

operation name ()

1..* 0..1______verb phrase____

Page 15: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

More on Attributes

Derived attributes/age, for example can be calculated from birth date and current date

VisibilityPublicProtectedPrivate

Page 16: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

More on Operations

ConstructorCreates object

QueryMakes information about state available

UpdateChanges values of some or all attributes

Page 17: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

More on Relationships

Class can be related to itself (role)Multiplicity

Exactly one, zero or more, one or more, zero or one, specified range, multiple disjoint ranges

Association class

Page 18: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Simplifying Class Diagrams

The view mechanism shows a subset of informationPackages show aggregations of classes (or any elements in UML)

Page 19: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Object Diagrams

Page 20: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

CREATING CRC CARDS AND CLASS DIAGRAMS

Page 21: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Object Identification

Textual analysis of use-case information

Nouns suggest classesVerbs suggest operations

Creates a rough first cutCommon object listIncidentsRoles

Page 22: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Patterns

Useful groupings of classes that recur in various situationsTransactions

Transaction classTransaction line item classItem classLocation classParticipant class

Page 23: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Steps for Object Identification and Structural Modeling

1. Create CRC cards by performing textual analysis on the use-cases.

2. Brainstorm additional candidate classes, attributes, operations, and relationships by using the common object list approach.

3. Role-play each use-case using the CRC cards.

4. Create the class diagram based on the CRC cards.

5. Review the structural model for missing and/or unnecessary classes, attributes, operations, and relationships.

6. Incorporate useful patterns.

7. Review the structural model.

Page 24: Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in

Summary

CRC cards capture the essential elements of a class.Class and object diagrams show the underlying structure of an object-oriented system.Constructing the structural model is an iterative process involving: textual analysis, brainstorming objects, role playing, creating the diagrams, and incorporating useful patterns.