Vidyalankar. T.Y. Diploma : Sem. VI [IF/CM] Object Oriented Modeling and Design Prelim Question Paper Solution

Similar documents
Object Oriented Modeling and Design

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

INTRODUCING THE UML. Chapter 2

UNIT-I Introduction of Object Oriented Modeling

Introduction to UML Dr. Rajivkumar S. Mente

UNIT-II Introduction to UML

UNIT II. Syllabus. a. An Overview of the UML: Visualizing, Specifying, Constructing, Documenting

Allenhouse Institute of Technology (UPTU Code : 505) OOT Notes By Hammad Lari for B.Tech CSE V th Sem

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Chapter No. 2 Class modeling CO:-Sketch Class,object models using fundamental relationships Contents 2.1 Object and Class Concepts (12M) Objects,

A Conceptual Model of the UML

LABORATORY 1 REVISION

Introduction to UML. Danang Wahyu utomo

Basic Structural Modeling. Copyright Joey Paquet,

Interactions A link message

UNIT-4 Behavioral Diagrams

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER

CHAPTER 5 CO:-Sketch component diagram using basic notations 5.1 Component Diagram (4M) Sample Component Diagram 5.2 Deployment Diagram (8M)

Lab Manual. Object Oriented Analysis And Design. TE(Computer) VI semester

Vidyalankar. T.Y. Diploma : Sem. VI [IF/CM] Object Oriented Modeling and Design Prelim Question Paper

Lesson 11. W.C.Udwela Department of Mathematics & Computer Science

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models

UNIT 5 - UML STATE DIAGRAMS AND MODELING

Software Service Engineering

UML Tutorial. Unified Modeling Language UML Tutorial

Practical UML - A Hands-On Introduction for Developers

Introduction to Software Engineering. 5. Modeling Objects and Classes

Advanced Software Engineering

OO Techniques & UML Class Diagrams

Introducing the UML Eng. Mohammed T. Abo Alroos

Pertemuan 8. Object Oriented Modeling and Design

Practical UML : A Hands-On Introduction for Developers

Unified Modeling Language

History of object-oriented approaches

Chapter 2: Entity-Relationship Model

UNIT-IV BASIC BEHAVIORAL MODELING-I

Structured and Object Oriented Analysis and Design

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

Lecture Notes UML UNIT-II. Subject: OOAD Semester: 8TH Course No: CSE-802

Chapter 5: Structural Modeling

Introduction. Chapter 1. What Is Visual Modeling? The Triangle for Success. The Role of Notation. History of the UML. The Role of Process

SOFTWARE ENGINEERING UML FUNDAMENTALS. Saulius Ragaišis.

Credit where Credit is Due. Lecture 4: Fundamentals of Object Technology. Goals for this Lecture. Real-World Objects

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

UNIT I. 3. Write a short notes on process view of 4+1 architecture. 4. Why is object-oriented approach superior to procedural approach?

Object-Oriented Systems Analysis and Design Using UML

Class modelling (part 2)

Object-Oriented Systems Development: Using the Unified Modeling Language

Object Oriented Modeling

Object Oriented Design. Program Design. Analysis Phase. Part 2. Analysis Design Implementation. Functional Specification

UML- a Brief Look UML and the Process

administrivia today UML start design patterns Tuesday, September 28, 2010

CHAPTER 1. Topic: UML Overview. CHAPTER 1: Topic 1. Topic: UML Overview

Class modelling (part 2)

UNIT V *********************************************************************************************

Class Diagram. Classes consist of. Note that class diagrams contain only classes, not objects.

SRI VENKATESWARA COLLEGE OF ENGINERRING AND TECHNOLOGY THIRUPACHUR,THIRUVALLUR UNIT I OOAD PART A

What is a Class Diagram? A diagram that shows a set of classes, interfaces, and collaborations and their relationships

What is a Class Diagram? Class Diagram. Why do we need Class Diagram? Class - Notation. Class - Semantic 04/11/51

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

UML REFERENCE SHEETS. 2013, 2014 Michael Marking; all rights reserved, including moral rights. Web site:

Class Diagram. Classes consist of. Note that class diagrams contain only classes, not objects.

COSC 3351 Software Design. An Introduction to UML (I)

1. Introduction to Object Oriented Software Development

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico

Introduction to Software Engineering. 5. Modeling Objects and Classes

S T R U C T U R A L M O D E L I N G ( M O D E L I N G A S Y S T E M ' S L O G I C A L S T R U C T U R E U S I N G C L A S S E S A N D C L A S S D I A

Software Design Methodologies and Testing. (Subject Code: ) (Class: BE Computer Engineering) 2012 Pattern

SEEM4570 System Design and Implementation Lecture 11 UML

UML & OO FUNDAMENTALS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 3 08/30/2011

Object-Oriented and Classical Software Engineering

06. Analysis Modeling


Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

UML: Unified Modeling Language

COMN 1.1 Reference. Contents. COMN 1.1 Reference 1. Revision 1.1, by Theodore S. Hills, Copyright

Unit Wise Questions. Unit-1 Concepts

Software Engineering Lab Manual

Darshan Institute of Engineering & Technology for Diploma Studies

Today s Agenda UML. CompSci 280 S Introduction to Software Development. 1.Introduction UML Diagrams. Topics: Reading:

Interaction Modelling: Use Cases

INTRODUCTION TO UNIFIED MODELING MODEL (UML) & DFD. Slides by: Shree Jaswal

For 100% Result Oriented IGNOU Coaching and Project Training Call CPD TM : ,

Introduction to Software Engineering. ECSE-321 Unit 9 Architectural Design Approaches

Enterprise Architect. User Guide Series. UML Models. Author: Sparx Systems. Date: 30/06/2017. Version: 1.0 CREATED WITH

Chapter 2: Entity-Relationship Model. Entity Sets. Entity Sets customer and loan. Attributes. Relationship Sets. A database can be modeled as:

OO Analysis and Design with UML 2 and UP

Chapter 7: Entity-Relationship Model

Experiment no 4 Study of Class Diagram in Rational Rose

Oral Questions. Unit-1 Concepts. Oral Question/Assignment/Gate Question with Answer

Ans 1-j)True, these diagrams show a set of classes, interfaces and collaborations and their relationships.

12 Tutorial on UML. TIMe TIMe Electronic Textbook

SEEM4570 System Design and Implementation. Lecture 10 UML

LECTURE NOTES ON OBJECT ORIENTED ANALYSIS AND DESIGN PATTERNS. III B. Tech II Semester (R-16) Ms. N Shalini. Assistant Professor

UML diagrams. Software artifacts include: SRS, SDS, test cases, source code, technical/user manual, software architecture, etc.

Object-Oriented Software Engineering Practical Software Development using UML and Java

OBJECT ORIENTED MODELLING & DESIGN 1

Course 3 7 March

Transcription:

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] 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] 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. 0415/TY/Pre_Pap/2015/CP/Comp/OOMD_Soln 1

: T.Y. Diploma OOMD Fig. 4: Interfaces Q.1(a) (iii)explain swim lane activity diagram with example. [4] 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] 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. 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. 2

Prelim Question Paper Solution Q.1(b) Attempt any ONE of the following [6] Q.1(b) (i) Draw activity diagram for vending machine. [6] Fig. 1 : Activity diagram for issuing book to member. 3

: T.Y. Diploma OOMD Fig.2 : Activity diagram for returning book. 4 Fig. 3 : Activity diagram for vending machine.

Prelim Question Paper Solution Fig.4 : Activity diagram for lift control system. Q.1(b) (ii) Draw a sequence diagram for landline calling. [6] 5

: T.Y. Diploma OOMD Q.2 Attempt any FOUR of the following : [16] Q.2(a) Draw class diagram for library management system. [4] Q.2(b) Explain concept of concurrency in activity diagram. [4] 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] 6

Prelim Question Paper Solution Q.2(d) Draw use case diagram for Hospital management system. [4] Q.2(e) Explain the concept of generalization and inheritance with example. [4] 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] Deployment A deployment is the allocation of an artifact or artifact instance to a deployment target. 7

: T.Y. Diploma OOMD Q.3 Attempt any FOUR of the following : [16] Q.3(a) Draw sequence diagram for library Management system. [4] Q.3(b) Draw a state chart diagram for ATM machine. [4] 8

Prelim Question Paper Solution Q.3(c) Draw object diagram for online shopping. [4] Q.3(d) Explain SDLC in UML. [4] 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 9

: T.Y. Diploma OOMD 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] 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] 10

Prelim Question Paper Solution Q.4(a) (ii) Draw component diagram for online shopping. [4] Q.4(a) (iii)explain the concept of ports and connectors in component diagram. [4] 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 11

: T.Y. Diploma OOMD 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] 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 }. 12

Prelim Question Paper Solution 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. 13

: T.Y. Diploma OOMD Q.4(b) Attempt any ONE of the following : [6] Q.4(b) (i) Explain orthogonal State diagram. [6] Q.4(b) (ii) Draw state diagram for online movie reservation system. [6] 14

Prelim Question Paper Solution 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 [8] hotel management system. Q.5(b) Draw non orthogonal State diagram for ATM system. [8] 15

: T.Y. Diploma OOMD Q.5(c) Explain conceptual model of UML. [8] 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. Fig. 2 : Things in UML 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: 16

Prelim Question Paper Solution (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. Fig. 3 : Class (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. Fig. 4: Interfaces (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. 17

: T.Y. Diploma OOMD Fig. 5 : Collaborations (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. Fig. 6 : Use cases (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. Fig. 7 : Active Classes (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. 8: Components 18

Prelim Question Paper Solution (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. Fig. 9 : Artifacts (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. Fig. 10 : Nodes (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. 11 : Messages 19

: T.Y. Diploma OOMD (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. Fig.12 : States (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. Fig. 13 : Actions (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 20

Prelim Question Paper Solution (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. Fig. 15 : Notes 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. Fig.16 : Dependency (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. 21

: T.Y. Diploma OOMD Fig. 17 : Dependency (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. Fig.18 : Generalization (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. 22 Fig. : 19

Prelim Question Paper Solution (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. Fig. 20 (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. Fig. 21 (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. 22 23

: T.Y. Diploma OOMD 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] 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. 24

Prelim Question Paper Solution 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) Fig. 1 : OMT Models Q.6(b) What do you mean by artifacts in deployment diagram? [4] 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. 9 : Artifacts 25

: T.Y. Diploma OOMD Q.6(c) Draw class diagram for bank system [4] Q.6(d) Draw component diagram for airline reservation system [4] 26

Prelim Question Paper Solution Q.6(e) Draw swim lane activity diagram for setting exam paper. [4] 27