Uml Handbook

27
UML HANDBOOK 1. INTRO TO VISUAL PARADIGM Visual Paradigm for UML is a UML CASE Tool supporting UML 2.1 and the Business Process Modeling Notation (BPMN). In addition to UML modeling support, it provides business process modeling , an object- relational mapping generator for Java, .NET and PHP. There is a free Community Edition for non-commercial use (without generation of code and database tables). 1. Use Case Modeling: Use case diagram Use case diagram is designed for visualizing and documenting the behavior of a system. The main notations of use case diagram include System (subject), Use Case, Actor, , Dependency and Generalization. Use case diagram is usually used in modeling the context of a system and requirements of system. Use case diagram is used to specify what the system should do but not how the system should do. 2. Structural Modeling: Class Diagram: Class diagram is the most widely used diagram in modeling object- oriented system. A class diagram shows a set of classes, interfaces, associations and generalizations. Package is commonly used model element for organizing elements in class diagram. Object Diagram: Object diagram shows a snapshot of instances of things inclass diagrams . Similar to class diagrams , object diagrams show the static design of system but from the real or prototypical perspective. 3.Behavioral Modeling: Sequence diagram Sequence diagram shows interaction between users, systems and sub- systems, and emphasize the ordering of time of messages. Communication diagram

Transcript of Uml Handbook

Page 1: Uml Handbook

UML HANDBOOK

1. INTRO TO VISUAL PARADIGMVisual Paradigm for UML is a UML CASE Tool supporting UML 2.1 and the Business Process Modeling Notation (BPMN). In addition to UML modeling support, it provides business process modeling, an object-relational mapping generator for Java, .NET and PHP. There is a free Community Edition for non-commercial use (without generation of code and database tables).

1. Use Case Modeling:Use case diagramUse case diagram is designed for visualizing and documenting the behavior of a system. The main notations of use case diagram include System (subject), Use Case, Actor, , Dependency and Generalization. Use case diagram is usually used in modeling the context of a system and requirements of system. Use case diagram is used to specify what the system should do but not how the system should do.

2. Structural Modeling:Class Diagram: Class diagram is the most widely used diagram in modeling object-oriented system. A class diagram shows a set of classes, interfaces, associations and generalizations. Package is commonly used model element for organizing elements in class diagram.

Object Diagram:Object diagram shows a snapshot of instances of things inclass diagrams. Similar to class diagrams, object diagrams show the static design of system but from the real or prototypical perspective.

3.Behavioral Modeling:Sequence diagramSequence diagram shows interaction between users, systems and sub-systems, and emphasize the ordering of time of messages.

Communication diagramCommunication diagram shows similar information assequence diagram, but communication diagram emphasizes the structural organization of the objects' send and receive messages. Communication diagram is designed for illustrating the dynamic view of the system. 

Activity diagramActivity diagram is a flowchart-based diagram showing flow of control from activity to activity. Activity diagram shows concurrency, branch, control flow and object flow. Swimlane is useful for partitioning the activity states. Activity diagram is commonly used for elaborating use case in use case diagram.

Page 2: Uml Handbook

State machine diagramState machine diagram represents a state machine. State machine diagram shows flow of control from state to state within single object. Common state diagram contains simple states, composite states, composite states, transitions, events and actions.

Timing diagramTiming diagram shows time, event, space and signal for real-time and distributed system.

3. Architectural Modeling:Component diagramComponent diagram shows the physical aspect of an object-oriented software system. Component diagram illustrates the architectures of the software components and dependencies between them.Deployment diagramDeployment diagram shows the physical aspects of an object-oriented system. Deployment diagram shows the configuration of run time processing nodes and artifacts.

Package diagramPackage diagram shows the arrangement and organization of model elements in middle to large scale project. Package diagram can show both structure and dependencies between sub-systems or modules.

Steps to draw diagrams in visual paradigm:1. Open Visual Paradigm2. Select workspace (path to save projects) in workspace launcher.3. To select existing projects, select from recent projects.4. To open new project, Select File-> New Project5. Mention project name.6. To draw any diagram, select File-> New Diagram-> UML diagrams-> any UML

diagram.7. Draw the necessary diagrams with the help of tools given.8. Before exiting, close exiting project.

2. USE CASE DIAGRAMS

• It gives a static view of functions and their static relationships with one another and external entities.

Page 3: Uml Handbook

• Use Case model consists of:1. Actors2. Use Cases• The UML has following notations for use case diagram:1. Rectangle: It contains the use cases for a system with the actors listed

outside.2. Ellipse: The name of use case is written in ellipse.3. Stick Man: It denotes an actor with the name placed below.4. Solid Lines: They are used to connect use cases to actors.

Relationships among use cases:

The Uses Relationship: (include relationship)A uses relation from use case A to use case B indicates that an instance of the use case A will also include the behavior as specified by use case B.

• The extends relationship:• An extends relationship from use case A to use case B indicates that

an instance of use case B (base use case) may include the behavior of use case A. (extension)

• Generalization:• A parent use case represents a general behavior sequence. • Child use cases specialize the parent by refining requirements. • UML shows it by an arrow with its tail on child use case and triangular

head on parent use case.

Consider a vending machine. Consider the processes: 1. Buy a beverage: The vending machine 2. delivers a beverage after a customer selects and pays for it.3. Perform Scheduled Maintenance: The repair technician performs the

periodic service on the vending machine necessary to keep it in good working condition.

Page 4: Uml Handbook

4. Make repairs: The repair technician performs the unexpected service on the vending machine necessary to repair a problem in its operation.

5. Load Items: A stock clerk adds items into the vending machine to add its stock of beverages.

3. ACTIVITY DIAGRAMS• An activity diagram shows flow of control but focuses on operations rather

than objects.

• The activity diagram corresponds to many tasks like:

1. Modeling any business process like approve a document.

Page 5: Uml Handbook

2. Specifying the constraints among the use cases,

3. Flowcharting a use case.

An activity is modeled as a capsule with activity name inside

One activity may be followed by another activity (sequential), then split into several concurrent activities (a fork of control), and finally be combined into a single activity (a join of control).

A fork or merge is shown by a synchronization bar.

A synchronization bar is a heavy line with one or more input arrows and one or more output arrows.

The activity diagram can be divided into columns and lines. Each column is called a swimlane. The activity in a particular swimlane indicates that it is performed by a person.

The symbols used in activity diagram are shown as below:

Page 6: Uml Handbook
Page 7: Uml Handbook

4. CLASS & OBJECT DIAGRAM• An object is a concept or thing with identity which has a meaning for an

application.• An object is an instance or occurrence of a class.• A class describes a group of objects with the same properties(attributes) and

behavior (operations).• Class diagrams provide a graphics notation for modeling classes and their

relationships. • UML notation for a class:

Class with attributes

• A box represents classes and may have three compartments.• The compartments contain: classnames, list of attributes and list of

operations. • UML notation for an object:•

• Object diagrams show individual objects and their relationships.• Object diagrams are helpful for documenting test cases.

Object with attributes

Page 8: Uml Handbook

A link is a physical or conceptual connection among objects. An association is a description of a group of links with common structure. Multiplicity specifies the number of instances of one class which may relate to

a single instance of an associated class. The association can also have attributes. It is shown by association class. UML notation for association class is a box attached to association by

dashed line.

• Qualified Associations: It is an association in which an attribute called qualifier is used at the “many”

association end.• Multiplicity for an attribute specifies the number of possible values for each

instance of an attribute.• Common specifications are single value[1], an optional single value like[0..2]

and many [*].• Multiplicity specifies whether an attribute is mandatory or optional.

Page 9: Uml Handbook

Example for class diagram: A person may have multiple magazine subscriptions. A magazine has multiple subscribers. For each subscription, it is important to track the date and amount of each payment as well as the current expiration date. Draw the class diagram for above description.

Example for object diagram:

5. STATE-CHART DIAGRAM

Page 10: Uml Handbook

• A state transition diagram describes state-based behavior of a class. A state transition diagram consists of events, states, and transitions.

• Events:– State machines communicate by sending events to one another.

• States:– A state is an abstraction of an object’s state.– It represents particular values of object’s attributes and links.– An initial starting point and final ending point will be shown by a solid

circle and a bull’s eye.– To perform each state some time is allotted.– Activities are the behaviors which require non-negligible time. So they

must be executed within states.– Following types of actions can be taken within states:

• While entering into state e.g. initialization• Exit from the state e.g. display output• Process or call to another state machine e.g. do

• Transitions:– A transition is the movement of an object from one state to another.

A guard condition is a boolean expression which must be true for a transition to occur.Guidelines for State Diagram:1. Abstracting values into states: Consider only one relevant attribute to

define state.2. Parameters: The incidental data should be considered as parameters of

events. 3. Granularity of events and states: Consider the application needs when

deciding events and states.4. When to use state diagrams: Construct state diagrams only for classes

with meaningful temporal behavior. 5. Entry & Exit Activities: When a state has multiple incoming transitions and

all transitions cause the same activity to occur use an entry activity rather than showing transitions.

6. Guard Conditions: Be careful with guard condition so that an object does not become “stuck” in a state.

7. Race Conditions: Beware of unwanted race conditions in state diagram.

Example for state chart diagram:

The vending machine delivers a beverage after a customer selects and pays for it. The machine starts in the waiting state in which it displays the message “Enter coins”. When the customer inserts coins into the

Page 11: Uml Handbook

machine, the machine enters into “Ready” state. When the customer pushes the ok button, the machine goes in “Dispense” state. In this state, the machine dispenses the corresponding item. The machine goes in “Out of Stock” state if item is not loaded. Draw the state transition diagram for above description.

6. SEQUENCE DIAGRAMAn interaction diagram is a graphical representation of how objects interact with one another in a scenario.

Page 12: Uml Handbook

It describes only communication between objects. Internal behavior of object is not shown.In interaction diagram, objects communicate by sending messages.

UML provides two forms of interaction diagrams: Collaboration Diagram: Spatially oriented with importance on links between objects.Sequence Diagram: Temporally organized in the order in which messages are sent between objects.

The sequence diagram is drawn for objects. The dashed vertical lines are object lifelines. Each is headed by respective objects and represents the lifetime of object’s participation in this scenario.

The objects in diagram may have values for list of attributes. The solid headed arrows indicate messages sent and are labeled with the message and its data. The dashed stick headed arrows show return of control.When the value is returned, the return arrows may be labeled with return followed by values. Time progresses when sequence diagram moves down the page.The ordering of messages is specified by relative vertical positions of the messages in the diagram.In sequence diagram, iteration is shown by rectangle. The rectangle encloses the area to which iteration is applied. The bound of the iteration is included in the upper left corner of the rectangle.Conditional Messages:One object may send message to other object only if particular condition holds in sending object. The sender evaluates the condition and determines whether to send message based on result.

Branching:When the guarded condition has two or more values branching can be used in sequence diagram. To show different flow of control, object’s lifeline is divided in two parts. After branching, two lifelines are rejoined to show that two paths share same interaction.

Example for sequence diagram:The vending machine delivers a beverage after a customer selects and pays for it. The machine starts in the waiting state in which it displays the message “Enter coins”. When the customer inserts coins into the machine, the machine displays total value of money entered. The customer pushes a button. The machine dispenses a corresponding item and make change, if the cost of the item is less than the money inserted. If the cost of the item is

Page 13: Uml Handbook

greater than money inserted, the machine shows the message as “Insufficient money”. Draw the sequence diagram for above description.

7. COLLABORATION DIAGRAM

A collaboration diagram is spatially oriented an emphasis on the links between objects. It represents the messages in basic object diagram sent from one object to other. The solid-headed, simple shaded arrows indicate sending of messages and are labeled with message or method name. The lollypop arrows designate returns and are labeled with the return value.

Page 14: Uml Handbook

A message name may be followed by a list of values passed with the message.A number specifies relative sequencing of message names. Nested numbering is used to indicate nested calls. When an object is passing or returning a reference to another object, the name of other object is used. The label on return arrow shows a reference to the object which is being returned.

UML Practical Questions

Q.1 Consider the air transportation system. Many flights land and depart from city’s airport. Some of the big cities may have more than one airports. Every flight belongs to specific airline. The planes may have many flights to different airports. Each plane is identified with serial number and model. E.g. hypersonic. There are specific pilots for each airline and they fly many flights. Each flight is identified by

10

Page 15: Uml Handbook

flight number and date on which flight is scheduled. The passenger reserves a seat for a flight. The seat is identified by a location. Prepare a class diagram for above description.

Q.2 Prepare an object diagram for above description assuming your round trip in last month to London. Include at least one instance of each class. The flight was arranged on a hypersonic plane. A friend went with you but decided to stay there. Captain Johnson was your pilot on both flights. You had a different seat each way, but you noticed it was on the same plane.

15

Q.3 Consider a vending machine. Consider the processes: 6. Buy a beverage: The vending machine 7. delivers a beverage after a customer selects and pays for it.8. Perform Scheduled Maintenance: The repair technician

performs the periodic service on the vending machine necessary to keep it in good working condition.

9. Make repairs: The repair technician performs the unexpected service on the vending machine necessary to repair a problem in its operation.

10.Load Items: A stock clerk adds items into the vending machine to add its stock of beverages.

10

Q.4 The vending machine delivers a beverage after a customer selects and pays for it. The machine starts in the waiting state in which it displays the message “Enter coins”. When the customer inserts coins into the machine, the machine enters into “Ready” state. When the customer pushes the ok button, the machine goes in “Dispense” state. In this state, the machine dispenses the corresponding item. The machine goes in “Out of Stock” state if item is not loaded. Draw the state transition diagram for above description.

10

Q.5 The vending machine delivers a beverage after a customer selects and pays for it. The machine starts in the waiting state in which it displays the message “Enter coins”. When the customer inserts coins into the machine, the machine displays total value of money entered. The customer pushes a button. The machine dispenses a corresponding item and make change, if the cost of the item is less than the money inserted. If the cost of the item is greater than money inserted, the machine shows the message as “Insufficient money”. Draw the sequence diagram for above description.

15

Q.6 A person may have multiple magazine subscriptions. A magazine has multiple subscribers. For each subscription, it is important to track the date and amount of each payment as well as the current expiration date. Draw the class diagram for above description.

10

Q.7 A person may have multiple magazine subscriptions. A magazine has multiple subscribers. For each subscription, it is important to track the date and amount of each payment as well as the current expiration date. Draw the class diagram with association class for above description.

10

Q.8 Consider the free lancing of software development. The programmers use different programming languages to develop many projects. Assume the programmer Mr.X is involved in two

15

Page 16: Uml Handbook

projects accounting system and CAD program. Mr. X is using .NET as a programming language and C Programming for accounting system. Draw the class diagram and instance diagram for above description. (Hint: Use ternary association)

Q.9 Prepare a class diagram for a graphical document editor that supports grouping. Assume that a document consists of several sheets. Each sheet contains drawing objects, including text, geometrical objects and groups. A group is simply a set of drawing objects. A geometrical objects include circle, ellipse, rectangles, lines and squares.

15

Q.10 Prepare an activity diagram for computing a restaurant bill. There should be a charge for each delivered item. The total amount should be subject to tax and service charge of 18% for groups of six or more. Any coupons charge submitted by the customer is subtracted from bill.

10

Q.11 The following is the partial taxonomy of rotating electrical machines. Electrical machines may be categorized for analysis purposes into ac machines or dc machines. Some of the machines are synchronous motors, small induction motors, universal motors and permanent magnet motors.An ac machine may be synchronous or induction. Universal motors are used where high speed is needed such as blenders or vacuum cleaners. Permanent magnet motors are used in toys and will work only on dc. Prepare a class diagram showing how the categories and machines relate to each other. Use multiple inheritance where appropriate.

15

Q.12 Prepare a class diagram for UML concepts like class, attribute, association, association end, multiplicity, class name, attribute name.

10

Q.13 Consider the class for telephone line with following activities and states: As a start of a call, the telephone line is idle. When the phone receiver is picked from hook, it gives a dial tone and can accept the dialing of digits. If after getting dial tone, if the user doesn’t dial number within time interval then time out occurs and phone line gets idle. After dialing a number, if the number is invalid then some recorded message is played.Upon entry of a valid number, the phone system tries to connect a call & routes it to proper destination. If the called person answers the phone, the conversation can occur. When called person hangs up, the phone disconnects and goes to idle state. Draw the state transition diagram for above description of telephone line.

15

Q.14 Consider a simple digital watch which has a display and two buttons to set it, the A button and the B button. The watch has two modes of operation, display time mode, the watch displays hours and minutes, separated by a flashing colon.The set time mode has two submodes: set hours and set minutes. The A button selects modes. Each time it is pressed, the mode

15

Page 17: Uml Handbook

advances in sequence: display, set hours, set minutes, display etc.Within the submodes, the B button advances the hours or minutes once each time it is pressed. Buttons must be released before they can generate another event.Draw the state transition diagram for above described digital watch.

Q.15 Develop a class diagram for following description:The telephone agent uses an order registry and customer catalog to obtain access to an order & a customer respectively.The order registry uses an order number as a qualifier to select particular order instance. A customer catalog uses customer name and phone number as a qualifier to select particular customer.The attributes of an order are the order numbers and time when it is placed. The order consists of many items.An item has item_number, a quantity, unit price. It also has reference to catalog item which represents listing. When an order is cancelled or committed, it cancels or commits each of its items first.When an order’s total price method is invoked, the order calls the total price method of each of items and returns the sum.

15

Q.16 The telephone agent uses an order registry and customer catalog to obtain access to an order & a customer respectively.The order registry uses an order number as a qualifier to select particular order instance. A customer catalog uses customer name and phone number as a qualifier to select particular customer.The attributes of an order are the order numbers and time when it is placed. The order consists of many items.An item has item_number, a quantity, unit price. It also has reference to catalog item which represents listing. When an order is cancelled or committed, it cancels or commits each of its items first.When an order’s total price method is invoked, the order calls the total price method of each of items and returns the sum.The telephone agent wants to cancel the item with item number as I101 from order having order number O123. Show the messages in sequence diagram for cancellation of item.

15

Q.17 The telephone agent uses an order registry and customer catalog to obtain access to an order & a customer respectively.The order registry uses an order number as a qualifier to select particular order instance. A customer catalog uses customer name and phone number as a qualifier to select particular customer.The attributes of an order are the order numbers and time when it is placed. The order consists of many items.An item has item_number, a quantity, unit price. It also has reference to catalog item which represents listing. When an order is cancelled or committed, it cancels or commits each of its items first.When an order’s total price method is invoked, the order calls the total price method of each of items and returns the sum.The telephone agent wants to cancel the item with item number as I101 from order having order number O123. Show the messages in

15

Page 18: Uml Handbook

collaboration diagram for cancellation of item.Q.18 The telephone agent uses an order registry and customer catalog to

obtain access to an order & a customer respectively.The order registry uses an order number as a qualifier to select particular order instance. A customer catalog uses customer name and phone number as a qualifier to select particular customer.The attributes of an order are the order numbers and time when it is placed. The order consists of many items.An item has item_number, a quantity, unit price. It also has reference to catalog item which represents listing. When an order is cancelled or committed, it cancels or commits each of its items first.When an order’s total price method is invoked, the order calls the total price method of each of items and returns the sum.Prepare a use case diagram for above description.

10

Q.19 Develop a class diagram to track states of machines in a factory consisting of several machines. Each machine is in one of several states: running, idle, waiting, down for unscheduled maintenance, down for scheduled maintenance or off.A running machine is currently processing an order. An idle machine is available for processing but is currently without an order to process. The machine is in down state for scheduled or unscheduled maintenance. The operator is responsible to change the state.Each machine has maintenance schedule. Each schedule has a date of last maintenance and date of next scheduled maintenance.When the date of next maintenance arrives, the operator sends the machine down for scheduled maintenance.Each machine is connected to a failure monitor, which senses hardware failure in the machine. When the monitor senses a failure, it informs the machine. The machine changes to the unscheduled maintenance state.All changes of machine states must be entered in a log. Each entry in the log includes date and time of the state change, which machine changed state, the states from and to.

15

Q.20 Develop a state transition diagram to track states of machines in a factory consisting of several machines. Each machine is in one of several states: running, idle, waiting, down for unscheduled maintenance, down for scheduled maintenance or off.A running machine is currently processing an order. An idle machine is available for processing but is currently without an order to process. The machine is in down state for scheduled or unscheduled maintenance. The operator is responsible to change the state.Each machine has maintenance schedule. Each schedule has a date of last maintenance and date of next scheduled maintenance.When the date of next maintenance arrives, the operator sends the machine down for scheduled maintenance.Each machine is connected to a failure monitor, which senses hardware failure in the machine. When the monitor senses a failure, it informs the machine. The machine changes to the unscheduled maintenance state.

15

Page 19: Uml Handbook

All changes of machine states must be entered in a log. Each entry in the log includes date and time of the state change, which machine changed state, the states from and to.

Q.21 Develop a use case diagram to track states of machines in a factory consisting of several machines. Each machine is in one of several states: running, idle, waiting, down for unscheduled maintenance, down for scheduled maintenance or off.A running machine is currently processing an order. An idle machine is available for processing but is currently without an order to process. The machine is in down state for scheduled or unscheduled maintenance. The operator is responsible to change the state.Each machine has maintenance schedule. Each schedule has a date of last maintenance and date of next scheduled maintenance.When the date of next maintenance arrives, the operator sends the machine down for scheduled maintenance.Each machine is connected to a failure monitor, which senses hardware failure in the machine. When the monitor senses a failure, it informs the machine. The machine changes to the unscheduled maintenance state.All changes of machine states must be entered in a log. Each entry in the log includes date and time of the state change, which machine changed state, the states from and to.

10

Q.22 A person may have multiple magazine subscriptions. A magazine has multiple subscribers. For each subscription, it is important to track the date and amount of each payment as well as the current expiration date. Draw the class diagram for above description. Consider the person Mr.ABC who has subscribed for magazines Digit and Computer Express. Mr. ABC has subscribed for both in month of January for six months. Draw object diagram for above.

15

Q.23 A customer decides to upgrade her PC and purchase a DVD player. She begins by calling the sales department of PC vendor and they tell her to contact customer support. She than calls customer support and they put her on hold while talking to engineering. Finally, customer support tells the customer about several supported DVD options. The customer chooses a DVD and it is shipped by the mail department. The customer receives the DVD , installs it satisfactorily and then mails her payment to accounts department. Draw the activity diagram for above description.

10

Q.24 A customer decides to upgrade her PC and purchase a DVD player. She begins by calling the sales department of PC vendor and they tell her to contact customer support. She than calls customer support and they put her on hold while talking to engineering. Finally, customer support tells the customer about several supported DVD options. The customer chooses a DVD and it is shipped by the mail department. The customer receives the DVD , installs it satisfactorily and then mails her payment to accounts department. Draw the sequence diagram for above description.

15

Q.25 A customer decides to upgrade her PC and purchase a DVD player. She begins by calling the sales department of PC vendor and they tell her to contact customer support. She than calls customer

15

Page 20: Uml Handbook

support and they put her on hold while talking to engineering. Finally, customer support tells the customer about several supported DVD options. The customer chooses a DVD and it is shipped by the mail department. The customer receives the DVD , installs it satisfactorily and then mails her payment to accounts department. Draw the collaboration diagram for above description.

Q.27 The objective of the system is to automate all the activities of the canteen right from purchasing and to maintaining the kitchen. The system should maintain a detailed account of all provisions bought and food served at the canteen. Several inquiry facilities should also be provided to view expenses incurred, planned menus/cash payment. In short following are the list of facilities which should be provided with the system: list of items served with rates, daily menu preparation, daily transactions, availability of information on intranet for reports and inquiries, purchases and issues.Draw the use case diagram for above description.

10

Q.28 The objective of the system is to automate all the activities of the canteen right from purchasing and to maintaining the kitchen. The system should maintain a detailed account of all provisions bought and food served at the canteen. Several inquiry facilities should also be provided to view expenses incurred, planned menus/cash payment. In short following are the list of facilities which should be provided with the system: list of items served with rates, daily menu preparation, daily transactions, availability of information on intranet for reports and inquiries, purchases and issues.Draw the class diagram based on use case approach for above description.

15

Q.29 Consider a book store in a shopping mall. The customer selects the books from racks to purchase. Prepare a use case diagram for bookstore checkout system. The customer brings selected books to cashier. The cashier scans each item with checkout system to prepare an order. The cashier requests to customer for payment. The customer gives credit card to cashier. The verifier and checkout system scans the card. The verifier accepts the card and payment is accepted. Customer signs the credit card slip. The purchased books are handed over to customer.

10

Q.30 Consider a book store in a shopping mall. The customer selects the books from racks to purchase. Prepare a sequence diagram for bookstore checkout system. The customer brings selected books to cashier. The cashier scans each item with checkout system to prepare an order. The cashier requests to customer for payment. The customer gives credit card to cashier. The verifier and checkout system scans the card. The verifier accepts the card and payment is accepted. Customer signs the credit card slip. The purchased books are handed over to customer.

15

Q.31 Consider a book store in a shopping mall. The customer selects the books from racks to purchase. Prepare a collaboration diagram for bookstore checkout system. The customer brings selected books to cashier. The cashier scans each item with checkout system to prepare an order. The cashier requests to customer for payment.

15

Page 21: Uml Handbook

The customer gives credit card to cashier. The verifier and checkout system scans the card. The verifier accepts the card and payment is accepted. Customer signs the credit card slip. The purchased books are handed over to customer.

Viva Questions:

1. Who is the predecessor of UML?2. Explain object-oriented software engineering.3. Explain OO software development life cycle.4. Explain how unified process model supports OO software development life

cycle.5. Explain different views of UML.6. Explain use case diagram.7. Explain components of use case diagram.8. List the relationships which can be shown in use case diagram.9. Distinguish between uses and extends relationships.10.Explain activity diagram.11.Distinguish between activity diagram and use case diagram.12.List different joins which can be shown in activity diagram.13.Explain the use of convex and concave pentagons.14.Explain the use of Swimlanes in activity diagram.15.List components of class diagram.16.List components of object diagram.17.Explain how class diagram and object diagrams are related to each other.18.Define abstract and concrete classes.19.Define and distinguish between abstract class and concrete class.20.Define association class and explain when it is used.21.Distinguish between association class and ordinary class.22.Explain qualified association.23.Explain the purpose of generalization.24.Something about association end names.25.Define N-ary association. Atomic / nonatomic with examples.26.Define aggregation and properties of aggregation.27.Distinguish between association and aggregation.28.Define composition. distinguish between association and composition.29.Explain how class diagram provides static structural view of system.30.Define state transition diagram.31.For which type of classes STD is drawn?32.Define events and states.33.Explain the transition. Guard condition.34.Define state with types of activities.35.Explain stuck condition in STD. Solution?36.Explain race condition in STD. Solution?

Page 22: Uml Handbook

37.Explain composite state in STD. 38.Explain history state and composite state, parallel state.39.Categorize following relationships into generalization, aggregation,

composition or association:a. A country has a capital city.b. A file is an ordinary file or directory file.c. Files contain records.d. A polygon is composed of ordered set of points.e. A drawing object is text or a geometrical object .f. A person uses a computer language on a project.g. Classes may have several attributes.h. A route connects two cities.i.A students takes a course from a professor.