System Development Techniques Individual Assignment

profileTubekbay001
Lesson14.pdf

System Development Techniques

Diploma in Information Technology

Lesson 14

Learning outcomes After studying this chapter and the recommended reading, you should be able to:

• Explain the design with communication diagrams

• Design object-oriented and use case realisation

Object-Oriented Design with Interaction Diagrams

• Use case realization – the process of extending detailed design – each use case is taken individually to determine all the

classes that collaborate on it. – any other utility or support classes are identified.

• E.g. UI, Controller and database – As the details of the classes are designed—use case by use

case—the design class diagram is also updated as necessary.

Object-Oriented Design with Interaction Diagrams

• Interaction diagrams – heart of object- oriented design. – realization of a use case

• determining what objects collaborate and • the messages they send to each other to carry out the use case

(interaction diagram)

– Two types • communication diagrams and sequence diagrams.

Object-Oriented Design with Interaction Diagrams

• Communication diagrams – a little less detailed – provide a broad “overview” picture of the interactions. – works best for use cases that are not too large with many

messages. – provides a snapshot view of the classes and messages. – Disadvantage: not much space allowed for messages, can

easily become cluttered with overlapping information.

• Sequence diagrams – more detailed and allow the designer to visually document

the process flow of the messages

Use Case Realization with Communication Diagrams

• Communication diagram – consists of actors, objects, links, and messages.

Use Case Realization with Communication Diagrams

• Actor – represents an external role of the person or thing

that initiates the use case by sending the initial message and any other messages to the system.

– Messages: • come into the system through data that is entered on

forms. • come electronically by other external devices or

systems.

Use Case Realization with Communication Diagrams

• Object – instantiated class objects that perform actions to

help carry out the use case. – can both receive messages and send messages. – object notation: a colon and underlining

Use Case Realization with Communication Diagrams

• Link – connectors that illustrate the flow of the

messages. – show where the messages flow. • Messages can flow in either direction on a link.

Use Case Realization with Communication Diagrams

• Message – Send from an object or actor to an object or actor. – is a request for service. – can return data from a previous message. – invoke a service in an object. – In programming terms, a message is the same as a

procedure call or a method call.

Use Case Realization with Communication Diagrams

• Message syntax – [true/false condition] sequence-number:

return-value: = message-name (parameter-list)

Use Case Realization with Communication Diagrams

• Message syntax – True/false condition. • condition that is tested for true or false. • if it is true, then the message is sent; • if false, the message is not sent. • only applies to sending the message. • optional.

Use Case Realization with Communication Diagrams

• Message syntax – Sequence number. • used to identify the order of the messages. • use hierarchical dot notation (i.e., 1.0, 1.2, 2.1.3, etc.) • if a use case has two separate input messages, each

with several subsequent messages that travel the same links, they could be uniquely partitioned by using 1.0 and 2.0 series.

Use Case Realization with Communication Diagrams

• Message syntax – Return-value • value that the message returns after the completion of

the service requested in the forward part of the message. • In programming terms, this is similar to a method

return value. • Return values can be returned either with this format

(i.e., as part of the message) or as a separate return message.

Use Case Realization with Communication Diagrams

• Message syntax – Message-name • usually uses camel case with the initial letter lowercase. • name the message by describing the service that is

requested from the destination object. • For example, createAccount could be a message name

that requests the specific service from the destination object. • if a return-value is given, the name and return value are

separated by “:=”.

Use Case Realization with Communication Diagrams

• Message syntax – Parameter-list. • contains items that are being passed to the destination

object via the message. • in programming terms, these are the arguments.

Use Case Realization with Communication Diagrams

• The following diagram shows a prelim communication diagram for the Create customer account use case.

Use Case Realization with Communication Diagrams

• Create customer account use case. – asterisk between the number and the name

indicates that the message may be sent multiple times.

– a multiply occurring message.

Use Case Realization with Communication Diagrams

• Next enhance the first cut Design Class diagram using communication diagram to produce the final design class diagram for the use case. – first-cut design class diagram gives a preliminary idea of

what domain classes will be involved and the logical navigation visibility relationships.

– helpful to have either an activity diagram or a system sequence diagram and a detailed use case description for the final design class diagram.

Use Case Realization with Communication Diagrams

Use Case Realization with Communication Diagrams

First-cut design class diagram for Create customer account

Use Case Realization with Communication Diagrams

System sequence diagram for Create customer account

Use Case Realization with Communication Diagrams

• Extend Input Messages – For each input message, extend the message to the

internal objects within the :System object. Follow this process:

• Step 1: – From the first-cut design class diagram, identify the classes

that will be required to carry out the execution of the message. • Place the corresponding objects on the diagram.

– Example: The required classes for this message are CustomerHandler and Customer.

Use Case Realization with Communication Diagrams

• Step 2: – Beginning with the input message, identify each message

that will be required for each of the included objects on the diagram.

– For each message, ensure that the origin object has navigation visibility to the destination object.

– Determine which object should have primary responsibility for completing the required service.

– Place appropriate messages based on navigation and responsibility.

Use Case Realization with Communication Diagrams

• Step 2: • Example: – The required message is createNewCustomer and comes

from the Clerk to the :CustomerHandler. – The :CustomerHandler then forwards that same message

to the :Customer object. – The :Customer object is the appropriate object to carry out

this service. – The constructor method in the Customer class instantiates

a new :Customer object. – This is shown in the diagram with a message directly to the

:Customer object.

Use Case Realization with Communication Diagrams

• Step 3 – Name each message to reflect the service requested from

the destination object. – Identify and include the parameters that the destination

object will require to carry out the requested service. – Identify and name any return messages or return values

that need to be returned to origin objects.

Use Case Realization with Communication Diagrams

• Step 3 – Example – The name of the message is appropriate as given in the

SSD. – The parameters on the SSD, however, do not reflect the

attributes of the Customer class. – The accountNo and status attributes are both determined

by the constructor. – The other attributes—name, mobilePhone, homePhone,

and emailAddress—need to be passed in as arguments. – The input parameter list will be modified to reflect these

changes.

Use Case Realization with Communication Diagrams

Use Case Realization with Communication Diagrams

Use Case Realization with Communication Diagrams

Use Case Realization with Communication Diagrams

Final communication diagram for Create customer account use case

Use Case Realization with Communication Diagrams

• The final communication diagram for this use case is show in the previous slide.

• All the return messages are included in this final diagram.

• The diagram contains only problem domain objects and does not include view layer or data access layer.

• Identify the messages in the communication diagram and add those messages as methods in each class.

Use Case Realization with Communication Diagrams

Design class diagram for methods added from Create customer account

Summary

• Use case realization is the process of extending detailed design

• Interaction diagrams – is the heart of object- oriented design. – realization of a use case

• determining what objects collaborate and • the messages they send to each other to carry out the use case

(interaction diagram)

– Two types • communication diagrams and sequence diagrams.

Summary

• Communication diagrams – a little less detailed – provide a broad “overview” picture of the interactions. – works best for use cases that are not too large with many

messages. – provides a snapshot view of the classes and messages. – Disadvantage: not much space allowed for messages, can

easily become cluttered with overlapping information

– consists of actors, objects, links, and messages.

Read

Textbook:

• Satzinger, Robert & Stephen Chapter 13