1 object-oriented technology from diagram to code with visual paradigm for uml curtis h.k. tsang,...

12
1 Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung McGraw-Hill Education (Asia), 2005 Dr. Hussein Al-Zoubi

Upload: stacey-lands

Post on 14-Dec-2015

219 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 1 Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung McGraw-Hill Education

1

Object-Oriented TechnologyFrom Diagram to Code with Visual Paradigm for UML

Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung

McGraw-Hill Education (Asia), 2005

Dr. Hussein Al-Zoubi

Page 2: 1 Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung McGraw-Hill Education

Tricks and Tips

• Creating Cohesive and Self-sufficient Subsystems– Subsystems may be considered as the next level of abstraction

down from the entire system. – Ideally, a subsystem should be a cohesive and independent part

of the complex system, so as to bring out the benefits of portability, reusability and maintainability.

– A cohesive and independent subsystem is loosely coupled with other subsystems, and data coupling is the most loosely-coupled communication method between entities.

• Refining Class Diagrams Using MVC-level Scenario Analysis

Page 3: 1 Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung McGraw-Hill Education

Tricks and Tips (cont’d)

Page 4: 1 Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung McGraw-Hill Education

Tricks and Tips (cont’d)

Page 5: 1 Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung McGraw-Hill Education

Tricks and Tips (cont’d)

Page 6: 1 Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung McGraw-Hill Education

Tricks and Tips (cont’d)

• Understanding System Reusability for Different Types of Objects

Type of Object Application Scope Reusability

Object library General purpose Any application

Entity Class Domain Specific Within the domain

Control Class Application Specific Within the application

Boundary Class Application Specific Within the application

Page 7: 1 Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung McGraw-Hill Education

Tricks and Tips (cont’d)

• Do Not Create Giant Control Objects• Because control objects are application

specific, if they are given too much intelligence or logic, they will not be reusable for other applications.

• Responsibilities to be assigned to a control object:– the control sequence of messages in the scenario;– information about the sessions in relation to the use

case scenario, e.g. session ID, session status, etc.;– control logic of the run-time session, e.g. transaction

management, error recovery, etc.

Page 8: 1 Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung McGraw-Hill Education

Tricks and Tips (cont’d)

{{

Use Case Description

Flow of Event1.2.3.......N

Actor Input System Response1. Actor input 1

2. System response13. Actor input 2

4. System response2

....... ................

Checking Consistency between Use Case and Sequence Diagrams

Page 9: 1 Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung McGraw-Hill Education

Tricks and Tips (cont’d)

• Identifying Objects and Operations through Scenario Analysis– Boundary and control objects can be

identified by walking through the flow of events of a use case scenario

– Each entry of the flow of events involves three steps:• The actor inputs some information into the system• The system performs some actions• The system responds to the actor’s input

Page 10: 1 Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung McGraw-Hill Education

Tricks and Tips (cont’d)• The following guidelines can help quickly

identify the boundary and entity objects in the use case scenario:– Identify boundary objects by asking questions

such as: “what input device(s) would be required for the actor(s) to enter the information?”, “what output device(s) would be required for the system to give a response to the actors?”

– Identify entity objects by asking questions such as: “ what information is required to respond to the actors input?”

Page 11: 1 Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung McGraw-Hill Education

View Alignment between Sequence Diagram and State Diagram

Page 12: 1 Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung McGraw-Hill Education

Developing Statechart Diagrams for Control Objects

Statechart diagram of the Card Controller