0% found this document useful (0 votes)
807 views35 pages

Practical 1: Aim: To Study and Create Use-Case Diagram Theory: Use-Case Diagram

The document discusses activity diagrams in UML. It defines key elements of activity diagrams including activities, transitions, decisions, synchronization, swim lanes, and object flows. Activities represent tasks or processes, transitions connect activities, and decisions allow for conditional branching between activities. Synchronization is used to show concurrent activities merging, using forks to split flows and joins to synchronize them. Swim lanes can divide the diagram into groups. Object flows show the relationship between activities and objects in the system.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
807 views35 pages

Practical 1: Aim: To Study and Create Use-Case Diagram Theory: Use-Case Diagram

The document discusses activity diagrams in UML. It defines key elements of activity diagrams including activities, transitions, decisions, synchronization, swim lanes, and object flows. Activities represent tasks or processes, transitions connect activities, and decisions allow for conditional branching between activities. Synchronization is used to show concurrent activities merging, using forks to split flows and joins to synchronize them. Swim lanes can divide the diagram into groups. Object flows show the relationship between activities and objects in the system.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Practical 1

Aim: To Study and Create Use-case Diagram Theory: Use-case Diagram: The Use Case Diagram is a diagram that shows a set of Use cases and actors and their relationships. The Use Case Diagrams are mainly used or addressed the static use case view of the system. These diagrams present a high level view of how the system is used as viewed from an outsiders (actors) perspective. A use-case diagram may depict all or some of the use cases of a system. The diagrams are also for testing the executable systems through forward and reverse engineering. The Use Case Diagrams are specially important in organising and modelling the system behaviour of system, classes so that users can comprehend how to use that element. Contents: Use Cases Actors Relationships Use-Cases: It is a description of a set of actions including variant that the system performs to yield an observable result of a value to an actor. The Use Case is used to Structure the behavioral things in a model. Use Cases provide means to: Capture system requirements Communicate with the end users and domain experts Test the system Examining the actors and defining what the actor will be able to do with the system best discover Use Cases. Actor: An actor represents a coherent set of roles that the user of use cases play when interacting with these use cases. An actor initiates a use cases. Actors are discovered by examining: Who directly uses the system Who is responsible for maintaining the system External hardware used by the system Other systems that need to interact with the system The needs of the actor are used to develop use cases. This insures that the system will be what the user expected.

Relationships: You can add relationships to the diagram to show interactions between actors and use cases Association: An association provides a pathway for communication. The communication can be between use cases, actors, classes or interfaces. Associations are the most general of all relationships and consequently the most semantically weak. If two objects are usually considered independently, the relationship is an association. Actor may be connected to the use cases only by the association, indicates that the actor and a use case communicate with one another, each one possibly sending and receiving message. Dependency: The dependency is to use the relationship, specifying that a change in the specification of one thing may affect another that uses it. The UML defines the number of stereotypes that are applied to dependency relationships. Two stereotypes apply to dependency relationship among use cases 1. Extend: Specifies that the target use case extends explicitly the behavior of the source. 2. Include: Specifies that the source use case explicitly incorporate the behavior of another use case at a location specified by the source. You can use extend and include when you want to decompose use cases into reusable parts.

Graphical Representation: 1. Use-case: The basic shape of a use case is an ellipse:

Use case (activity) The Activity or the use case is having the name which is just below the icon. 2. Actor: An actor is a stereotype of a class and is depicted as a stickman on a use case diagram.

Actor

3. Association: An association relationship is an orthogonal or straight solid line with an arrow at one end

Actor

Use Case

Common Uses The use case diagrams are used to model the static use case view of a system. This view primarily supports the behaviour of a system. 1. To model the context of a system. Modelling the context of the system involves drawing around the whole system and asserting which actor lie outside the system and interact with it. Here, we apply the use case diagram to specify actor and meaning of their roles. 2. To mode requirements of the system. It involves specifying what that system should do independent of how that system should do it. Here we apply the use case diagram to specify the desired system behaviour. Problem Definition: Create a Use Case Diagram for the ATM system using UML. Approach: For given prob. definition the actors involved are: User The Use Cases involved are: Enquiry: The user enquires about the balance of his account. Session: It keeps track of users activity Transaction: The users interact with the bank ATM system by going through the approval process. After the approval process the user performs the transaction Money Transfer: It transfers the money from one account to another account. Deposit: It allows the user to deposit the money either by cheque, cash or envelope.

Withdrawal: It allows the user to withdraw money from his account. Print Receipt: It prints summary of the transactions undertaken by the user in a single session. Insufficient Fund: It is the state where funds are not sufficient to process the transaction. Enter PIN: The user enters the PIN number. Invalid PIN: It indicates that the user has entered the wrong PIN number The Sub Systems Involved are: Bank ATM System Bank Conclusion: Thus we have studied and create Use case diagram for ATM system using UML.

Diagram:

Practical 2
Aim: To study and create Activity Diagram. Theory: Activity diagram: Activity diagrams provide a way to model the workflow of a business process. You can also use activity diagrams to model code-specific information such as class operation. Activity diagrams are very similar to a flowchart because you can model a workflow from activity to activity. An activity is basically a special case of a state machine in which most of the states are activities and most of the transitions are implicitly triggered by completion of actions in the source activities. The main difference between activity diagrams and state charts is activity diagrams are activity centric, while state charts are centric. An activity diagram is typically used for modelling the sequence of activities in a process, whereas a state chart is better suited to model the discrete stages of an objects lifetime. Contents: Activity Transaction Decision Synchronization Swim lanes Object flow Activity: An activity represents the performance of task or duty in a workflow. It may also represent the execution of a statement in a procedure. An activity is similar to a state, but expresses the intent that there is no significant waiting (for events) in an activity. Transitions connect activities with other model elements and object flows connect activities with objects. Actions: Each state and activity on a state chart or activity diagram may contain any number of internal actions. An action is best described as a task that takes place while inside a state or activity. There are four possible actions within a state or activity:Start state: A start state explicitly shows the beginning of a workflow on an activity diagram or the beginning of the events that cause a transition on a state chart diagram. You can have only one start state on a state chart or activity diagram. When applying nested states or nested activities, you should define one start state in each context. End State: An end state represents a final or terminal state on an activity diagram or state chart diagram. Place an end state when you want to explicitly show the end of a workflow on an

activity diagram or the end of a state chart diagram. Transitions can only occur into an end state; however, there can be any number of end states per context. You can label end states, if desired. State specifications are associated with each end state. Transition: A state transition that an object in the source state will perform certain specified actions and enter the destinations state when a specified event occurs or when certain conditions are satisfied. A state transition is a relationship between two states, two activities, or between an activity and a state. You can show one or more state transitions from a state as long as each transition is unique. Transitions originating from a state cannot have the same event, unless there are conditions on the event. Naming: You should label each state transition with the name of at least one event that causes state transition. You do not have to use unique labels for state transitions because the same event can cause a transition to many different states or activities. Transitions are labelled with the following syntax: Event (arguments) [condition] / action ^ target. Send Event (arguments) Only one event is allowed per transition, and one action per event. Decisions: A sequence of activities almost has to point where a decision has to take place. One set of condition to another path and two paths are mutually exclusive graphically. Synchronization: When two activities run simultaneously or at same time then come together, to show relation between both activities, synchronization is used. Forking: A fork can represent the splitting of one activity to number of activities, i.e. single flow of control into two or more concurrent flow of controls. Join: A join may represent the synchronization of two or more concurrent flows, i.e. the activity having no of incoming arrows and only one outgoing flow of control. Swim lanes: In UML each group is known as swim lane, this is because, visually each group is divided from its neighbour by a vertical solid line. Object Flow: An object flow on an activity diagram represents the relationship between an activity and the objects are present in the system. Rational Rose draws object flows as dashed arrows rather than solid arrows to distinguish them from ordinary transitions. Object flows look identical to dependencies that appear on other diagram types. Graphical Representation: 1. Activity: The activity icon appears as a rectangle with rounded ends with a name

2. Start State: The start state icon is a small, filled circle that many contain a name (Begin Process): Start State

3. End State: The end state icon is a filled circle inside a slightly larger unfilled circle that may contain a name (End process):

End state 4. Transition: The icon for a state transition is a line with an arrowhead pointing toward the destination state or activity:
Transition

5. Synchronization: Fork:

Join:

Swim lane: Swim lane name

Swim lane name Swim lane name

Object flow:
Save invoice Object flow

Invoice [saved]

Common Uses: To model the workflow Workflow often lays the fringe of the software intensive systems and used to visualize, specify, construct and documentation of the business processes. To model an operation Here we may use the activity diagram as flowcharts that are used to model the details of computation. Use of activity diagram the modeling of branch, fork and join states. The context of an activity diagram used involves the parameters of operation and it is local objects. Problem definition: Create an activity diagram for ATM system. Approach: Swim lanes for system are: Customer System Bank Sequences of activities are: Customer inserts the ATM card. Customer enters the PIN. PIN number is validated. If PIN number is valid then, the system asks for the type of account. The bank checks for the balance in the account. If insufficient balance, display insufficient funds else dispense cash, print receipt and display the balance. Eject the card. Conclusion: Thus, we have studied and created activity diagram for the ATM system.

Diagram:

Practical 3
Aim :-To study and create Class Diagram. Theory :Class Diagram: The class diagram is one of the most common diagrams found in modelling the static view of the system. Class diagram provide the structure that is required for any system. Contents Class Package Relationships 1. Class A class is a set of objects that share a common structure and common behaviour (the same attributes, operations, relationships and semantics). A class is an abstraction 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 using the concept of visibility Visibility It specifies whether the other classes can use it. There are three types Public Protected Private Public (+):Any classifier outside can use it Graphically shown as plus sign before attribute or operation Protected (#):Descendent f the classifier can use it Graphically shown as a hash symbol before the attribute or operation Private (-):Only the classifier itself can access or use it Graphically shown as a minus sign before attribute or operation

2. Package:The package is the general purpose mechanism used to group the modelling elements. The package is used to arrange modelling elements into target chunks that you can manipulate as a group.

3. Relationships:The classes in the class diagram are by relation Four types of relationship exist among classes. 1. Dependency 2. Generalisation. 3. Association 4. Aggregation

1. Dependency:A dependency is a relation that occurs due to a change in specification of one thing may affect another thing that uses it. 2. Generalization:Generalisation relationship is a relationship between a more general class or use case and a more specific class or use case. A generalisation is shown as a solidline path from the more specific element to a more general element. 3. Association:It is a structural relationship that specifies the at the objects of thing is connected to the objects of another thing. Graphically an association is rendered as the solid lines connecting the same or different classes. 4. Aggregation:While modelling a "whole/part" a relationship where a class represents a larger thing which consists of a smaller thing, aggregation can be used. It shows a class has a relationship. Adoring the plain association with an open diamond at the whole end shows it. Terms related to relationship: Multiplicity:Multiplicity is the number of instances of one class that may relate to a single instance of an associated class. It specifies the range of allowable associated classes. It is given for roles within associations, Parts with compositions, repetitions, and other purposes. A multiplicity specification is shown as a text string comprising a period-separated sequence of integer intervals. Where an interval represents a range of integers in this format. The term lower bound and upper bound are integer values, specifying the range of integer including the lower bound to the upper bound. The start character (*) may be used for the upper bound, denoting an unlimited upper bound. If a single integer value is specified then the integer range contains the single values. e.g. 1)0..1 2)0..* 3)1..3,7..10,15,19..*

Constraint: Constraint is the condition that can be applied on the relation. Role name: In an association class has some role. It is at one end of the association specified at opposite ends. Graphical Representation: 1. Class:Class Name Attribute Operations

Names:-Every class has a name. Attributes:-Attributes define the characteristics of a class. Each object in a class has the same. Operations:-Operations denote services or methods provided by the class. 2. Package:-

Package

3. Relationship:o Dependency:Graphically a dependency is rendered as a dashed directed line to the thing being dependant.

Window

Event

Dependency

o Generalisation:The tip or a generalisation is a large hollow triangle pointing to the more general element. Super Class Subclass

Generalisation o Aggregation:Aggregation
Class 1 Class 2

4. Multiplicity:Class 1 Class 2

1..* 5. Constraint:{constraint}
Class 1 Class 2

6. Role Name:Class 1

Name 1

Name 2

Class 2

Problem definition: Create a class diagram for the ATM system. Approach: 1. We have created a class diagram for ATM system containing session which is having transaction for a customer. 2. Session consists of operations like start, validating pin and end of session. 3. Transaction consists of attributes amount, transaction time, transaction date and generalized into deposit, withdraw, transfer and enquiry. 4. ATM is connected to bank having accounts of respective customer visiting the ATM. 5. There is separate class of Account and User having their respective attributes.

Conclusion: Thus we have studied and created class diagram for ATM system

Diagram:

Practical 4
Aim: To study and create Sequence Diagram. Theory: Interaction Diagram: The diagram that shows the interaction, consisting of the set of objects and their relationship, including the messages that may be dispatched among them. The interaction diagrams are used to model the dynamic view of the system. Two types of interaction diagrams1. Sequence Diagram 2. Collaboration Diagram Sequence Diagram: An interaction that emphasizes the time ordering of messages, graphically, a sequence diagram is a table that shows objects arranged along the X-axis and messages, ordered in measuring time, along the Y-axis. Sequence diagram is a graphical view of a scenario that shows object interaction in a timebased sequence, i.e. what happens first?, what happens next? Sequence diagrams establish the roles of objects and help provide essential information to determine class responsibilities and interfaces. This type of diagram is best used during early analysis phases in design because they are simple and easy to comprehend. Sequence diagrams are normally associated with use cases. The sequence diagrams have two featuresObject Lifeline:An object lifeline is a vertical dashed line that represents the existence of an object over the period of time. Focus of Control:This 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. Contents: Objects Lifeline Time Message

Objects: Each object in a diagram indicates some instance of a class. An object has state, behaviour and identity. The structure and behaviour of similar objects are defined in their common class. Each object in a diagram indicates some instance of a class.

Lifeline: Each object appearing on a sequence diagram contains a dashed vertical line, called a lifeline, which represents the location of an object at start and stop and a place for the focus of control to reside. Time: The diagram represents the time in vertical direction and state from the top and progress forward to the bottom. Message: Message is the element which is used to communicate between two objects i.e. it transfers control from one object to another.

Graphical Representation: 1. Object:

Object Name

2. Lifeline:

Object Name

3. Time:

Message:

Object Name

Object Name

Simple message

Problem Definition: Create a Sequence Diagram for the ATM system using UML. Approach: The objects required for the library system are: User BankATMSystem Bank Account Sequence of activities in diagram as follows1. User inserts the ATM card. 2. BankATMSystem requests the PIN number. 3. User enters PIN number. 4. BankATMSyestem verifies the PIN number. 5. Bank responds whether the PIN number is valid or invalid. 6. If PIN number is invalid BankATMSystem requests for re-entry of PIN number. 7. If PIN number is valid, BankATMSystem asks for the type of transaction. 8. User selects withdraw transaction. 9. BankATMSystem requests the amount to be withdrawn. 10. User enters the amount. 11. BankATMSystem processes the transaction. 12. Bank checks for the balance in Account. 13. If insufficient balance, Bank responds as withdrawal unsuccessful & BankATMSystem responds as transaction failure. 14. In case of sufficient balance, Bank responds as withdrawal successful & BankATMSystem dispenses the cash.

15. BankATMSystem requests to take the cash. 16. The user takes the cash. 17. The BankATMSystem requests confirmation. 18. User terminates the session. 19. BankATMSystem prints the receipt. Conclusion: Thus, we have studied and create Sequence diagram for ATM system using UML.

Diagram:

Practical 5
Aim: - To study and create Collaboration Diagram Theory:Collaboration Diagrams: Collaboration diagram and sequence diagrams are alternate representations of an interaction. Collaboration is an interaction diagram that shows the sequence of messages that implement an operation or a transaction. Collaboration diagrams show objects, their links, and their messages. They can also contain simple class instance and class utility instances. Each collaboration diagram provides a view of the interactions or structural relationships that occur between objects and object-like entities in the current model. The Create Collaboration Diagram Command creates a collaboration diagram from information contained in the sequence diagram. The Create Sequence Diagram Command creates a sequence diagram from information contained in the interactions collaboration diagram. The Go to Sequence Diagram and Go to Collaboration Diagram commands traverse between an interactions two representations. Collaboration diagrams contain icons representing objects. You can create one or more collaboration diagrams to depict interactions for each logical package in your model .Such collaboration diagram are themselves contained by the logical packages enclosing the objects they depict. An Object Specification enables you to display and modify the properties and relationships of an object. The information in a specification is presented textually. Some of this information can also be displayed inside the icons representing objects in collaboration diagrams. Toggling between Collaboration and Sequence Diagrams: When you work in either a collaboration or sequence diagram, it is possible to view the corresponding diagram by pressing the F3 key. For example, if you are working on sequence diagram, you can press F3 and same diagram name and model elements. If you make a change to one diagram and then press F5, the change will appear on the corresponding diagram as well. Contents: Object Link Message Object: Each object in a diagram indicates some instance of class. An object has state, behaviour, and identity. The structure and behaviour of similar objects are defined in their common class. Each object in a diagram indicates some instance of a class. Link: A link connecting the associated objects shows the interaction between the objects, qualifiers can be replaced or either end of association to depict cardinality.

Message: The message is the element, which is used to communicate between two objects i.e. it transfers control from one object to another. The no represent the sequence/order of interactions. Graphical Representations: 1. Object:

object name
2. Link:

object name
Link

object name

3. Message:

object name
No. of message/function()

object name

Problem Definition: Create a Collaboration Diagram for the ATM system using UML. Approach: The objects required for the ATM system are: ATM User Cash Dispenser Bank Sequence of activities in diagram as follows: 1. 2. 3. 4. 5. 6. User enters withdraw operation. ATM asks for amount. User enters the amount. ATM sends amount value to Bank. Account checks in checking account balance present or not? Checking Account checks balance.

7. ATM dispenses the cash. 8. User takes money. 9. The balance of the Users account is updated after the successful completion of transaction. 10. User asks for the receipt to the ATM system. 11. ATM system gives the receipt to the user.

Conclusion: Thus we have studied and created collaboration diagram for ATM system.

Diagram:

Practical 6
Aim:- To Study and Create a State Transition Diagram. Theory:State Machine diagram is a technique to describe the (dynamic) behaviour of a system. In OO approaches, a State Machine Diagram models the behaviour of a single object, specifying the sequence of events that an object goes through during its lifetime in response to events. Contents: Event State Start State End state Transition Event: State machines communicate by sending events to one another. An event may correspond to a signal such as hardware interrupt or may correspond to a message such as method invocation or inter-process message. State: A state is an abstraction of an objects state. It can represent particular values for a subset of the objects attributes and links. Start State: A start state explicitly shows the beginning of the events that cause a transition in a state diagram. There can be only one start state. End State: End state represents a final or terminal state chart diagram. An end state is placed to show the end of a state chart diagram. Transitions: A state transition indicates that an object in the state will enter the destination state when a specified event occurs or when certain conditions are satisfied. A state transition is a relationship between two states. A transition has a label in the form of three parts: trigger [guard]/activity. Trigger is the signal, event that triggers a potential change of state. Guard if presented, is a Boolean condition that must be true in order for the trigger to cause the transition. Activity is some behavior that has executed during the transition.

Graphical Representation 1. State The state icon appears as a rectangle with rounded ends with a name

2. Internal Activity To show the case where states react without transition (also called internal transition). By putting the even, guard and activity inside the state box itself.

3. Start State The start state icon is a small filled circle that may contain a name

4. End State The end state icon is a filled circle inside a slightly larger unfilled circle that may contain a name

5. Self Transition A self-transition is a transition whose source and target states are the same

6. Concurrent State States can be broken into several (sub-) state diagrams that run concurrently

7. Branch State A decision pseudo-state is shown as a diamond with one transition is arriving and two or more transitions leaving.

Common Uses To model the workflow To reproduce the workflow of the software intensive system which will have to visualize, specify construct and document the business process To model the states of an object To represent the change in the state of an object in a transition

Problem Definition: Create a State Machine Diagram for the ATM system using UML. Approach: The following are the transitions in the system: 1. ATM system is in idle state. 2. Once the card is read, it is queried for PIN number. 3. The PIN number entered is validated. 4. If the PIN number is invalid or the card is not readable the session is aborted. 5. If the PIN number is valid, the amount for withdrawal is prompted. 6. The balance is checked. 7. If balance is less than the withdrawal amount, report failure and user acknowledges it thus ending the session. 8. If PIN number is valid, withdrawal is successful; receipt is printed thus ending the session. Conclusion: Thus we have studied and created state machine diagram for ATM system.

Diagram:

Practical 8
Aim:-To study and create Deployment Diagram. Theory:Deployment Diagram:A deployment diagram shows the allocation of processes to processes in the physical design of a system. A deployment diagram may represent all or part of the process architecture of a system. A deployment diagram shows processors, devices and circumstances. Each model contains a single deployment diagram, which shows the connections between its processors and devices, and the allocation of its processes to processors. Contents: Node Connections 1. Node: A node is physical element that exists at a run time and represents computational resource having at least some memory and often processing capability. Stereotypes used with node: A. Processor:A Processor Specification enables you to display and modify the properties and relationships of a processor in the current model. A processor is a hardware component capable of executing program. Naming:Each processor must have a name. There are no constraints on the processor name because processors denote hardware rather than software entities. B. Device:A device is a hardware component with no computing power. Each device must have a name. Device names can be generic, such as modem or terminal. The rational rose software provides two different notations for processor and device. 2. Connection:A connection represents some type of hardware coupling between two entities. An entity is either a processor or a device. The hardware coupling can be direct, such as an RS232 cable, or indirect, such as satellite-to-ground communication. Connections are usually bidirectional. Applications of the deployment diagram:1. To model the embedded system 2. To model the client server system. 3. To model the fully distributed system.

Graphical Representation: 1. Node:

<<Processor>> Or <<Device>>

By Rational rose software Processor

Device

Connection:The icon for a connection is a straight line.

Connection Node

Node

Problem Definition: Create a deployment diagram for ATM system. Approach: This diagram consists of the nodes as: BankATMSystem Receipt Printer Card Reader Log Device Cash Dispenser Display Keypad Network Interface ATM Network Server

The functioning of each node as follows: 1. BankATMSystem is the main node. This identifies the nodes that represent the clients and server processes. 2. Receipt Printer prints transaction summary. 3. Card Reader scans the card and provides user account data to the system. 4. Log Device maintains a log of all the activities. 5. Cash Dispenser dispenses the cash. 6. Display shows the transaction activity to the user. 7. Keypad allows the user to provide input. 8. Network Interface facilitates communication between BankATMSystem and ATM Network Server. 9. ATM Network Server represents a centralised datastore for all ATM systems of the bank.

Conclusion:Thus we have studied and created deployment diagram for ATM system.

Diagram:

Diagram:

You might also like