Prelim Question Paper Solution Attempt any THREE...

27
0415/TY/Pre_Pap/2015/CP/Comp/OOMD_Soln 1 Vidyalankar T.Y. Diploma : Sem. VI [IF/CM] Object Oriented Modeling and Design Prelim Question Paper Solution Q.1(a) Attempt any THREE of the following [12] Q.1(a) (i) What is modeling? Also state its four features. [4] (A) Importance of Modeling Modeling is a proven and well accepted engineering technique. We build architectural model of houses and high rises to help their users visualize the final product. We may even build mathematical models to analyze the effects of wind or earthquakes on our building. Modeling is not just the part of the building industry. Modeling would be unbelievable to deploy a new aircraft or an automobile without first building models from computer models to physical wind tunnel models full scale prototypes. A model is a simplification of reality. A model provides the blueprints of the system. Models may encompass detail plans as well as more general plans. A good model includes those elements that have broad effect and omits those minor elements that are not relevant to the given level of abstraction. Every system may be described from different aspects using different models and each model is therefore semantically closed abstraction of the system. A model may be structural, emphasizing the organization of the system or it may be behavioral, emphasizing the dynamics of the system. We built models so that we can better understand the system we are developing through modeling, we achieve four aims : 1. Models help us to visualize the 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. Model gives us a template that guides us in constructing a system. 4. Models document the decision we have made. We build models of complex system because we cannot understand such a system in its whole. Q.1(a) (ii) Explain concept of interface in component diagram. [4] (A) Interface : An interface is a collection of operations that specifies a service of a class or component. An interface therefore describes the externally visible behavior of that element. In interface might represent the complete behavior of a class or component or only a part of that behavior. An interface defines a set of operation specification (that is, their sing), but never set of operation implementation. The declaration of an interface looks like a class with the keyword <<interface>> above the name; attributes are not relevant, except sometimes to show constant. An interface provided by a class to the outside world is shown as a small circle attached to the class box by a line. An interface required by a class from some other class is shown as a small semicircle attached to the class box by a line, as in Figure 4. Vidyalankar

Transcript of Prelim Question Paper Solution Attempt any THREE...

Page 1: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

0415/TY/Pre_Pap/2015/CP/Comp/OOMD_Soln 1

Vidyalankar T.Y. Diploma : Sem. VI [IF/CM]

Object Oriented Modeling and Design Prelim Question Paper Solution

Q.1(a) Attempt any THREE of the following [12]Q.1(a) (i) What is modeling? Also state its four features. [4](A) Importance of Modeling

Modeling is a proven and well accepted engineering technique. We build architectural model of houses and high rises to help their users visualize the final product. We may even build mathematical models to analyze the effects of wind or earthquakes on our building.

Modeling is not just the part of the building industry. Modeling would be unbelievable to deploy a new aircraft or an automobile without

first building models from computer models to physical wind tunnel models full scale prototypes.

A model is a simplification of reality. A model provides the blueprints of the system. Models may encompass detail plans as well as more general plans.

A good model includes those elements that have broad effect and omits those minor elements that are not relevant to the given level of abstraction.

Every system may be described from different aspects using different models and each model is therefore semantically closed abstraction of the system.

A model may be structural, emphasizing the organization of the system or it may be behavioral, emphasizing the dynamics of the system.

We built models so that we can better understand the system we are developing through modeling, we achieve four aims :

1. Models help us to visualize the 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. Model gives us a template that guides us in constructing a system. 4. Models document the decision we have made. We build models of complex system because we cannot understand such a system in

its whole. Q.1(a) (ii) Explain concept of interface in component diagram. [4](A) Interface :

An interface is a collection of operations that specifies a service of a class or component.

An interface therefore describes the externally visible behavior of that element. In interface might represent the complete behavior of a class or component or only a

part of that behavior. An interface defines a set of operation specification (that is, their sing), but never set

of operation implementation. The declaration of an interface looks like a class with the keyword <<interface>>

above the name; attributes are not relevant, except sometimes to show constant. An interface provided by a class to the outside world is shown as a small circle

attached to the class box by a line. An interface required by a class from some other class is shown as a small semicircle

attached to the class box by a line, as in Figure 4.

Vidyala

nkar

Page 2: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Vidyalankar : T.Y. Diploma OOMD

2

Q.1(a) (iii)Explain swim lane activity diagram with example. [4](A) Swimlane :

We use partitions to show which participant is responsible for which actions. Partitions divide the diagram into columns or rows (depending on the orientation of your activity diagram) and contain actions that are carried out by a responsible group. The columns or rows are sometimes referred to as swimlanes.

Q.1(a) (iv) Define multiplicity and qualification of class diagram. [4](A) Multiplicity :

It is the active logical association when the cardinality of a class in relation to another is being depicted.

It is also called as cardinality. For example, one fleet may include multiple airplanes, while

one commercial airplane may contain zero to many passengers. The notation 0..* in the diagram means "zero to many", (See Figure 22).

Qualified Association The qualifier is a special attribute that reduced the effective multiplicity of an

association. A qualified association is the UML equivalent of a programming concept variously

known as associative arrays, maps and dictionaries. Figure shows a way of representing the association between the Order and Order Line

classes that uses a qualifier. The qualifier says that in connection with an Order, there may be one Order Line for

each instance of Product.

Fig. 4: Interfaces

Fig. 22 Vidyala

nkar

Page 3: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Prelim Question Paper Solution

3

Q.1(b) Attempt any ONE of the following [6]Q.1(b) (i) Draw activity diagram for vending machine. [6](A)

Fig. 1 : Activity diagram for issuing book to member.

Vidyala

nkar

Page 4: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Vidyalankar : T.Y. Diploma OOMD

4

Fig.2 : Activity diagram for returning book.

Fig. 3 : Activity diagram for vending machine.

Vidyala

nkar

Page 5: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Prelim Question Paper Solution

5

Fig.4 : Activity diagram for lift control system.

Q.1(b) (ii) Draw a sequence diagram for landline calling. [6](A)

Vidyala

nkar

Page 6: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Vidyalankar : T.Y. Diploma OOMD

6

Q.2 Attempt any FOUR of the following : [16]Q.2(a) Draw class diagram for library management system. [4](A)

Q.2(b) Explain concept of concurrency in activity diagram. [4](A) Concurrency

It is used to show the parallel or concurrent actions. Steps that occur at the same time are said to occur concurrently or in parallel. Fork has single incoming flow and multiple outing flows.

Q.2(c) Draw deployment diagram for ATM. [4](A)

Vidyala

nkar

Page 7: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Prelim Question Paper Solution

7

Q.2(d) Draw use case diagram for Hospital management system. [4](A)

Q.2(e) Explain the concept of generalization and inheritance with example. [4](A) Generalization

Generalization is an association between the more general classifier and the more special classifier. Inheritance

Inheritance is a relationship when a child object or class assumes all properties of his parent object or class.

Q.2(f) Draw and explain notation of deployment diagram. [4](A) Deployment

A deployment is the allocation of an artifact or artifact instance to a deployment target.

Vidyala

nkar

Page 8: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Vidyalankar : T.Y. Diploma OOMD

8

Q.3 Attempt any FOUR of the following : [16]Q.3(a) Draw sequence diagram for library Management system. [4](A)

Q.3(b) Draw a state chart diagram for ATM machine. [4](A)

Vidyala

nkar

Page 9: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Prelim Question Paper Solution

9

Q.3(c) Draw object diagram for online shopping. [4](A)

Q.3(d) Explain SDLC in UML. [4](A) Inception is the first phase of the process, when the seed idea for the development is

brought up to the point of being at least internally sufficiently well-founded to warrant entering into the elaboration phase. Elaboration is the second phase of the process, when the product requirements and architecture are defined. In this phase, the requirements are articulated, prioritized, and baselined. A system's requirements may range from general vision statements to precise evaluation criteria, each specifying particular functional or nonfunctional behavior and each providing a basis for testing. Construction is the third phase of the process, when the software is brought from an executable architectural baseline to being ready to be transitioned to the user community. Here also, the system's requirements and especially its evaluation criteria are constantly reexamined against the business needs of the project, and resources are allocated as appropriate to actively attack risks to the project. Transition is the fourth phase of the process, when the software is delivered to the user community. Rarely does the software development process end here, for even during this phase, the system is continuously improved, bugs are eradicated, and features that didn't make an earlier release are added.

One element that distinguishes this process and that cuts across all four phases is an iteration. An iteration is a distinct set of work tasks, with a baselined plan and evaluation criteria that results in an executable system that can be run, tested, and evaluated. The executable system need not be released externally. Because the iteration yields an executable product, progress can be judged and risks can be reevaluated after each iteration. This

Vidyala

nkar

Page 10: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Vidyalankar : T.Y. Diploma OOMD

10

means that the software development life cycle can be characterized as involving a continuous stream of executable releases of the system's architecture with a midcourse correction after each iteration to mitigate potential risk. It is this emphasis on architecture as an important artifact that drives the UML to focus on modeling the different views of a system's architecture.

Q.3(e) Explain include and extend in use case with example. [4](A) Aggregation

Aggregation is an association with the relation between the whole and its parts, the relation when one class is a certain entity that includes the other entities as components.

Q.4(a) Attempt any THREE of the following : [12]Q.4(a) (i) Draw activity diagram for online railway reservation system. [4](A)

Vidyala

nkar

Page 11: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Prelim Question Paper Solution

11

Q.4(a) (ii) Draw component diagram for online shopping. [4](A)

Q.4(a) (iii)Explain the concept of ports and connectors in component diagram. [4](A) Specifies a distinct interaction point

Between that component and its environment Between that component and its internal parts Is shown as a small square symbol Ports can be named, and the name is placed near the square symbol Is associated with the interfaces that specify the nature of the interactions that may occur over a port

• Ports can support unidirectional communication or bi-directional communication

Vidyala

nkar

Page 12: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Vidyalankar : T.Y. Diploma OOMD

12

If there are multiple interfaces associated with a port, these interfaces may be listed with the interface icon, separated by a commas

• All interactions of a component with its environment are achieved through a port • The internals are fully isolated from the environment • This allows such a component to be used in any context that satisfies the constraints

specified by its ports • Ports are not defined in UML 1.x

Q.4(a) (iv) Discuss Role name, Constraint, Ordering. [4](A) Role Names :

Role names for an association

A role is one end of association. A role name is a name written at one end of association. Figure shows role names for an association. A person assumes the role of employee

with respect to a company and a company assumes the role of employer with respect to a person.

A role name is written next to the association line near the class that plays the role. Some points regarding role names:

1. Role names are necessary for association between two objects of the same class. 2. It is useful to distinguish between two associations of same air of classes. 3. All role names on the far end of associations attached to the class must be unique. 4. It is really a derived attribute of the source class. So it should be unique. 5. No role name should be same as an attribute name of the source class. 6. Role name do not represent derived attributes of the participating classes.

Constraints A constraint is a condition that every implementation of the design must satisfy.

Constraints can be placed on any kind of model element. A UML constraint is a restriction or condition on a UML element. They are written in curly braces { }. For example: { size >= 0 }.

Vidyala

nkar

Page 13: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Prelim Question Paper Solution

13

Constraints on Objects Constraints are functional relationships between entities of an object model. The term entity includes objects, classes, attributes, links and associations. A

constraint restricts the values that entities can assume. A constraint is a rule for a model element. For example, no employee's salary can exceed the salary of the employee’s boss

(a constraints between two things at the same time). No window will have an aspect ratio (length/width) of less than 0.8 or greater than 1.5 (a constraint between properties of a single object). The priority of a job may not increase (constraint on the same object overtime).

Figure explains these examples. Simple constraints may be placed in object models. Complex constraints should be specified in the functional model.

Constraints on Object

Constraints should be expressed in a declarative manner. Usually, constraints should be converted to procedural form before they can be stated in a programming language.

Ideally the conversion should be automatic which can be difficult or impossible to achieve. Object model capture some constraints through their very structure. For example, single inheritance implies that subclasses are mutually exclusive.

Constraints provide one of the criterion for measuring the quality of an object model. A good object model captures many constraints through its structure. If often requires

several iterations to get the structure of a model right from the prospective of constraints.

To accomplish more and more structural constraints, object modeling notation must be accompanied with all kinds of special constructs. There will always be constraints that must be expressed in natural languages.

Constraints are delimited by braes and positioned near the constrained entity. A dotted line connect multiple constrained entities.

An arrow may be used to connect a constrained entity to the entity it depends on Instantiation is a kind of constraints and therefore uses the same notation.

Ordering : Ordering is a special kind of facility available in OMD, Usually, the object on the 'many' side of (Side) an association have no external order. It can be considered as a set. Sometimes, the objects are externally ordered. Such kind

of externally ordered objects are denoted by writing (ordered) on the “many” end of an association i.e. next to the multiplicity dot for the role.

Role names for an association

Figure shows example of ordering. The windows are externally ordered, so only topmost window is visible at any point on the screen.

Vidyala

nkar

Page 14: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Vidyalankar : T.Y. Diploma OOMD

14

Q.4(b) Attempt any ONE of the following : [6]Q.4(b) (i) Explain orthogonal State diagram. [6](A)

Q.4(b) (ii) Draw state diagram for online movie reservation system. [6](A)

Vidyala

nkar

Page 15: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Prelim Question Paper Solution

15

Q.5 Attempt any TWO of the following : [16]Q.5(a) What is primary and secondary actors in use case? Draw a usecase diagram for

hotel management system. [8]

(A)

Q.5(b) Draw non orthogonal State diagram for ATM system. [8](A)

Vidyala

nkar

Page 16: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Vidyalankar : T.Y. Diploma OOMD

16

Q.5(c) Explain conceptual model of UML. [8](A) Conceptual Model of UML

To understand conceptual model of UML first we need to clarify What is a conceptual model? and Why a conceptual model is at all required?

A conceptual model can be defined as "a model which is made of concepts and their relationships".

A conceptual model is the first step before drawing a UML diagram. It helps to understand the entities in the real world and how they interact with each other.

To understand the UML, you need to form a conceptual model of the language and this requires learning three major elements:

1. The UML's basic building blocks, 2. The rules that dictate how those building blocks may be put together and 3. Some common mechanisms that apply throughout the UML

1. Building Blocks of the UML : The vocabulary of the UML encompasses three kinds of building blocks: (i) Things, (ii) Relationships, and (iii) Diagrams.

Things are the abstractions that are first class citizens in a model; relationships tie these things together; diagrams group interesting collections of things.

Things in the UML : Things are the basic elements in a model in OO.

In UML, there are four kind of things i.e. Structural things, Behavioural things, Grouping things and Annotational things as shown in Figure 2.

These things are the basic objects oriented buildings blocks of the UML. You use them to write well formed models.

(a) Structural Things: Structural things represent a conceptual or physical element. These things are nouns of UML models. Structural things are the static parts of model. Some structural things are listed below:

Fig. 2 : Things in UML Vidyala

nkar

Page 17: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Prelim Question Paper Solution

17

(i) Class : A class is a description of a set of object that shares the same attributes,

operation, relationship and semantics. A class implements one or more interfaces. Graphically, a class is represented with rectangle. The rectangle includes

name, attributes and operations as shown in Figure 3.

(ii) Interface : An interface is a collection of operations that specifies a service of a class or

component. An interface therefore describes the externally visible behavior of that

element. In interface might represent the complete behavior of a class or component or

only a part of that behavior. An interface defines a set of operation specification (that is, their sing), but

never set of operation implementation. The declaration of an interface looks like a class with the keyword

<<interface>> above the name; attributes are not relevant, except sometimes to show constant.

An interface provided by a class to the outside world is shown as a small circle attached to the class box by a line.

An interface required by a class from some other class is shown as a small semicircle attached to the class box by a line, as in Figure 4.

(iii) Collaboration : Collaboration defines an interaction and is a society of roles and other

elements that work together to provide some cooperative behavior that's bigger than the sum of all the elements.

Collaboration has structural, as well as behavioral, dimensions. A given class or object might participate in several collaboration. Graphically, collaborations are rendered as an ellipse with dashed lines,

sometimes including only its name, as shown in Figure 5.

Fig. 4: Interfaces

Fig. 3 : Class

Vidyala

nkar

Page 18: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Vidyalankar : T.Y. Diploma OOMD

18

Fig. 7 : Active Classes

(iv) Use Case : A use case is a description of sequences of action that a system performs that

yield observable results of value to a particular actor. A use case is used to structure the behavioral things in a model. A use case is

realized by collaboration. Graphically, a use case is rendered as an ellipse with solid lines, usually

including only its name, as shown in figure 6.

(v) Active Class : An active class is a class whose objects own one or more processes or threads

and therefore, can initiate control activity. An active classes just like a class except that its objects represent elements

whose behavior is concurrent with other elements. Graphically, it is represented as class only along with dark lines as shown in

Figure 7.

(vi) Component : A component is a modular part of the system design that hides its

implementation behind a set of external interfaces. Within a system, component sharing the same interfaces can be substituted

while preserving the same logical behavior. The implementation of a component can be expressed by wiring together parts

and connectors. The parts can include smaller components. Graphically, a component is shown at the upper right corner as shown in

Figure 8.

Fig. 5 : Collaborations

Fig. 6 : Use cases

Fig. 8: Components

Vidyala

nkar

Page 19: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Prelim Question Paper Solution

19

(vii) Artifacts : The artifacts represent physical things, whereas the previous five things

represent conceptual or logical things. An artifact is a physical and replaceable part of a system that contains

physical information. In a system, you will encounter different kinds of deployment artifacts, such as

source code files, executables, script etc. An artifact typically represents the physical packaging of source or run-time

information. Graphically, an artifact is as a rectangle with the keywords <<artifact>> above

the name is shown in Figure 9.

(viii) Node : A node is a physical element that exists at run time and represents a

computational resource, generally having at least some memory and often, processing capability.

A set of component may reside on a node and may also migrate from node to node.

Graphically, a node is shown as a cube, usually including only its name, as in Figure 10.

(b) Behavioral Things: Behavioral things are the dynamic parts of UML models. These are the verbs of a model, representing behavior over time and space. In all, there are three kinds of behavioral things as given below :

(i) Messages :

First an interaction is a behavior that comprises a set of messages exchanged among a set of object of roles within a particular context to accomplish a specific purpose.

An interaction involves a number of other elements, including messages, actions and connectors.

Graphically, a message is rendered a directed line, almost always including the name of its operation, as in Figure 11.

Fig. 10 : Nodes

Fig. 11 : Messages

Fig. 9 : Artifacts

Vidyala

nkar

Page 20: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Vidyalankar : T.Y. Diploma OOMD

20

(ii) State: It is a behavior that specific the sequences of state an object or an interaction

goes through during its lifetime in response it events, together with its responses to those events.

The behavior of an individual class or a collaboration of classes may be specified with a state machine.

A state machine involves a number of other elements, including states, transition.

Graphically, a state is rendered as a rounded rectangle, usually including its name shown in figure 12.

(iii) Activity: It is a behavior that specifies the sequences of steps a computational process

perform. In an interaction, the focus is on the set of objects that interact. In a state

machine, the focus is on the life cycle of one object at a time. In an activity, the focus is on the flows among steps without regard to which

object performs each step. A step of an activity is called an action. Graphically, an action is rendered as a rounded rectangle with a name

indicating its purpose. States and actions are distinguished by their different contexts.

(c) Grouping Things: Grouping things are the organizational parts of UML models. These are the boxes

into which a model can be decomposed. There is one primary kind of grouping thing namely, packages.

(i) Package : A Package is a general purpose mechanism for organizing the design itself, as

opposed to classes, which organize implementation constructs. Structural things, behavioral things and even other grouping things may be

placed in a package. A package is purely conceptual. Graphically, a package is rendered as a tabbed folder, usually including only

its name and sometimes, its contents, as in Figure 14.

Fig. 14 : Packages

Fig.12 : States

Fig. 13 : Actions

Vidyala

nkar

Page 21: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Prelim Question Paper Solution

21

(d) Annotational Things: Annotational things are the explanatory parts of UML models. There is one

primary kind of annotational thing, called a note. (i) Note :

A note is simply a symbol for rendering constrains and comments attached to an element or a collection of elements.

Graphically, a note is rendered as a rectangle with a dog eared corner, together with textual or graphical comments, as in Figure 15.

2. Relationships in the UML : Relationship is another most important building block of UML. Relationship shows how elements are associated with each other and this

association (linked) describes the functionality of an application. In short, a relationship is a connection among things. There are four kinds of relationships in the UML, i.e., Dependency, Association,

Generalization and Realization.

These relationships are explained below: (i) Dependency :

Dependency is a semantic relationship. Dependency is a relationship between two things in which change in one element also affects the other one.

Dependency states that a change in specification of one thing (independent thing) may effect another thing (depending thing) that uses it, but not the reverse.

Graphically, dependency relationship is represented with a dashed line with an arrow.

For example, in the Figure 16, the FlimClip class is depending on the channel class. The dependency relationship is shown using the dashed or dotted line starting from FilmClip class and ending in the Channel class with an arrow pointing to it.

(ii) Association: Association is a structural relationship that describes a set of links, and a link

is connection between objects. Association relationship is used when we want to show structural relationship. Association is basically a set of links that connects elements of an UML

model. It also describes how many objects are taking part in that relationship. Graphically, association is represented as a solid line, (See Figure 17). For example, Figure 17 shows linking of Airplane and passenger.

Fig. 15 : Notes

Fig.16 : DependencyVidyala

nkar

Page 22: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Vidyalankar : T.Y. Diploma OOMD

22

(iii) Generalization: A generalization is a relationship between a general thing i.e. super class or

parent class and a specific thing i.e. sub-class or child class. It is similar to the concept of inheritance in OOP's. Generalization can be defined as "a relationship which connects a specialized

element with a generalized element." It basically describes inheritance relationship in the world of objects. It is known as an "is a" relationship since the child class is a type of the parent

class. Generalization is the ideal type of relationship that is used to showcase

reusable elements in the class diagram. Literally, the child classes "inherit" the common functionality defined in the parent class.

Graphically, generalization relationship is shown as a solid line with a hollow arrowhead pointing towards parent as shown in Figure 18.

(iv) Realization : It is a semantic relationship between classifiers, wherein one classifier

specifies a contract that another classifier guarantees to carry out. Realization can be defined as "a relationship in which two elements are

connected". One element describes some responsibility which is not implemented and the

other one implements them. This relationship exists in case of interfaces. Graphically, a realization relationship is rendered as a cross between a

generalization and a dependency relationship, as in Figure 19. In the Figure 19, printing preferences that are set using the printer setup

interface are being implemented by the printer.

Fig. 17 : Dependency

Fig.18 : Generalization

Fig. : 19

Vidyala

nkar

Page 23: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Prelim Question Paper Solution

23

Fig. 22

(v) Aggregation : It refers to the formation of a particular class as a result of one class being

aggregated or built as a collection. For example, the class “library” is made up of one or more books, among

other materials. In aggregation, the contained classes are not strongly dependent on the life

cycle of the container. In the same example of figure 20, books will remain so even when the library

is dissolved. To render aggregation graphically in a diagram, draw a line from the parent

class to the child class with a diamond shape near the parent class.

(vi) Composition: It is very similar to the aggregation relationship, with the only difference

being its key purpose of emphasizing the dependence of the contained class to the life cycle of the container class.

That is, the contained class will be obliterated when the container class is destroyed. For example, a shoulder bag's side pocket will also cease to exist once the shoulder bag is destroyed.

To depict a composition relationship in a UML diagram, use a directional line connecting the two classes, with a filled diamond shape (See Figure 21), adjacent to the container class and the directional arrow to the contained class.

(vii) Multiplicity :

It is the active logical association when the cardinality of a class in relation to another is being depicted.

It is also called as cardinality. For example, one fleet may include multiple

airplanes, while one commercial airplane may contain zero to many passengers. The notation 0..* in the diagram means "zero to many", (See Figure 22).

Fig. 20

Fig. 21 Vidyala

nkar

Page 24: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Vidyalankar : T.Y. Diploma OOMD

24

3. Diagrams in the UML : A diagram is the graphical presentation of a set of elements, most often rendered

as a connected graph of vertices (things) and arcs (relationships). A diagram is a projection into a system. UML diagrams are the ultimate output of the entire discussion of above topics.

All the elements, relationships are used to make a complete UML diagram and the diagram represents a system.

There are three classification of UML diagrams : (i) Behavior Diagrams: A type of diagram that depicts behavioral features of a

system or business process. These diagrams shows what should happen in a system. They describe how the objects interact with each other to create a functioning system. This diagrams includes activity, state machine, and use case diagrams as well as the four interaction diagrams.

(ii) Interaction Diagrams: A subset of behavior diagrams which emphasize object interactions. This diagrams includes communication, interaction overview, sequence and timing diagrams.

(iii)Structure Diagrams: A type of diagram that depicts the elements of a specification that are irrespective of time. These diagram shows the things in a system being model. This diagrams includes class, composite structure, component, deployment, object, and package diagrams.

The UML includes nine such diagrams:

1. Class Diagram : A structural diagram that shows a set of classes, interfaces, collaborations and their relationships.

2. Object Diagram : A structural diagram that shows a set of objects and their relationships.

3. Use case Diagram : A behavioral diagram that shows a set of use cases and actors and their relationships.

4. Sequence Diagram : A behavioral diagram that shows an interaction, emphasizing the time ordering of messages.

5. Collaboration Diagram : A behavioral diagram that shows an interaction, emphasizing the structural organization of the objects that send and receive messages.

6. State Chart Diagram : A behavioral diagram that shows a state machine, emphasizing the event ordered behavior of an object.

7. Activity Diagram : A behavioral diagram that shows a state machine, emphasizing the flow from activity to activity.

8. Component Diagram : A structural diagram that shows a set of components and their relationships.

Q.6 Attempt any FOUR of the following : [16]Q.6(a) Discuss in brief OMT by Rambaugh [4](A) Brief Overview of OMT by Rumbaugh

OMT describes a method for the analysis, design and implementation of a system using an object-oriented technique.

OMT was developed as an approach to software development. A fundamental assumption of OMT is that object-oriented thinking represents a more

natural and intuitive way for people to reason about reality.

Vidyala

nkar

Page 25: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Prelim Question Paper Solution

25

OMT is also a widely popular and comprehensive approach that exemplifies the vast number of object-oriented approaches to modeling.

The purposes of modeling according to Rumbaugh are : 1. Testing physical entities before building them (simulation) 2. Communication with customers, 3. Visualization, (alternative presentation of information) and 4. Reduction of complexity.

As a general modeling approach, OMT may be used to model all types of work. OMT proposes three main types of models i.e., Object model, Dynamic model, and

functional model, (see figure 1) Q.6(b) What do you mean by artifacts in deployment diagram? [4](A) Artifacts :

The artifacts represent physical things, whereas the previous five things represent conceptual or logical things.

An artifact is a physical and replaceable part of a system that contains physical information.

In a system, you will encounter different kinds of deployment artifacts, such as source code files, executables, script etc.

An artifact typically represents the physical packaging of source or run-time information.

Graphically, an artifact is as a rectangle with the keywords <<artifact>> above the name is shown in Figure 9.

Fig. 1 : OMT Models

Fig. 9 : Artifacts

Vidyala

nkar

Page 26: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Vidyalankar : T.Y. Diploma OOMD

26

Q.6(c) Draw class diagram for bank system [4](A)

Q.6(d) Draw component diagram for airline reservation system [4](A)

Vidyala

nkar

Page 27: Prelim Question Paper Solution Attempt any THREE …vidyalankar.org/file/diploma/Classroom_semVI/CMPN/OOMD...Fig. 1 : Activity diagram for issuing book to member. Vidyalankar Vidyalankar

Prelim Question Paper Solution

27

Q.6(e) Draw swim lane activity diagram for setting exam paper. [4](A)

Vidyala

nkar