You are on page 1of 16

List of Practicals and Projects to be completed For I.T. 6th Sem.

(3rd Year) Prerequisites-1 : Explain the detail of software requirement(Rational Rose) for OOSE LAB.
Rational Rose is a powerful tool to aid in analysis and design of object oriented software systems. Rational Rose help in system analysis and design by enabling to design use cases and use case diagram to show the system functionality. Rational Rose supports the development of the majority of models for developing visual diagrams of UML that represents various aspects of the system, such as 1. Use Case Diagram 2. Sequence Diagram 3. Collaboration Diagram 4. Class Diagram 5. State Transition Diagram 6. Component Diagram 7. Deployment Diagram Rational Rose is currently available in three editions: Rose Modeler no language support Rose Professional support for 1 language Rose Enterprise supports multiple languages including VC++, VB, Java, and CORBA

Prerequisites-2 :Detail out the Rational Rose GUI layout.


The most common elements are of Rational Rose Graphical User Interface are: Standard toolbar Diagram toolbox Diagram window Browser Specifications Documentation window

Toolbars and toolboxes The Rose standard toolbar is located near the top of the window. It is always displayed - independent of the current diagram type. The Rose diagram toolbox changes based on the active diagram. While in Rose, placing the cursor over the tools it displays a tooltip for each icon.

Diagram window : You can create, display or modify Rose diagrams in the diagram window. Browser : The Rose browser is a hierarchical navigational tool allowing you to view the names and icons representing diagrams and model elements. If the browser is not displayed, select Browser from the View menu. Specifications : Specifications are dialog boxes that allow to set or change model element properties. Changes made to a model element through the specification are automatically updated throughout the model.

Documentation window : The documentation window allows you to create a self-documenting model. One can create, view or modify information in the documentation window of the specification. If the documentation window is not visible, select Documentation from the View menu. Prerequisites-3 : Describe Different Views of Rational Rose: Rational Rose is organised around the following views of a software project: Use Case Logical Component Deployment Use-case view The use-case view helps you to understand and use the system. This view looks at how actors and use cases interact. The diagrams in this view are: Use-case diagrams Sequence diagrams Collaboration diagrams Activity diagrams

Logical view : The logical view looks at classes and their relationships. The diagrams in this view are: Class diagrams Statechart diagrams. Component view : The component view addresses the software organisation of the system. This view contains only component diagrams. Deployment view The deployment view shows the mapping of processes to hardware. This type of diagram is most useful in a distributed architecture environment where you might have applications and servers at different locations. This view contains only the deployment diagram.

Aim-1 : Produce a use case diagram for part of the system of library that that deals with lending and returning items, reservations, and searching. The actors in the library system are: Borrower Librarian The use cases for this part of the library system are: Lend Item Return Item Make Reservation Remove Reservation Search Library Solution :

How to create Use Case diagrams Use Case diagrams represent a high level view of the system from the Users point of view. 1. In the browser, right click on Use Case View and select New. Left click to select Use Case Diagram. 2. Rename, and double click to select. Expand Diagram window (if necessary). To add actors: 1. From diagram toolbar, left click on Actor icon and position pointer where the actor is required on the diagram window, left click again.

2. Re-name Actor by double clicking and changing name within appropriate field. Multiple actors can be positioned one after the other by holding down the shift key and selecting Actor icon and left clicking onto diagram window (release the shift key and click in order to drop the last Actor). Adding Use cases: 1. From diagram toolbar, left click on Use Case icon to select and left click on Diagram window in required position. Adding Flows 1. From the toolbar select the Unidirectional Association icon. Left click and drag from the appropriate Actor to the Use Case. Repeat to connect each actor to at least one Use Case. Adding a system boundary: 1. You can not do this in Rational Rose; it is assumed that anything outside the system would not appear on the model. Adding a system boundary: 1. You can not do this in Rational Rose; it is assumed that anything outside the system would not appear on the model. Saving your work: 1. Go to File, Save As, and give a name for the file. Extend An extend relationship from Use Case A to Use Case B indicates that an instance of Use Case B may be augmented(increased) by the behaviour specified by A. Include An include relationship from Use Case A to Use Case B indicates that an instance of the Use Case A will also contain the behaviour as specified by B. Add Extends: 1. From the diagram toolbar, left click on Unidirectional Association icon to select. 2. Link the two Use Cases so that the arrow points to the extended Use Case. 3. Right-click on the created association, and then click on Open Specification. 4. From the Stereotype drop down menu type or select extend and click OK. Add Includes: 1. From the diagram toolbar, left click on Unidirectional Association icon to select. 2. Link the two Use Cases so that the arrow points to the included Use Case. 3. Right-click on the created association, and then click on Open Specification. 4. From the Stereotype drop down menu type or select include and click OK.

Aim-2 : A company consists of departments. Departments are located in one or more offices. One office acts as a headquarter. Each department has a manager and the set of employees. Draw a class diagram which consists of all the classes in your system their attributes and operations, relationships between the classes, multiplicity specifications. Solution:

Classes : A class is a set of objects that share a common structure and common behavior (the same attributes, operations, relationships and semantics). A class is an abstraction(concept) of real-world items. When these items exist in the real world, they are instances of the class and are referred to as objects. class : attributes, operations, constraints, tagged values, stereotypes. Graphical Depiction : A class icon is drawn as a 3-part box, with the class name in the top part, a list of attributes (with optional types and values) in the middle part, and a list of operations (with optional argument lists and return types) in the bottom part.
NewClass3 attributes NewClass2 operation()

A Class Attribute Specification : enables to display and modify the properties of a class attribute in the current model. Attribute is a Data element contained in each object of a class. e.g. name : data type i.e. name : String
visibility attribute : Class = InitialValue {TaggedValue}{Constraint} name:String='unknown' firstName:String='' birthDate:Date /age {age=today-birthDate}------------------------------ /derivedAttribute colour : {red, blue, green} radius : Integer = 25 {readonly}{radius > 0} -counter : Integer

time : DateTime::Time dynamArray[*] ------------------------------------- sets are denoted by [*] name[1] : String ---------------------------------- mandatory attribute (default) -- mandatoryAttr[1]: Class firstName[0..1] : String ------------------------- optional attribute --optionalAttr[0..1]: Class firstNames[1..5] : String

To display a Class Attribute Specification, first display a Class Specification. On the Class Specification, click on the Attribute tab. If there are no attributes listed, define a new attribute by right-click in the attribute area and Click Insert, an entry item is added. Double-click on an attribute name. Attribute Specification Contents :The Class Attribute Specification consists of the following tab(s): General and Detail. Information about name, class, type, show classes, stereotype, initial

value, export control, and documentation is entered or displayed on General tab. Information about containment, static and derived is entered or displayed on Detail tab. An operation specification : allows to add or modify the properties of a class operation. Operations denote services provided by the class. Operations can be methods for accessing and modifying class fields or methods that implement characteristic behaviors of a class. The Operation Specifications : consists of the following tab(s): General, Detail, Pre Conditions, Semantics, Post Conditions, and Files. Notation : name(parameter:ParameterType = DefaultValue, ...): ReturnType{TaggedValues}{Constraints} Example setPosition(x:Integer = 1, y : Integer = 1) : Boolean{abstract} {(x>0) and (y>0)} The Examples are : position(x,y) position(x : Integer, y : Integer) resize( ) resize( ) : GeomFigure resize(byFactor : Real) : GeomFigure payIn(amount : Amount) : Amount {amount > 0} dataHasChaged( ) checkDataChange( )

Aim-3: What is Interaction Diagram? Detail out the Sequence Diagram and Collaboration Diagram?
Ans. Sequence diagrams and collaboration diagrams, both are called interaction diagrams, are two of the five diagrams used in the UML for modeling the dynamic aspects of systems. An interaction diagram shows an interaction, consisting of a set of objects and their relationships, including the messages that may be dispatched among them. Interaction diagrams commonly contain Objects Links Messages A sequence diagram is an interaction diagram that emphasizes the time ordering of messages(visual cue to the flow of control over time); a collaboration diagram is an interaction diagram that emphasizes the structural organization of the objects that send and receive messages. An interaction diagram shows an interaction, consisting of a set of objects and their relationships, including the messages that may be dispatched among them. A sequence diagram is an interaction diagram that emphasizes the time ordering of messages. Graphically, a sequence diagram is a table that shows objects that are arranged along the X axis and messages, ordered in increasing time, along the Y axis. Typically, we place the object that initiates the interaction at the left, and increasingly more subordinate objects to the right. Next, we place the messages that these objects send and receive along the Y axis, in order of increasing time from top to bottom. A collaboration diagram is an interaction diagram that emphasizes the structural organization of the objects that send and receive messages. Graphically, a collaboration diagram is a collection of vertices and arcs. Sequence diagrams have two features that distinguish them from collaboration diagrams. First, there is the object lifeline. An object lifeline is the vertical dashed line that represents the existence of an object over a period of time.

Most objects that appear in an interaction diagram will be in existence for the duration of the interaction, so these objects are all aligned at the top of the diagram, with their lifelines drawn from the top of the diagram to the bottom. Objects may be created during the interaction. Their lifelines start with the receipt of the message stereotyped as create. Objects may be destroyed during the interaction. Their lifelines end with the receipt of the message stereotyped as destroy (and are given the visual cue of a large X, marking the end of their lives).

Second, there is the focus of control. The focus of control is a tall, thin rectangle that shows the period of time during which an object is performing an action, either directly or through a subordinate procedure.

The top of the rectangle is aligned with the start of the action; the bottom is aligned with its completion (and can be marked by a return message). we can show the nesting of a focus of control (caused by recursion, a call to a self-operation, or by a callback from another object) by stacking another focus of control slightly to the right of its parent (and can do so to an arbitrary depth). If we want to be especially precise about where the focus of control lies, we can also shade the region of the rectangle during which the object's method is actually computing (and control has not passed to another object).

Unlike a sequence diagram, we don't show the lifeline of an object explicitly in a collaboration diagram, although you can show both create and destroy messages. In addition, we don't show the focus of control explicitly in a collaboration diagram, although each message's sequence number can indicate nesting. Collaboration Diagrams A collaboration diagram emphasizes the organization of the objects that participate in an interaction. we form a collaboration diagram by first placing the objects that participate in the interaction as the vertices in a graph. Next, we render the links that connect these objects as the arcs of this graph. Finally, we adorn these links with the messages that objects send and receive. This gives the reader a clear visual cue to the flow of control in the context of the structural organization of objects that collaborate.

Collaboration diagrams have two features that distinguish them from sequence diagrams. First, there is the path to indicate how one object is linked to another Second, there is the sequence number. To indicate the time order of a message, you prefix the message with a number (starting with the message numbered 1), increasing monotonically for each new message in the flow of control (2, 3, and so on). To show nesting, you use decimal.

Aim-4 : Draw a sequence diagram showing a person withdrawing money from ATM. Solution : The sequence diagram shows the interactions among objects that participate in a use case and the message that pass between them over time for one use case. It is a dynamic model that shown in a time sequence. Typically used to represent the detailed interaction among object of the classes, not among the classes themselves. The objects are shown in rectangles across the top of the diagram. There are five objects Joe:customer Card reader Atm screen Joes Account Cash Dispenser

ElementsEleme of Seq

O bj ect

Object of Elemen Elements Sequ


m es s age

Messa

1. 2. 3. 4. 5. 6. 7.

The process begins when Joe inserts his card into the card reader. The card reader reads the number on Joes card, then tells the ATM screen to initialize itself. The ATM prompts Joe for his PIN. Joe enters his PIN and the ATM opens his account. Joes PIN is validated, and

- Obje Place across the Focus o lifeline Elements of Sequ messa using object symb - using dotted line runs v - -is a lon Mess sequence by send and object to denote the lifeline. Reflexive message message. to exe over time.

8. the ATM prompts him for a transaction. 9. Joe selects Withdraw. 10. The ATM prompts Joe for the withdrawal amount. 11. Joe enters $20. 12. Withdrawing fund started by atm 13. The ATM verifies that Joes account has sufficient funds, 14. and subtracts $20 from the account. 15. The ATM dispenses $20 16. The ATM provides the receipt and 17. ejects Joes card.

Joe : C us t

To create a new Sequence diagram: 1. Rightclick a use case in the Use Case view. 2. Select New Sequence Diagram.

Aim-5 : Draw an activity diagram. An activity represents the performance of task in a workflow. An activity is similar to a state, but expresses the intent that there is no significant waiting in an activity. Transitions connect activities with other model elements and object flows connect activities with objects. A workflow is best defined as a well-defined sequence of activities that produces an observable value or objective to an individual or entity when performed.we can model workflows with activity diagrams. Purposes of Workflow Modeling are threefold: To understand the structure and dynamics of an organization To ensure that customers, end users, and developers have a common understanding of the organization To derive requirements on systems to support the organization When you define a workflow, an activity diagram should answer the following questions: Who or what has the overall responsibility of the workflow? A use case or class could own each activity diagram, for example. What activities need to be performed to meet your objective or goal? Define all of the high-level activities that need to take place in the workflow. You do not need to define every activity or state, just the ones with the greatest importance in the workflow. Who will be responsible for performing the various activities and states? Define each activity within a swimlane so you know who is responsible for carrying out the activity. Any element within a swimlane is owned and should be carried out by the swimlane. Do the activities create or modify objects? Connect objects and activities with object flows. Specify the state of the object through the state specification. Refer to the object flow sample topic for more information. Where do the activities and states take place with respect to other elements on your diagram? Placement of your activities on the diagram determines the order of your workflow. Why does this activity or state need to take place? The reason or purpose for each activity or state should be placed in the specification documentation field. Activity diagrams can be very effective in illustrating the workflow of various events in a usecase diagram. The flow of events of a use case describes what needs to be done by the system in order to provide value to an actor. Also, use -case diagrams present a high level view of how the system is used as viewed from an outsiders (actors) perspective. You can use activity diagrams to specify and define each event in a use-case diagram.

The use-case example below shows the use cases involved with ordering, making, paying for, and shipping a part for a machine as well as the actors involved in the process.

The following tools are used on the activity diagram toolbox to model activity diagrams: Activities Decisions End State Object Object Flow Start State States Swimlanes : A swimlane is a vertical section of the diagram that will contain all of the workflow steps that a particular person or group performs. Synchronizations Transitions

Aim-6 : Produce a Sequence Diagram to model the use case Lend Item that will show the sequence of messages between objects of the following classes: Librarian (Actor) Loan Reservation Item Title BorrowerInformation Aim-7 : produce a Collaboration Diagram from the sequence diagram. Aim-8 : Design a Component Diagram with Example. Aim-9 : Produce a Deployment Diagram. Aim-10 Make the projects in Group covering all the diagrams : ( MOHD IZHAR ) Asstt. Professor CSE/IT HMRITM

You might also like