44
Lab Manual Object Oriented Analysis And Design TE(Computer) VI semester

Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

  • Upload
    vodien

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Lab Manual

Object Oriented Analysis And DesignTE(Computer)

VI semester

Page 2: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Index

Sr. No. Title of Programming Assignment Page No.

1 Study of Use Case Diagram  3

2 Study of Activity Diagram  9

3 Study of Class Diagram 13

4 Study o package diagram 19

5 Study of Sequence Diagram 22

6 Study of Collaboration Diagram 25

7 Study of State chart Diagram 28

8 Study of Component Diagram 33

9 Study of Deployment Diagram 36

10 Study Use Case Realization 42

2

Page 3: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

                                                                                                                     

Study of Use Case Diagram

3

1

Page 4: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

1. OBJECTIVE

Study the Benefits if use case modeling

Learn use case diagram: Discovering actors and discovering use cases.

Practice use cases diagrams using Rational Rose. 

2. REFERENCES

www.developer.com The Unified Modeling Language User Guide by Grady Booch  Mastering UML with Rational Rose by Wendy Boggs  Fundamentals of Rational Rose Student Manual version 2002.05.00

3. PRE­REQUISITE:       Knowledge of Requirements Document

4. THEORY

4.1   Use Case Diagram

The Use case diagram is used to identify the primary elements and processes that form the system. The primary elements are termed as "actors" and the processes are called "use cases." The Use case diagram shows which actors interact with each use case

A use case diagram captures the functional aspects of a system. More specifically, it cap­tures the business processes carried out in the system. As you discuss the functionality 

4

Page 5: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

and processes of the system, you discover significant characteristics of the system that you model in the use case diagram. Due to the simplicity of use case diagrams, and more importantly, because they are short of all technical jargon, use case diagrams are a great storyboard tool for user meetings. Use case diagrams have another important use. Use case diagrams define the requirements of the system being modeled and hence are used to write test scripts for the modeled system.

So who should normally be involved in the creation of use cases? Normally,  domain experts and business analysts should be involved in writing use cases for a given system. Use cases are created when the requirements of a system need to be captured. Because, at this point no design or development activities are involved, technical experts should not be a part of the team responsible for creating use cases. Their expertise comes in use later in the software life cycle.

4.2   Elements Of A Use Case Diagram

Actors

Are NOT part of the system – they represent anyone or anything that must Interact with the system. Only input information to the system. Only receive information from the system. Both input to and receive information from the system. Represented in UML as a stickman

                                                   

Use Case

A sequence of transactions performed by a system that yields a            measurable result of values for a particular actor

A use case typically represents a major piece of functionality            that is complete from beginning to end. A use case must            deliver something of value to an actor.

5

Page 6: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

                                            

Use Case Relationships

Between actor and use case. Association / Communication. Arrow can be in either or both directions; arrow indicates who initiates communi­

cation.

(a)    Between use cases (generalization):

Uses   

• Where multiple use cases share pieces of same functionality.

Extends             

• Optional behavior.• Behavior only runs under certain conditions (such as alarm).• Several different flows run based on the user’s selection.

6

Page 7: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

4.3   USE CASE SPECIFICATIONS

 Name Name of use case

Identifier A unique identifier for this use case, e.g. UC10

Description A couple of sentences or a paragraph describing the basic idea of  the use case

Goal  The business goal of the initiating actor

Actors List of actors that participate in the use case

Included Use Cases

Optional, List of use cases that this use case includes

Extended Use Case

Optional, The use case, if any, that this use case extends

Preconditions List the state(s) the system can be in before this use case starts

Post conditions List the state(s) the system can be in when this use case ends

Assumptions Optional, List all assumptions that have been made

Frequency Approximately how often this use case is realized, e.g., once a  week, 500 times a day, etc

Flow Of Event Basic  Flow

the “normal” processing path, aka, the Happy Path

Alternative  Flow

Description of the alternate course Condition

5 EXERCISES

1. Take all use cases from experiments no.2 and draw activity diagram for that using Rational rose.

6 SAMPLE OUTPUTUse case diagram of the given problem

7

Page 8: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

7 DELIVERABLE Student should submit the solutions for the previous exercises.

Student should draw use case diagrams for given project using Rational Rose. Student should create Use case specifications. 

8

Page 9: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Study of Activity Diagram

9

2

Page 10: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

1. OBJECTIVE Deeper understanding of UML activity diagrams. Practicing activity diagrams using Rational Rose.

In this lab, we will cover the dynamic diagram—the Activity diagram. By the end of this article, you will know what an Activity diagram is, what its elements are, and you will be able to create Activity diagrams for your system.

2. REFERENCES 

www.developer.com The Unified Modeling Language User Guide by Grady Booch  Mastering UML with Rational Rose by Wendy Boggs  Fundamentals of Rational Rose Student Manual version 2002.05.00

3. PRE­REQUISITE

      Use Case Diagram

4. THEORY

The easiest way to visualize an Activity diagram is to think of a flowchart of a code. The flowchart is used to depict the business logic flow and the events that cause decisions and actions in the code to take place.

Activity diagrams represent the business and operational workflows of a system. An Ac­tivity diagram is a dynamic diagram that shows the activity and the event that causes the object to be in the particular state.

10

Page 11: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Elements of an Activity diagramAn Activity diagram consists of the following behavioral elements:

Element and its description Symbol

Initial Activity: This shows the starting point or first activity of the flow. Denoted by a solid circle. This is similar to the notation used for Initial State.

Activity: Represented by a rectangle with rounded (almost oval) edges.

Decisions: Similar to flowcharts, a logic where a decision is to be made is depicted by a diamond, with the options written on either sides of the arrows emerging from the diamond, within box brackets.

Signal: When an activity sends or receives a message, that activity is called a signal. Signals are of two types: Input signal (Message receiving activity) shown by a concave polygon and Output signal (Message sending activity) shown by a convex polygon.

Concurrent Activities: Some activities occur simultaneously or in parallel. Such activities are called concurrent activities. For example, listening to the lecturer and looking at the blackboard is a parallel activity. This is represented by a horizontal split (thick dark line) and the two concurrent activities next to each other, and the horizontal line again to show the end of the parallel activity.

Final Activity: The end of the Activity diagram is shown by a bull's eye symbol, also called as a final activity.

5. EXERCISES

1. Take all use cases from experiments no.2 and draw activity diagram for that using Rational rose.

11

Page 12: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

6. SAMPLE OUTPUTUse case diagram of the given problem

7. DELIVERABLES

Student should submit the solutions for the previous exercises.Activity diagrams for all use cases

12

Page 13: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Study of Class Diagram

13

3

Page 14: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

1. OBJECTIVE

In this lab, we will see what class diagrams are, what the elements of a class diagram are, what each of these elements signify, and how to identify them.After this lab students will be able to define classes for a system and read and create class diagrams.

2.  REFERENCES 

www.developer.com The Unified Modeling Language User Guide by Grady Booch  Mastering UML with Rational Rose by Wendy Boggs  Fundamentals of Rational Rose Student Manual version 2002.05.00

3.   PRE­REQUISITE      Use Case Diagram

4 THEORYA class diagram consists of a group of classes and interfaces reflecting important entities of the business domain of the system being modeled, and the relationships between these classes and interfaces. The classes and interfaces in the diagram represent the members of a family tree and the relationships between the classes are analogous to relationships be­tween members in a family tree. Interestingly, classes in a class diagram are interconnect­ed in a hierarchical fashion, like a set of parent classes and related child classes under the parent classes.

A class diagram is a diagram showing a collection of classes and interfaces, along with  the collaborations and relationships among classes and interfaces.

A class diagram is a pictorial representation of the detailed system design. Design experts who understand the rules of modeling and designing systems design the system's class di­agrams. A thing to remember is that a class diagram is a static view of a system. The 

14

Page 15: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

structure of a system is represented using class diagrams. Class diagrams are referenced time and again by the developers while implementing the system.

4.1 Classes Categories

Classes are divided into three categories

• EntityModels information and associated behavior that is long­lived, independentof the surrounding, application independent, and accomplishes some responsibility

• BoundaryHandles the communication between the system surroundings and theinside of the system, provides interface, and facilitates communication with othersystems

• ControlModel sequencing behavior specific to one or more use cases. Controlclasses coordinate the events needed to realize the behavior specified in the usecase, and they are responsible for the flow of events in the use case.

4.2 Elements of a Class Diagram

Class: A class represents an entity of a given system that provides an encapsulated imple­mentation of certain functionality of a given entity. These are exposed by the class to oth­er classes as methods. Apart from business functionality, a class also has properties that reflect unique features of a class. The properties of a class are called attributes.

A class is represented by a rectangle. The following diagram shows a typical class in a class diagram:

15

Page 16: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Relationships Between Classesrelationships between classes, their notation, and what they mean.

Sr. No.

Relation Symbol Description

1 Association When two classes are connected to each other in any way, an association relation is established. For example: A "student studies in a college" association can be shown as:

1 a. Multiplicity An example of this kind of association is many students belonging to the same college. Hence, the relation shows a star sign near the student class (one to many, many to many, and so forth kind of relations).

1 b. Directed Association Association between classes is bi-directional by default. You can define the flow of the association by using a directed association. The arrowhead identifies the container-contained relationship.

1 c. Reflexive Association No separate symbol. However, the relation will point back at the same class.

An example of this kind of relation is when a class has a variety of responsibilities. For example, an employee of a college can be a professor, a housekeeper, or an administrative assistant.

2 Aggregation When a class is formed as a collection of other classes, it is called an aggregation relationship

16

Page 17: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

between these classes. It is also called a "has a" relationship.

2 a. Composition Composition is a variation of the aggregation relationship. Composition connotes that a strong life cycle is associated between the classes.

3 Inheritance/Generalization Also called an "is a" relationship, because the child classis a type of the parent class. Generalization is the basic type of relationship used to define reusable elements in the class diagram. Literally, the child classes "inherit" the common functionality defined in the parent class.

4 Realization In a realization relationship, one entity (normally an interface) defines a set of functionalities as a contract and the other entity (normally a class) "realizes" the contract by implementing the functionality defined in the contract.

4.3 A Few TermsHere are a few terms that we will be using to annotate our class diagrams. You should be familiar with them:

Responsibility of a class: It is the statement defining what the class is expected to pro-vide.

Stereotypes: It is an extension of the existing UML elements; it allows you to define new elements modeled on the existing UML elements. Only one stereotype per element in a system is allowed.

17

Page 18: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Vocabulary: The scope of a system is defined as its vocabulary.

Analysis class: It is a kind of a stereotype.

Boundary class: This is the first type of an analysis class. In a system consisting of a boundary class, the users interact with the system through the boundary classes.

Control class: This is the second type of an analysis class. A control class typically does not perform any business functions, but only redirects to the appropriate business func-tion class depending on the function requested by the boundary class or the user.

Entity class: This is the third type of an analysis class. An entity class consists of all the business logic and interactions with databases.

5. EXERCISEDraw a class diagram of  the problem given in lab 1 

6. SAMPLE OUTPUTClass diagram of a given system

7. DELIVERABLES• Student should submit the solutions for the previous exercises.• Also student should use these class elicitation techniques to identify the classesfor project.

18

Page 19: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Study of Package Diagram

19

4

Page 20: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

1. OBJECTIVE

In this lab, we will see what package diagram is, what the elements of a package diagram are, what each of these elements signify.After this lab students will be able to create package diagram.

2. REFERENCES 

www.developer.com The Unified Modeling Language User Guide by Grady Booch  Mastering UML with Rational Rose by Wendy Boggs  Fundamentals of Rational Rose Student Manual version 2002.05.00

3. PRE­REQUISITEClass Diagram

      Use Case Diagram

4. THEORY

Package diagrams are used to reflect the organization of packages and their elements. When used to represent class elements, package diagrams provide a visualization of the namespaces. The most common use for package diagrams is to organize use case dia­grams and class diagrams, although the use of package diagrams is not limited to these UML elements.

4.1  Elements of an Package diagram  

Package Packages are general­purpose grouping mechanisms. A package is purely conceptual. A package provides the ability to group together classes, interfaces, components, nodes, collaborations, use cases and even other packages which are either similar in nature or re­

20

Page 21: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

lated. Grouping these design elements in a package element provides better readability of class diagrams, especially complex class diagrams.Packages have a name that uniquely identifies the package. A package is represented as a tabbed folder, usually including only its name and, sometimes, its contents 

Relationship

5. EXERCISEDraw a package diagram of the problem given in lab 1 

6. SAMPLE OUTPUTPackage diagram of given project.

7. DELIVERABLES• Student should submit the solutions for the previous exercises.• Also student should draw package diagram.

21

Page 22: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Study Of Sequence Diagram

22

5

Page 23: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

1. OBJECTIVE

In this lab, we will see what Sequence diagram is, what the elements of a Sequence dia­gram are, what each of these elements signify. By the end of this lab, student will know what a Sequence diagram is, what its elements are, and, student will be able to create Se­quence diagrams for your system.

2. REFERENCES 

www.developer.com The Unified Modeling Language User Guide by Grady Booch  Mastering UML with Rational Rose by Wendy Boggs  Fundamentals of Rational Rose Student Manual version 2002.05.00

3. PRE­REQUISITE Class Diagram

Use Case Diagram

Activity Diagram

4. THEORY

A Sequence diagram depicts the sequence of actions that occur in a system. The invoca­tion of methods in each object, and the order in which the invocation occurs is captured in a Sequence diagram. This makes the Sequence diagram a very useful tool to easily rep­resent the dynamic behavior of a system.

A Sequence diagram is two­dimensional in nature. On the horizontal axis, it shows the life of the object that it represents, while on the vertical axis, it shows the sequence of the creation or invocation of these objects.

Because it uses class name and object name references, the Sequence diagram is very useful in elaborating and detailing the dynamic design and the sequence and origin of in­

23

Page 24: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

vocation of objects. Hence, the Sequence diagram is one of the most widely used dynam­ic diagrams in UML.

Elements of a Sequence diagramA Sequence diagram consists of the following behavioral elements:

S. No. Element and its description Symbol

1 Object: The primary element involved in a sequence diagram is an Object—an instance of a class. A Sequence diagram consists of sequences of interaction among different objects over a period of time. An object is represented by a named rectangle. The name to the left of the ":" is the object name and to its right is the class name.

2 Message: The interaction between different objects in a sequence diagram is represented as messages. A message is denoted by a directed arrow. Depending on the type of message, the notation differs. In a Sequence diagram, you can represent simple messages, special messages to create or destroy objects, and message responses.

5. EXERCISEDraw a Sequence diagram of the problem given in lab 1 

6. SAMPLE OUTPUTSequence diagram of given project.

7. DELIVERABLES• Student should submit the solutions for the previous exercises.• Also student should draw Sequence diagram.

24

Page 25: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Study Of Collaboration Diagram

25

6

Page 26: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

1. OBJECTIVE

In this lab, we will see what Collaboration diagram is, what the elements of a Collabora­tion diagram are, what each of these elements signify. By the end of this lab, student will know what a Collaboration diagram is, what its elements are, and, student will be able to create Collaboration diagrams for given system.

3. REFERENCES 

www.developer.com The Unified Modeling Language User Guide by Grady Booch  Mastering UML with Rational Rose by Wendy Boggs  Fundamentals of Rational Rose Student Manual version 2002.05.00

3. PRE­REQUISITE Class Diagram

Use Case Diagram

Activity Diagram

4. THEORYA Collaboration diagram is very similar to a Sequence diagram in the purpose it achieves; in other words, it shows the dynamic interaction of the objects in a system. A distinguishing feature of a Collaboration diagram is that it shows the objects and their as­sociation with other objects in the system apart from how they interact with each other. The association between objects is not represented in a Sequence diagram.

A Collaboration diagram is easily represented by modeling objects in a system and repre­senting the associations between the objects as links. The interaction between the objects is denoted by arrows. To identify the sequence of invocation of these objects, a number is placed next to each of these arrows.

26

Page 27: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

A sophisticated modeling tool can easily convert a collaboration diagram into a sequence diagram and the vice versa. Hence, the elements of a Collaboration diagram are essential­ly the same as that of a Sequence diagram.

4.1 Elements of a Collaboration diagramA Collaboration diagram consists of the following elements:

S. No. Element and its description Symbol

1 Object: The objects interacting with each other in the system. Depicted by a rectangle with the name of the object in it, preceded by a colon and underlined.

2 Relation/Association: A link connecting the associated objects. Qualifiers can be placed on either end of the association to depict cardinality.

3 Messages: An arrow pointing from the commencing object to the destination object shows the interaction between the objects. The number represents the order/sequence of this interaction.

5. EXERCISE:

Draw a State Chart diagram of the problem given in lab 1 

6. SAMPLE OUTPUT

 Collaboration Diagram of given project.

7. DELIVERABLES

• Student should submit the solutions for the previous exercises.• Also student should draw Collaboration diagram.

27

Page 28: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Study Of State Chart Diagram

28

7

Page 29: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

1. OBJECTIVEBy the end of this lab, student will know what a State diagram is, what its elements are, and students will be able to create State diagrams for the system.

2. REFERENCES 

www.developer.com The Unified Modeling Language User Guide by Grady Booch  Mastering UML with Rational Rose by Wendy Boggs  Fundamentals of Rational Rose Student Manual version 2002.05.00

3. PRE­REQUISITE Class Diagram

Use Case Diagram

Activity Diagram

4. THEORYState diagrams (also called State Chart diagrams) are used to help the developer better understand any complex/unusual functionalities or business flows of specialized areas of the system. In short, State diagrams depict the dynamic behavior of the entire system, or a sub­system, or even a single object in a system. This is done with the help of Behav­ioral elements.

4.1  Elements of a State diagramA State diagram consists of the following behavioral elements:

29

Page 30: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

S. No. Element and its Description Symbol

30

Page 31: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

1 Initial State: This shows the starting point or first activity of the flow. Denoted by a solid circle. This is also called as a "pseudo state," where the state has no variables describing it further and no activities.

2 State: Represents the state of object at an instant of time. In a state diagram, there will be multiple of such symbols, one for each state of the Object we are discussing. Denoted by a rectangle with rounded corners and compartments (such as a class with rounded corners to denote an Object). We will describe this symbol in detail a little later.

3 Transition: An arrow indicating the Object to transition from one state to the other. The actual trigger event and action causing the transition are written beside the arrow, separated by a slash. Transitions that occur because the state completed an activity are called "triggerless" transitions. If an event has to occur after the completion of some event or action, the event or action is called the guard condition. The transition takes place after the guard condition occurs. This guard condition/event/action is depicted by square brackets around the description of the event/action (in other words, in the form of a Boolean expression).

4 History States: A flow may require that the object go into a trance, or wait state, and on the occurrence of a certain event, go back to the state it was in when it went into a wait state—its last active state. This is shown in a State diagram with the help of a letter H enclosed within a circle.

5 Event and Action: A trigger that causes a transition to occur is called as an event or action. Every transition need not occur due to the occurrence of an event or action directly related to the state that transitioned from one state to another. As described above, an event/action is written above a transition that it causes.

6 Signal: When an event causes a message/trigger to be sent to a state, that causes the transition; then, that message sent by the event is called a signal. Represented as a class with the <<Signal>> icon above the action/event.

7 Final State: The end of the state diagram is shown by a bull's eye symbol, also called a final state. A final state is another example of a pseudo state because it does not have any variable or action described.

5. EXERCISE:

31

Page 32: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Draw a State Chart diagram of the problem given in lab 1 

6. SAMPLE OUTPUT

 State Diagram of given project.

7. Deliverables

• Student should submit the solutions for the previous exercises.• Also student should draw State diagram.

32

Page 33: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Study Of Component Diagram

33

8

Page 34: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

1. OBJECTIVE

In   this   lab,  we will  see  what  Component  diagram is,  what   the  elements  of  a Component diagram are, what each of these elements signify. By the end of this lab, student will know what a Component diagram is, what its elements are, and, student will be able to create Component diagrams for given system.

2. REFERENCES 

www.developer.com The Unified Modeling Language User Guide by Grady Booch  Mastering UML with Rational Rose by Wendy Boggs  Fundamentals of Rational Rose Student Manual version 2002.05.00

3. PRE­REQUISITE Class Diagram

Use Case Diagram

Activity Diagram

4. THEORY

The different high­level reusable parts of a system are represented in a Component dia­gram. A component is one such constituent part of a system. In addition to representing the high­level parts, the Component diagram also captures the inter­relationships between these parts.

So, how are component diagrams different from the previous UML diagrams that we have seen? The primary difference is that Component diagrams represent the implemen­tation perspective of a system. Hence, components in a Component diagram reflect grouping of the different design elements of a system, for example, classes of the system.

Let us briefly understand what criteria to apply to model a component. First and fore­most, a component should be substitutable as is. Secondly, a component must provide an interface to enable other components to interact and use the services provided by the 

34

Page 35: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

component. So, why would not a design element like an interface suffice? An interface provides only the service but not the implementation. Implementation is normally provid­ed by a class that implements the interface. In complex systems, the physical implemen­tation of a defined service is provided by a group of classes rather than a single class. A component is an easy way to represent the grouping together of such implementation classes.

You can model different types of components based on their use and applicability in a system. Components that you can model in a system can be simple executable compo­nents or library components that represent system and application libraries used in a sys­tem. You also can have file components that represent the source code files of an applica­tion or document files that represent, for example, the user interface files such as HTML or JSP files. Finally, you can use components to represent even the database tables of a system as well!

Elements of a Component Diagram

A Component diagram consists of the following elements:

S. NO. Element and its description Symbol

1 Component: The objects interacting with each other in the system. Depicted by a rectangle with the name of the object in it, preceded by a colon and underlined.

2 Class/Interface/Object: Similar to the notations used in class and object diagrams

3 Relation/Association: Similar to the relation/association used in class diagrams

5. EXERCISE

Draw a Component diagram of  the problem given in lab 1 

6. DELIVERABLES

• Student should submit the solutions for the previous exercises.• Also student should draw component diagram.

35

Page 36: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

  

Study Of Deployment Diagram

36

9

Page 37: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

1. OBJECTIVE

In this lab, we will see what Deployment diagram is, what the elements of a deployment diagram are, what each of these elements signify. By the end of this lab, student will know what a deployment diagram is, what its elements are, and, student will be able to create deployment diagrams for given system.

2. REFERENCES 

www.developer.com The Unified Modeling Language User Guide by Grady Booch  Mastering UML with Rational Rose by Wendy Boggs  Fundamentals of Rational Rose Student Manual version 2002.05.00

3. PRE­REQUISITE Class Diagram

Use Case Diagram

Activity Diagram

4. THEORY A deployment diagram models the run­time architecture of a system. It shows the config­uration of the hardware elements (nodes) and shows how software elements and artifacts are mapped onto those nodes.

A UML 2 deployment diagram depicts a static view of the run­time configuration of pro­cessing nodes and the components that run on those nodes. In other words, deployment diagrams show the hardware for your system, the software that is installed on that hard­ware, and the middleware used to connect the disparate machines to one another. You want to create a deployment diagram for applications that are deployed to several ma­chines, for example a point­of­sales application running on a thin­client network comput­er which interacts with several internal servers behind your corporate firewall or a cus­tomer service system deployed using a web services architecture such as Microsoft’s 

37

Page 38: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

.NET.  Deployment diagrams can also be created to explore the architecture of embed­ded systems,  showing how the hardware and software components  work  together.   In short, you may want to consider creating a deployment diagram for all but the most triv­ial of systems.

Elements of a Component DiagramA Component diagram consists of the following elements:

NodeA Node is either a hardware or software element. It is shown as a three­dimensional box shape, as shown below.

Node Instance

A node instance can be shown on a diagram. An instance can be distinguished from a node by the fact that its name is underlined and has a colon before its base node type. An instance may or may not have a name before the colon. The following diagram shows a named instance of a computer.

Node Stereotypes

A number of standard stereotypes are provided for nodes, namely «cdrom», «cd­rom», «computer», «disk array», «pc», «pc client», «pc server», «secure», «server», «storage», 

38

Page 39: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

«unix server», «user pc». These will display an appropriate icon in the top right corner of the node symbol

Artifact

An artifact is a product of the software development process. That may include process models (e.g. use case models, design models etc), source files, executables, design docu­ments, test reports, prototypes, user manuals, etc.An artifact is denoted by a rectangle showing the artifact name, the «artifact» keyword and a document icon, as shown below.

AssociationIn the context of a deployment diagram, an association represents a communication path between nodes. The following diagram shows a deployment diagram for a network, de­picting network protocols as stereotypes, and multiplicities at the association ends.

39

Page 40: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Node as Container

A node can contain other elements, such as components or artifacts. The following dia­gram shows a deployment diagram for part of an embedded system, depicting an exe­cutable artifact as being contained by the motherboard node.

40

Page 41: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

5. EXERCISE

Draw a Deployment diagram of the problem given in lab 1 

6. DELIVERABLES

• Student should submit the solutions for the previous exercises.• Also student should draw Deployment diagram.

41

Page 42: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

Study Of Use case realization

42

10

Page 43: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

1. OBJECTIVE     In this lab, student will get an idea about Use case realization. 

2. REFERENCES 

www.developer.com The Unified Modeling Language User Guide by Grady Booch  Mastering UML with Rational Rose by Wendy Boggs  Fundamentals of Rational Rose Student Manual version 2002.05.00

3. PRE­REQUISITE Class Diagram

Use Case Diagram

Use case specification

Sequence diagram

Communication diagram

4. THEORYA use case  realization   is   the  realization  of   the  functionality  of  all  use cases   in system. The use case realization is implemented by collaboration of the use cases attached to it by dependencies .

When the collaboration is blow up we get 2 parts 

A.) Class diagram implementing the scenario.

B.)  Collaboration or Sequence diagram 

Use   case   realization   is   the   implementation   of   all   business   functionality   for   the scenario under consideration

43

Page 44: Lab Manual - gyan.fragnel.edu.ingyan.fragnel.edu.in/lm/sem6/ooad.pdf · Fundamentals of Rational Rose Student Manual version 2002.05.00 3. PRE ... In this lab, we will cover the dynamic

 

UseCase realizationUUseCase

2. EXERCISE

Show Use case realization

3. DELIVERABLES

• Student should submit the solutions for the previous exercises.• Also student understands Use Case realization.

44