uml detailed class design
TRANSCRIPT
DETAILED CLASS DESIGNDr. Hoang Huu Hanh, OST – Hue Universityhanh-at-hueuni.edu.vn
2
ObjectivesTo describe the determining of
class’s operations.To describe a template for class
interface specifications
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.
4
Example of Entity ClassAnalysis model:
collaboration diagram
Design model: collaboration diagram
5
Example of Output Device Interface Class
Needs an initialize operation to initialize the device and any internal variables used by the class.
6
Example ofState Dependant Control Class
Support two generic operations◦processEvent◦currentState
7
Example of Business Logic Class
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)
9
Examples of Data Abstraction Class
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)
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
12
Thank you!