maharashtra state board of technical education … · subject code: 12260 model answer subject...

40
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC - 27001 - 2005 Certified) WINTER 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented Modelling & Design Page 1 of 40 Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in themodel answer scheme. 2) The model answer and the answer written by candidate may vary but the examiner may tryto assess the understanding level of the candidate. 3) MoreImportance should not be given to the language errors such as grammatical, spelling errors (Not applicable for subject English and Communication Skills). 4) While assessing figures, examiner may give credit for principal components indicated in thefigure. The figures drawn by candidate and model answer may vary. The examiner may give credit for anyequivalent figure drawn. 5) Credits may be given step wise for numerical problems. In some cases, the assumed constantvalues may vary and there may be some difference in the candidate‟s answers and model answer. 6) In case of some questions credit may be given by judgment on part of examiner of relevant answer based on candidate‟s understanding. 7) For programming language papers, credit may be given to any other program based on equivalentconcept. Marks 1. Attempt any FIVE of the following: 20 (a) Explain object modeling technology by Rumbaugh. (Correct explanationof OMT technique- 4 Marks) Ans: Rambaugh‟s Object modeling technique. TheObject ModelingTechnique (OMT)presented by James Rumbaugh and his Co-worker describes a method for the analysis, design and implementationofasystemusinganobject-orientedtechnique.OMTisfast,intuitiveapproach foridentifying andmodeling alltheobjectsmaking upasystem.OMTconsistsoffourphases, which can beperformed iteratively. Analysis, SystemDesign, Object Design,Implementation

Upload: others

Post on 11-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 1 of 40

Important Instructions to examiners:

1) The answers should be examined by key words and not as word-to-word as given in themodel

answer scheme.

2) The model answer and the answer written by candidate may vary but the examiner may tryto

assess the understanding level of the candidate.

3) MoreImportance should not be given to the language errors such as grammatical, spelling errors

(Not applicable for subject English and Communication Skills).

4) While assessing figures, examiner may give credit for principal components indicated in

thefigure. The figures drawn by candidate and model answer may vary. The examiner may give

credit for anyequivalent figure drawn.

5) Credits may be given step wise for numerical problems. In some cases, the assumed

constantvalues may vary and there may be some difference in the candidate‟s answers and model

answer.

6) In case of some questions credit may be given by judgment on part of examiner of relevant

answer based on candidate‟s understanding.

7) For programming language papers, credit may be given to any other program based on

equivalentconcept.

Marks

1. Attempt any FIVE of the following: 20

(a) Explain object modeling technology by Rumbaugh.

(Correct explanationof OMT technique- 4 Marks)

Ans: Rambaugh‟s Object modeling technique. TheObject ModelingTechnique (OMT)presented by

James Rumbaugh and his Co-worker describes a method for the analysis, design and

implementationofasystemusinganobject-orientedtechnique.OMTisfast,intuitiveapproach

foridentifying andmodeling alltheobjectsmaking upasystem.OMTconsistsoffourphases, which can

beperformed iteratively.

Analysis, SystemDesign, Object Design,Implementation

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 2 of 40

The results of this phase are reusable, extendible and robust code. OMT separates modeling into

three different parts:

OMT has proposed three main types of models:

Object model: The object model represents the static and most stable phenomena in the modeled

domain. Main concepts are classes and associations with attributes and operations. Aggregation

and generalization (with multiple inheritance) are predefined relationships.

Dynamic model: The dynamic model represents a state/transition view on the model. Main

concepts are states, transitions between states, and events to trigger transitions. Actions can be

modeled as occurring within states. Generalization and aggregation (concur-rency) are

predefined relationships.

Functional model: The functional model handles the process perspective of the model,

corresponding roughly to data flow diagrams. Main concepts are process, data store, data flow,

and actors.

OMT is a predecessor of the Unified Modeling Language (UML). Many OMT modeling elements

are common to UML.

(b) Explain Generalization and Inheritance in brief.

(Explanation with proper example - 2 Marks each)

Ans: Generalization (any four points)

Generalization is the relationship between a class, and it defines a hierarchy of abstraction in

which subclasses (one or more) inherit from one or moresuperclasses.

Generalization and inheritance are transitive across a subjective number oflevels in the

hierarchy. Generalization is an “is-a-kind of” relationship, for

Example, Saving Account is a kind of Account, PG student is kind of Student,etc.

The notation for generalization is a triangle connecting a super class to itssubclasses. The

super class is connected by a line to the top of the triangle.

The subclasses are connected by lines to a horizontal bar attached to the baseof the triangle.

Generalization is a very useful construct for both abstract modeling and implementation. You

can see in Figure 8, a generalization ofAccount class.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 3 of 40

Inheritance (any four points)

Inheritance is taken in the sense of code reuse within the object oriented development.

During modeling, we look at the resulting classes, and try to group similar classes together so

that code reuse can be enforced. Generalization,specialization, and inheritance have very

close association.

Generalization is used to refer to the relationship among classes, andinheritance is used for

sharing attributes and operations using thegeneralization relationship.

In respect of inheritance, generalization and specialization are two phases of acoin in the

sense that if a subclass is seen from a super class the subclass isseen as a specialized version

of super class and in, reverse, a super class lookslike general form of subclass.

During inheritance, a subclass may override a super class feature by definingthat feature with

the same name.

Now let us look at the diagram given in Figure. In this diagram, Circle,Triangle, and Square

classes are inherited from Shape class. This is a case ofsingle inheritance because here, one

class inherits from only one class.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 4 of 40

Multiple inheritances

(c ) Describe unified SDLC.

(Introduction - 1 Mark, Diagram with all phases names - 3 Marks)

Ans: The UML is largely process independent i.e. it is not any particular software development life

cycle. The 3 processes use case driven, architecture-centric and iterative/incremental process

which can be broken into phases in the SDLC: inception, elaboration, construction andtransition.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 5 of 40

(d) Describe the term:

(i) Metadata

(ii) Constraints

(iii) Candidate-key

(Metadata -1 Mark, Constraints – 1 Mark, Candidate key – 2 Marks)

Ans:

(i) Metadata

Metadata is data that describes other data .for example, the definition of a class is metadata.

Models are inherently metadata, since they describe the things being modeled. a relational

database management system use metadata. A person can define database tables for storing

information.

Patterns and individuals

Explanation of example:-Each car model has its own attributes and associations.Each car model

object also describes a set of physical cars owned by persons. Each car receives the common

attributes from car model but also own list of particular attributes such as serial number,color and

a list of options.

Car Model object as a pattern, a piece of metadata, that describes car objects.

(ii) Constraints

Constraints are commonly used for various elements on class diagrams to express

somecondition or restriction. UML specification does not restrict languages which could be

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 6 of 40

used to describe constraint. Constraint must be somehow evaluated to true by a correctdesign of

the system.

For a class attribute the constraint in curly braces may follow the attribute.

Bank accounts attribute constraints - non empty owner and positive balance

For a constraint that applies to a single element (such as a class or an association path),the

constraint string may be placed near the symbol for the element, preferably near thename, if

any.

(ii) Candidate-key

It is a minimal set of attributes that uniquely identifies an object or link. It means you

cannot discard an attribute from the candidate key and still distinguish all objects and

links. A class or association may have one or more candidate keys, each of which may have

different combinations and numbers of attributes. The object id is always a candidate key for a

class. One or more combinations of related objects are candidate keys for associations.

Notation: - A candidate key is delimited with braces in an object model.

Example:-

A many- to- many association requires both related objects to uniquely identify each link.

A one-to-many association has a single candidate key: the object on the many side.

A one-to-one association has two candidate keys: either of the objects.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 7 of 40

(e) Draw the use case diagram for Railway Reservation System.

(Any relevant diagram with proper notation - 4 Marks)

Ans:

(f) Explain state, event, action and activity with respect to statechart diagram.

(Explanation of each point with example or notation - 1 Mark each)

Ans: State: Represents the state of object at an instant of time.State represents a discrete,

continuous segment oftime wherein the object‟s behavior will be stable. The object will stay in a

state until it is stimulated tochange by an event. Denoted by a rectangle with rounded corners and

compartments. Changes in the system that occur background thread while the mainprocess is

running, are called sub states.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 8 of 40

Event:events are those which represent external response. An event is an instant in time that

may be significant tothe behavior of the objects in a class. Events can have associated arguments.

Notation: Events are written simply as text strings

Action: Actions is used to specify the functional(transformational / computational)

behavior of objects in aclass. An Action is the UML way to specify that some discrete

amount of work gets done as an object makes a transition. The work is expected to be a one-

shot computation

• Notation- Append “/action-name” to the “event[guard]” forevery transition that has an

action

Action states cannot be decomposed. Action states are atomic, meaning that events may occur,

but the work of an action state is not interrupted. The work of an action state as a special case of

an activity case of an activity state that cannot be further decomposed.

Activity: An Activity is the UML way to specify that somerelatively long-term amount of work

gets done while anobject is in a state. - The work is continuous and interruptible (it stopswhen

you exit the state)

Notation: - Compartmentalize the state- Include “do/activity-name” in the lower compartmentof

every state that has an activity.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 9 of 40

Activity state can be further decomposed, and their activity being represented by other activity

diagrams. Activity states are not atomic. An activity state as a composite, whose flow of control is

made up of other activity states and action states.

(g) Describe recursive aggregation with proper example.

(Correct diagram - 2 Marks, correct explanation - 2 Marks)

Ans:

Aggregation can be fixed, variable or recursive.A fixed aggregate has a fixed structure,

themember and types of subparts are predefined. A variable aggregate has a finite number of

levels,but the member of parts may vary. A recursive aggregate contains, directly or indirectly,

aninstance of the same kind of aggregate; the number of potential levels is limited. Fig.

aboveshows examples of a computer program. A program is an aggregation of blocks, with

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 10 of 40

optionallyrecursive compound statements the recursive terminates with simple statements. Blocks

can berested to arbitrary depth. In above figure a super class and 2subclasses, one of which is

anintermediate node of the aggregate and one of which is a terminal mode of the aggregate.

2. Attempt any FOUR of the following: 16

(a) Draw activity diagram for issuing book.

(Any relevant diagram with proper notation - 4 Marks)

Ans:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 11 of 40

(b) Draw class diagram for ATM system.

(Any relevant diagram with proper notation – 4 Marks)

Ans:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 12 of 40

(c ) Differentiate between Association and Aggregation.

(Any 4 differences - 4 Marks or 1 Mark each, Example - 1 Mark each)

Ans:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 13 of 40

(d) What is realization? Explain with example.

(Explanation – 2 Marks, Example –2 Marks)

Ans: It is a semantic relationship between classifiers, wherein one classifier classifies a contract that

another classifier guarantees to carry out. Realization relationships encounters in two places:

between interfaces and the classes or components that realize them and between use cases and the

collaborations that realize them. Graphically, a realization relationship is rendered as a cross

between generalization and a dependency relationship, as in figure below:

(e) Describe „Branching‟ in activity diagram.

(Explanation of branching – 2 Marks, Suitable diagram – 2 Marks)

Ans: Branching:

Branches are notational convenience, equivalent to multiple transitions with guards. A branch

may consist of one incoming transition and two or more outgoing transitions, you can place a

Boolean expression, which is evaluated only once on entering the branch. Across all these

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 14 of 40

outgoing transitions, guards should not overlap (otherwise, the flow of control would be

ambiguous), but they should cover all possibilities (otherwise the flow of control would freeze.)

You can use the keyword else to mark one outgoing transition, representing the path taken if no

other guard expression evaluates to true. You can achieve the effect of iteration by using one

action state that sets the value of an iteration, another action state that increment the iteration, and

a branch that evaluates of the iteration is finished.

(f) Define multiplicity with example.

(Accurate description of minimum 4 points – 2 Marks,Examples with accurate diagram -2

Marks)

Ans: Multiplicity

Multiplicity in an association specifies how many objects participate in arelationship. Multiplicity

decides the number of related objects. Multiplicity isgenerally explained as “one” or “many,” but

in general it is a subset of the nonnegativeintegers.

Indicator and Meaning

0..1 Zero or one

1 One only

0..* Zero or more

1..* One or more

n Only n (where n > 1)

0..n Zero to n (where n > 1)

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 15 of 40

1..n One to n where n > 1)

In associations, generally movement is in both the directions of the relationshipsbut if you want to

be specific in any particular direction, you have to mark it by anarrow as given in Figure

In associations, generally movement is in both the directions of the relationshipsbut if you want to

be specific in any particular direction, you have to mark it by anarrow as given in Figure

3. Attempt any FOUR of the following: 16

(a) Describe CRC card method by Cunningham.

(Description - 3 Marks, Format – 1 Mark)

Ans: Class Responsibility Collaborator (CRC) model (Beck & Cunningham 1989; Wilkinson

1995; Ambler 1995) is a collection of standard index cards that have been divided into three

sections, as depicted in Figure.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 16 of 40

A class represents a collection of similar objects. An object is a person, place, thing, event, or

concept that is relevant to the system at hand. The name of the class appears across the top of a

CRC card and is typically a singular noun or singular noun phrase, such as Student, Professor,

and Seminar

A responsibility is anything that a class knows or does. For example, students have names,

addresses, and phone numbers. These are the things a student knows. Students also enroll in

seminars, drop seminars, and request transcripts. These are the things a student does. The things a

class knows and does constitute its responsibilities. Important: A class is able to change the values

of the things it knows, but it is unable to change the values of what other classes know.

Collaboration takes one of two forms: A request for information or a request to do something.

For example, the card Student requests an indication from the card Seminar whether a space is

available, a request for information. Student then requests to be added to the Seminar, a request to

do something.

Example

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 17 of 40

(b) Define Rolename and Qualification with Example.

(Definition of role name -1 Mark, Definition of qualification – 1 Mark, Example each – 1

Mark)

Ans:

Role name: - A role is one end of an association. A binary association has two roles, each of

which may have a role name. A role name is a name that uniquely identifies one end of an

association. Roles provide a way of viewing a binary association as a traversal from one object to

a set of associated objects.

A role name is written next to the association line near the class that plays the role.

Example:-

Qualification: - Qualification specifies relation between two object classes and a qualifier. The

qualifier is a special attribute that reduces the effective multiplicity of an association. The

qualifier distinguishes among the set of objects at the many end of an association.

A qualifier is drawn as a small box on the end of the association line near the class it qualifies.

Example:-

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 18 of 40

(c ) mention the UML diagram used for OO analysis and OO design.

(Any four UML diagram for OO analysis -2 Marks, Any four UML diagram for OO design -2

Marks)

Ans:

UML diagram for OO analysis:-

Class Diagram

Object Diagram

Use case Diagram

Profile Diagram

Activity Diagram

Interaction Diagram

State chart Diagram

UML diagram for OO design

Class Diagram

Component Diagram

Composite Diagram

Deployment Diagram

Object Diagram

Package Diagram

(d) What are the packages? Describe its purpose.

(Description of Packages – 3 Marks, Example - 1 Mark)

Ans: Packages

A package is a general purpose mechanism for organizing elements into groups, structural things,

behavioural things and even other grouping things may be placed in a package

Unlike components (which exist at run time), a package is purely conceptual (meaning that it

exists only at development time).

When we visualize, model, document, construct and develop a number of classes, interfaces,

components, nodes diagrams and other elements it is easier to group them into a PACKAGE

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 19 of 40

A package is rendered as a tabbed folder - a rectangle with a small tab attached to the left side of

the top of the rectangle. If the members of the package are not shown inside the package

rectangle, then the name of the package should be placed inside.

Example:

(e) Describe Architectural Metamodel.

(Description - 2 Marks, Diagram – 2 Marks)

Ans: Architectural Meta model of UML: Visualizing, specifying, constructing, and documenting a

software-intensive system demands that the system be viewed from number of perspectives.

Design View: the design view of a system is structural view of the system. This view

primarily supports the functional requirements of the system. The design view of a system

includes the classes, interfaces and collaborations that from the vocabulary of the problem and its

solution. Class diagram and object diagram from the design view of the system.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 20 of 40

1. Process view: The dynamic behaviour of system can be seen using the process view. This

view primarily addresses the performance, scalability, and throughput of the system. The

different diagram such as the state diagram, activity diagram, sequence diagram, and

collaboration diagram are used in this view.

2. Implementation view: implementation view of system includes the components and files

that are used to assemble and release the physical system. The component diagram of UML

captures the implementation view.

3. Deployment view: the deployment diagram of UML is used to identify the deployment

modules for a given system. This view primarily addresses the distribution, delivery and

installation of the parts that construct the system.

4. Use case view: Use case diagram of UML describes the behaviours of the system as seen

by the end user, analysts and testers. Use case diagram captures the static view of the

system.

(f) Draw the sequence diagram for making a telephone call.

(Diagram with appropriate notation -4 Marks)

Ans:

Caller Phone Line Recipient or callee

Caller lift receiver

Dial tone begins

Dials (8)

Dial tone ends

Dials (1..8) (8-digit nos.)

ringing tone

answers phone

tone stops

phones connected

callee hangs up

connection broken

caller hangs up

phone rings

ringing stops

phones connected

connection broken

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 21 of 40

4. Attempt any FOUR of the following: 16

(a) Explain the principles of object orientation related to modeling.

(Each Principle - 1 Mark (any four))

Ans: Four principle of modeling:

1. “The choice of what models to create has a profound influence on how a problem is attacked

and how a solution is shaped”. This means choose your correct model as per the requirement of

problem statement. Wrong model will mislead you, causing to focus on irrelevant issues.

2. “Every model may be expressed at different levels of precision:” This means all the user and

developers both may visualize a system at different levels of details at different time.

3. “The best models are connected to reality”.

4. “No single model is sufficient. Every nontrivial system is best approached through a small set

of nearly independent models:” This means you need to have use case view; design view, process

view, implementation view and development view each of these view may have structural as well

as behavioural aspects. Together these views represent a system.

(b) Describe Abstract class and concrete class with diagram.

(Description – 1 Mark each, Diagram – 2 Marks)

Ans:

Definition

Abstract class: Classes that has no direct instances, but whose descendant classes have direct

instances are known as abstract class. Abstract classes are incompletely implemented i.e. the class

has interfaces without implementations.

Concrete class: It is a class that is instantiable means it can have direct instances. A concrete

class may have abstract subclasses. It can be a leaf class in the inheritance tree.

Example:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 22 of 40

(c) Describe various UML diagrams.

(Any Eight Diagrams each – ½ Mark)

Ans: Types of UML Diagrams:

UML defines nine types of diagrams: class (package), object, use case, sequence, collaboration,

state chart, activity, component, and deployment.

UML Diagrams used for OO analysis and OO design:

UML defines nine types of diagrams: class (package), object, use case, sequence, collaboration,

state chart, activity, component, and deployment.

Class Diagrams:

Class diagrams are the backbone of almost every object oriented method, including UML. They

describe the static structure of a system. It shows a set of classes, interfaces and collaboration and

their relationships.

Object Diagrams:

Object diagrams describe the static structure of a system at a particular time. It shows a set of

objects and their relationships. They can be used to test class diagrams for accuracy.

Use Case Diagrams:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 23 of 40

Use case diagrams model the functionality of system using actors and use cases and their

relationships.

Sequence Diagrams:

Sequence diagrams describe interactions among classes in terms of an exchange of messages over

time.

Collaboration Diagrams:

Collaboration diagrams represent interactions between objects as a series of sequenced messages.

Collaboration diagrams describe both the static structure and the dynamic behaviour of a system.

State chart Diagrams:

State chart diagrams describe the dynamic behaviour of a system in response to external stimuli.

It shows states, transitions, events and activities. State chart diagrams are especially useful in

modeling reactive objects whose states are triggered by specific events.

Activity Diagrams:

Activity diagrams illustrate the dynamic nature of a system by modeling the flow of control from

activity to activity. An activity represents an operation on some class in the system that results in

a change in the state of the system. Typically, activity diagrams are used to model workflow or

business processes and internal operation.

Component Diagrams:

Component diagrams shows the organizations and dependencies among a set of components.it

describe the organization of physical software components, including source code, run-time

(binary) code, and executables.

Deployment Diagrams:

A deployment diagram shows the configuration of run-time processing nodes and the components

that live on them. It depict the physical resources in a system, including nodes, components, and

connections.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 24 of 40

(d) Describe component diagram with example.

(Description - 2 Marks, Example - 2 Marks)

Ans:

A component diagram shows the organization and dependencies among a set of components.

One can use component diagrams to model the static implementation view of a system.

This involves modelling the physical things that reside on a node, such as executables,

libraries, tables, files, and documents. Component diagrams are essentially class diagrams that

focus on a system's components.

Component diagrams are not only important for visualizing, specifying, and documenting

component-based systems, but also for constructing executable systems through forward and

reverse engineering.

With the UML, one can use component diagrams to visualize the static aspect of these

physical components and their relationships and to specify their details for construction

A component diagramshows a set of components and their relationships.

Graphically, a component diagram is a collection of vertices and arcs.

Component diagrams commonly contain:-

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 25 of 40

1.Components

2. Interfaces

3. Dependency, generalization, association, and realization relationships

You use component diagrams to model the static implementation view of a system. This view

primarily supports the configuration management of a system's parts, made up of components

that can be assembled in various ways to produce a running system.

When you model the static implementation view of a system, you'll typically use component

diagrams in one of four ways.

1. To model source code

2. To model executable releases

3. To model physical databases

4. To model adaptable systems

One example of component diagram: - Any diagram can be considered.

(e) Define aggregation. What are the properties of aggregation?

(Definition – 2 Marks, Properties – 2 Marks)

Ans: Aggregation is a strong form of association in which an aggregate object is made of components.

Components are part of aggregate. Aggregation is the „part-whole‟ or a-part-of‟ relationship in

which objects representing the components of something are associated with an object

representing the entire assembly.

Properties:

Aggregation is the “Part-whole” or “a- part-of” relationship in which objects representing the

components.

An Aggregation is a specialized association.

Aggregation is tightly looped from of association with same extra semantics.

Example shows that a document consists of many sentences.

Aggregation is drawn like association, except a small diamond indicates the assembly end of

the relationship.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 26 of 40

Example:

(f) Draw collaboration diagram for stores management system.

(Diagram with appropriate notation - 4 Marks)

Ans:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 27 of 40

5. Attempt any FOUR of the following: 16

(a) Draw use case diagram for Hospital Management System.

(Any relevant use case diagram with proper notation - 4 Marks)

Ans:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 28 of 40

(b) Draw the interaction diagram for online shopping of books.

(Any relevant Interaction diagram (sequence/collaboration) with proper notation - 4 Marks)

Ans:

OR

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 29 of 40

(c ) Give relationship among object, dynamic and functional model.

(Correct explanation with min. 4 points – 4 Marks)

Ans: Relationships among object, dynamic, functional models

The object model represents the static, structural, 'data' aspects of a system;

The dynamic model represents the temporal, behavioural, 'control' aspects of a system;

The functional model represents the transformational, 'functional' aspects of a system.

The three kinds of models separate a system into orthogonal views; they all describe one aspect of

the system, but contain references to the other models.

The object model provides the data essential framework into which the dynamic and functional

models can be placed; it defines the data structure that the other models operate on. In the end the

three models come together in implementation, which involves data (object model), sequencing

(dynamic model) and operations (functional model).

Relationships between the three models are.

Object and dynamic model

The dynamic model specifies allowable sequences of changes to objects from the object model.

The states of the dynamic model can be related to classes of attribute and links values of an

object, events can be represented as operations on the object model.

The object model concepts of generalization, aggregation and inheritance also apply to the

dynamic model.

Object and functional model

All four components of the functional model can be related to the object model processes

The functional model shows the processes that have to be implemented in the methods of the

objects. The processes in the functional model show the objects that are related by function. Often

one in- or output is the target (client) of a process. The other inputs are the parameters (suppliers).

These client-supplier relationships establish implementation dependencies between the related

classes.

Dynamic and functional model

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 30 of 40

The relationship between these two models is that the dynamic model states when operations are

performed, and the functional model states how they are performed and which arguments are

needed. There is however a difference between operations on actors and operations on data stores.

Because actors are active objects, the dynamic model has to specify when it acts. The data stores

are passive objects, they only respond to updates and queries, therefore you do not have to specify

in the dynamic model when they act.

d) Draw component diagram for railway reservation system.

(Any relevant Component diagram with proper notation - 4 Marks)

Ans:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 31 of 40

(e) Who are the fathers of UML? What is OMG?

(Inventors/fathers of UML - 1 Mark, Explanation of OMG with min. 3 points – 3 Marks)

Ans: UML:

The Unified Modeling Language (UML) is a general-purpose modeling language in the field of

software engineering, which is designed to provide a standard way to visualize the design of a

system.

It was created and developed by Grady Booch, Ivar Jacobson and James Rumbaugh at

Rational Software during 1994–95 with further development led by them through 1996.

In 1997 it was adopted as a standard by the Object Management Group (OMG), and has

been managed by this organization ever since. In 2000 the Unified Modeling Language was

also accepted by the International Organization for Standardization (ISO) as an approved ISO

standard.

OMG:

The Object Management Group (OMG) is an international, open membership, not-for-profit

computer industry standards group.

OMG Task Forces develop enterprise integration standards for a wide range of technologies

and an even wider range of industries. OMG's modeling standards enable powerful visual

design, execution and maintenance of software and other processes.

OMG provides only specifications, and does not provide implementations. But before a

specification can be accepted as a standard by OMG, the members of the winning submitter team

must guarantee that they will bring a conforming product to market within a year. This is an

attempt to prevent unimplemented (and unimplementable) standards.

Example of OMG:

Common Object Request Broker Architecture (CORBA)

Data Distribution Service(DDSfor real-time systems)

Meta-Object Facility

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 32 of 40

(f) Compare sequence diagram and collaboration diagram.

(Min 4 points each points – 1 Mark)

Ans:

Sequence Diagram Collaboration Diagram

A sequence diagram is an interaction diagram

which emphasizes on the time ordering of

messages.

A collaboration Diagram is an interaction

diagram which emphasizes the structural

organization of the objects that send and

receive messages.

Sequence diagrams are alternate representations of

an interaction(Collaboration)

Collaboration diagrams are alternate

representation of an interaction(sequence)

Sequence diagram describe the interaction among

classes in terms of an exchange of message over

time.

Collaboration diagram describe the

interaction with numbered arrows which

shows the movement of messages during

the course of a scenario.

Sequence diagram shows the sequence of actions

that occurs in system

Collaboration diagram shows the objects

and their association with the other objects

the system.

The elements of sequence diagram are class roles,

activation, Message, lifeline, creating objects,

destroying objects and loops.

The elements of Collaboration diagram are

objects, Relation / Association, Message.

We can show simple branching in sequence

diagram

We can show more complex branching in

collaboration diagram.

This type of diagram is best used during early

analysis phases in design because they are simple

and easy to comprehend

This type of diagram is best used for

specific scenario.

Sequence diagrams are normally associated with

use cases

Collaboration diagram are normally with

sequence diagram

Any diagrammatic example explanation of

sequence

Any diagrammatic example of

collaboration diagram

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 33 of 40

6. Attempt any FOUR of the following: 16

(a) Define model. Why modeling is important?

(Definition - 1 Mark, Any three Importance - 3 Marks (1 Mark each))

Ans: Model:

Model is defined as a simplification of reality/blueprint of system/semantically close abstraction

of the system/ behavior, emphasizing the dynamic of the system.

The fundamental reason for building a model is to understand the system we are developing in a

better way.

Importance of Modeling:

1. Models help us to visualize a system as it is or as we want it to be.

2. Models permit us to specify the structure or behavior of a system.

3. Models give us a template that guides us in constructing a system.

4. Models document the decision we have made.

5. Models may be expressed at different levels of precision.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 34 of 40

(b) Draw class diagram for library management system.

(Any relevant Class diagram with proper notation - 4 Marks)

Ans:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 35 of 40

(c) Explain conceptual model of UML.

(Correct explanation with min. 4points – 4 Marks)

Ans: To understand the UML, it is needed to form a conceptual model of the language, and this

requires learning three major elements: the UML‟s basic building blocks, the rules that dictate

how those building locks may be put together, and some common mechanisms that apply

throughout the UML. Once the idea has been grasped, it is possible to read UML models and

create some basic ones. as more experience is gained in applying the UML, we can build on this

conceptual model, using more advanced features of the language.

UML 2.0 has 13 types of diagrams divided into three categories: Six diagram types represent

static application structure, three represent general types of behaviors, and four represent different

aspects of interactions. These diagrams can be categorized hierarchically as shown in the

following Class diagram:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 36 of 40

(d) Write note on statechart diagram.

(Correct explanation with min. 4points – 4 Marks)

Ans: State chartdiagram:

The name of the diagram itself clarifies the purpose of the diagram and other details. It describes

different states of a component in a system. The states are specific to a component/object of a

system.

A State chart diagram describes a state machine. Now to clarify it state machine can be defined as

a machine which defines different states of an object and these states are controlled by external or

internal events.

State chart diagram is one of the five UML diagrams used to model dynamic nature of a system.

They define different states of an object during its lifetime. And these states are changed by

events. So,State chart diagrams are useful to model reactive systems. Reactive systems can be

defined as a system that responds to external or internal events.

State chart diagram describes the flow of control from one state to another state. States are

defined as a condition in which an object exists and it changes when some event is triggered. So

the most important purpose of State chart diagram is to model life time of an object from creation

to termination.

State chart diagrams are also used for forward and reverse engineering of a system. But the

main purpose is to model reactive system.

Following are the main purposes of using State chart diagrams:

To model dynamic aspect of a system.

To model life time of a reactive system.

To describe different states of an object during its life time.

Define a state machine to model states of an object.

E.g of State chart Diagram:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 37 of 40

(e) Describe „Join and Fork‟ in activity diagram.

(Explanation of Join min. 2 points – 2 Marks, Explanation of Fork min. 2 points - 2 Marks)

Ans: Join and Fork:

Join:

A join may represent the synchronization of two or more concurrent flows of control. A join

can have two or more incoming transitions and one outgoing transition. Above the join, the

activities associated with each of these paths continue in parallel. At the join, the concurrent

flows synchronize, meaning that each waits until all incoming flow have reached the join, at

which point one flow of control continues below the join.

The notation for a join is a line segment with several activity edges entering it, and only one edge

leaving it.

Fork:

A fork can represent the splitting of a single flow of control into two or more concurrent

flows of control. A fork can have one incoming transition and two or more outgoing transitions,

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 38 of 40

each of which represents an independent flow of control. Below the fork, the activities associated

with each of these paths continue in parallel i.e. concurrently.

The notation for a fork is a line segment with a single activity edge entering it, and two or more

edges leaving it.

Joins and forks should always balance. It means that the number of flows that are going out from

a fork should match the number of flows that are coming into its corresponding join.

E.g. Join and Fork

Prepare for speech

Decompress

Gesture()

Synch mouth() Synch audio()

Clean up

join

fork

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 39 of 40

(f) Describe deployment diagrams, terms and concepts.

(Correct explanation with min. 4points – 4 Marks)

Ans: Deployment diagrams:

Deployment diagrams are used to visualize the topology of the physical components of a

system where the software components are deployed.

So deployment diagrams are used to describe the static deployment view of a system.

Deployment diagrams consist of nodes and their relationships.

The name Deployment itself describes the purpose of the diagram. Deployment diagrams are

used for describing the hardware components where software components are deployed.

Component diagrams and deployment diagrams are closely related.

So most of the UML diagrams are used to handle logical components but deployment diagrams

are made to focus on hardware topology of a system. Deployment diagrams are used by the

system engineers.

The purpose of deployment diagrams can be described as:

Visualize hardware topology of a system.

Describe the hardware components used to deploy software components.

Describe runtime processing nodes.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous)

(ISO/IEC - 27001 - 2005 Certified)

WINTER – 14 EXAMINATION Subject Code: 12260 Model Answer Subject Name: Object Oriented

Modelling & Design

Page 40 of 40

ATM

Server

(exe)

ATM

Client

(exe)

ATM

Client

(exe)

Regional

ATM

Server

Banking Database

server

Printer

<<LAN>>

<<Private Network>> <<Private Network>>