DETAILED CLASS hanh-at-hueuni.edu.vn DESIGN

Dr. Hoang Huu Hanh, OST – Hue University

 

Hue University

e University

Objectives
To

describe the determining of class’s operations. To describe a template for class interface specifications

e University
2

Designing Class Operations
It

is usually easy to determine class’s operations from the dynamic models of the systems, in particular, from the interaction diagrams. two objects interact, one object provides an operation that is used by the other object. is also necessary to consider


When

e University  It

3

Example of Entity Class
 Analysis

model: collaboration diagram

 Design

model: collaboration diagram

e University
4

Example of Output Device Interface Class
       
 Needs

e University 

an initialize operation to initialize5

Example of State Dependant Control Class
      

Support

two generic operations
6

e University

◦ processEvent ◦ currentState

Example of Business Logic Class

e University
7

Further Categorization of Entity Classes
During

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 8

e University

Examples of Data Abstraction Class

e University
9

Example of Database Wrapper Class
       

e University

10

Class Interface Specifications
     

e University

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
11

Thank you!

e University
12

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.