uml detailed class design

12
DETAILED CLASS DESIGN Dr. Hoang Huu Hanh, OST – Hue University hanh-at-hueuni.edu.vn

Upload: thanhluantink30c

Post on 16-Nov-2014

129 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: UML Detailed Class Design

DETAILED CLASS DESIGNDr. Hoang Huu Hanh, OST – Hue Universityhanh-at-hueuni.edu.vn

Page 2: UML Detailed Class Design

2

ObjectivesTo describe the determining of

class’s operations.To describe a template for class

interface specifications

Page 3: UML Detailed Class Design

3

Designing Class OperationsIt is usually easy to determine class’s

operations from the dynamic models of the systems, in particular, from the interaction diagrams.

When two objects interact, one object provides an operation that is used by the other object.

It is also necessary to consider whether an operation has any input and/or output parameters.

Page 4: UML Detailed Class Design

4

Example of Entity ClassAnalysis model:

collaboration diagram

Design model: collaboration diagram

Page 5: UML Detailed Class Design

5

Example of Output Device Interface Class

Needs an initialize operation to initialize the device and any internal variables used by the class.

Page 6: UML Detailed Class Design

6

Example ofState Dependant Control Class

Support two generic operations◦processEvent◦currentState

Page 7: UML Detailed Class Design

7

Example of Business Logic Class

Page 8: UML Detailed Class Design

8

Further Categorization of Entity ClassesDuring design, a decision has to

be made whether the data encapsulated by an entity class is to be managed directly by the entity class or whether the data is actually to be stored in a database.

◦Data abstraction classes (transient)

◦Database wrapper classes (persistent)

Page 9: UML Detailed Class Design

9

Examples of Data Abstraction Class

Page 10: UML Detailed Class Design

10

Example of Database Wrapper Class

Relation in relational database:◦ DebitCard (cardID, PIN, startDate, expirationDate,

status, limit, total, customerID)◦ (underline = primary key, italic = foreign key)

Page 11: UML Detailed Class Design

11

Class Interface Specifications Class type (class structuring criterion) Assumptions Anticipated changes Superclass (if applicable) Inherited operations (if applicable) Operations provided by the class. For each operation,

define,◦ Function performed◦ Precondition◦ Postcondition◦ Invariant◦ Input parameters◦ Output parameters◦ Operations used from other classes

Page 12: UML Detailed Class Design

12

Thank you!