Upload
stacey-lands
View
219
Download
2
Embed Size (px)
Citation preview
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
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
Tricks and Tips (cont’d)
Tricks and Tips (cont’d)
Tricks and Tips (cont’d)
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
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.
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
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
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?”
View Alignment between Sequence Diagram and State Diagram
Developing Statechart Diagrams for Control Objects
Statechart diagram of the Card Controller