MCS-032 - Complete Solved Assignment PDF

Title MCS-032 - Complete Solved Assignment
Author Gaurav Singh
Course Object Oriented Analysis and Design
Institution Indira Gandhi National Open University
Pages 14
File Size 647.2 KB
File Type PDF
Total Downloads 6
Total Views 140

Summary

Complete Solved Assignment...


Description

IGNOU MCS-032 Solved Assignment Session 2019-20

Q1. What is OOAD? Explain concepts of objects and class with the help of examples and diagrams. Ans. Object-oriented analysis and design (OOAD) is a popular technical approach for analyzing and designing an application, system, or business by applying objectoriented programming, as well as using visual modeling throughout the development life cycles to foster better stakeholder communication and product quality. OOAD in modern software engineering is typically conducted in an iterative and incremental way. The outputs of OOAD activities are analysis models (for OOA) and design models (for OOD) respectively. The intention is for these to be continuously refined and evolved, driven by key factors like risks and business values

Object and Class The concepts of objects and classes are intrinsically linked with each other and form the foundation of object–oriented paradigm. Object An object is a real-world element in an object–oriented environment that may have a physical or a conceptual existence. Each object has − •

Identity that distinguishes it from other objects in the system.



State that determines the characteristic properties of an object as well as the values of the properties that the object holds.



Behavior that represents externally visible activities performed by an object in terms of changes in its state.

Objects can be modelled according to the needs of the application. An object may have a physical existence, like a customer, a car, etc.; or an intangible conceptual existence, like a project, a process, etc. Class A class represents a collection of objects having same characteristic properties that exhibit common behavior. It gives the blueprint or description of the objects that can be created from it. Creation of an object as a member of a class is called instantiation. Thus, object is an instance of a class. The constituents of a class are − •

A set of attributes for the objects that are to be instantiated from the class. Generally, different objects of a class have some difference in the values of the attributes. Attributes are often referred as class data.



A set of operations that portray the behavior of the objects of the class. Operations are also referred as functions or methods. GAURAV S

1

Example Let us consider a simple class, Circle, that represents the geometrical figure circle in a two–dimensional space. The attributes of this class can be identified as follows − • • •

x–coord, to denote x–coordinate of the center y–coord, to denote y–coordinate of the center a, to denote the radius of the circle

Some of its operations can be defined as follows −



findArea(), method to calculate area findCircumference(), method to calculate circumference



scale(), method to increase or decrease the radius



During instantiation, values are assigned for at least some of the attributes. If we create an object my_circle, we can assign values like x-coord : 2, y-coord : 3, and a : 4 to depict its state. Now, if the operation scale() is performed on my_circle with a scaling factor of 2, the value of the variable a will become 8. This operation brings a change in the state of my_circle, i.e., the object has exhibited certain behavior.

Q2. What is message passing? Explain links and associations with the help of examples and diagrams. Ans. Any application requires a number of objects interacting in a harmonious manner. Objects in a system may communicate with each other using message passing. Suppose a system has two objects: obj1 and obj2. The object obj1 sends a message to object obj2, if obj1 wants obj2 to execute one of its methods. The features of message passing are −



Message passing between two objects is generally unidirectional. Message passing enables all interactions between objects.



Message passing essentially involves invoking class methods.



GAURAV S

2

Objects in different processes can be involved in message passing. Links and Association •

Link A link represents a connection through which an object collaborates with other objects. Rumbaugh has defined it as “a physical or conceptual connection between objects”. Through a link, one object may invoke the methods or navigate through another object. A link depicts the relationship between two or more objects. The link can be explained by the example such as students studying in university or universities in which there would be several numbers of students studying in one or more than one universities which can be represented by the below-given diagram.

Association Association is a group of links having common structure and common behavior. Association depicts the relationship between objects of one or more classes. A link can be defined as an instance of an association. As the class describes the potential objects, in the similar fashion an association represents a group of possible links.

GAURAV S

3

Degree of an Association Degree of an association denotes the number of classes involved in a connection. Degree may be unary, binary, or ternary. •

A unary relationship connects objects of the same class.



A binary relationship connects objects of two classes.



A ternary relationship connects objects of three or more classes.

Cardinality Ratios of Associations Cardinality of a binary association denotes the number of instances participating in an association. There are three types of cardinality ratios, namely − •

One–to–One − A single object of class A is associated with a single object of class B.



One–to–Many − A single object of class A is associated with many objects of class B.



Many–to–Many − An object of class A may be associated with many objects of class B and conversely an object of class B may be associated with many objects of class A.

Q3. What are activities in Object Oriented Analysis? Critically explain challenges in Object Identification. Also explain concept of objects identity and persistent objects. Ans. In the system analysis or object-oriented analysis phase of software development, the system requirements are determined, the classes are identified and the relationships among classes are identified. The three analysis techniques that are used in conjunction with each other for objectoriented analysis are object modelling, dynamic modelling, and functional modelling. Object Modelling Object modelling develops the static structure of the software system in terms of objects. It identifies the objects, the classes into which the objects can be grouped into and the relationships between the objects. It also identifies the main attributes and operations that characterize each class. The process of object modelling can be visualized in the following steps − GAURAV S

4

• • • • •

Identify objects and group into classes Identify the relationships among classes Create user object model diagram Define user object attributes Define the operations that should be performed on the classes  Review glossary

Dynamic Modelling After the static behavior of the system is analyzed, its behavior with respect to time and external changes needs to be examined. This is the purpose of dynamic modelling. Dynamic Modelling can be defined as “a way of describing how an individual object responds to events, either internal events triggered by other objects, or external events triggered by the outside world”. The process of dynamic modelling can be visualized in the following steps − • • • • •

Identify states of each object Identify events and analyze the applicability of actions Construct dynamic model diagram, comprising of state transition diagrams Express each state in terms of object attributes Validate the state–transition diagrams drawn

Functional Modelling Functional Modelling is the final component of object-oriented analysis. The functional model shows the processes that are performed within an object and how the data changes as it moves between methods. It specifies the meaning of the operations of object modelling and the actions of dynamic modelling. The functional model corresponds to the data flow diagram of traditional structured analysis. The process of functional modelling can be visualized in the following steps − • • • • •

Identify all the inputs and outputs Construct data flow diagrams showing functional dependencies State the purpose of each function Identify constraints Specify optimization criteria

Following are several challenges that are faced by an object identification in realworld applications: Occlusion: Objects like dogs or cats can be hidden behind one another, as a result, the features that can be extracted from them are not strong enough to say that they are an object. GAURAV S

5

Viewpoint changes: In cases of different viewpoints of an object, the shape may change drastically and hence the features of the object will also change drastically. This causes a detector which is trained to see a given object from one viewpoint to fail on seeing it from other viewpoints. Object identity is a fundamental object orientation concept. With object identity, objects can contain or refer to other objects. Identity is a property of an object that distinguishes the object from all other objects in the application. There are many techniques for identifying objects in programming languages, databases and operating systems. According to the authors the most commonly used technique for identifying objects is user- defined names for objects. There are of course practical limitations to the use of variable names without the support of object identity. To identify an object with a unique key (also called identifier keys) is a method that is commonly used in database management systems. Using identifier keys for object identity confuses identity and data values. According to the authors there are three main problems with this approach: 1. Modifying identifier keys. Identifier keys cannot be allowed to change, even though they are user- defined descriptive data. 2. Non-uniformity. The main source of non-uniformity is that identifier keys in different tables have different types or different combinations of attributes. And more serious problem is that the attribute(s) to use for an identifier key may need to change. 3. "Unnatural" joins. The use of identifier keys causes joins to be used in retrievals instead of simpler and more direct object retrievals. A persistent object is an object that has been assigned a storage location in a federated database. When you commit the transaction in which you create a persistent object, that object's data is saved in the database; the object can then be accessed by other processes. A persistent object continues to exist beyond the duration of the process that creates it. In contrast, a transient object exists only within the memory of the process that creates it; when that process terminates, the transient object ceases to exist.

GAURAV S

6

Q4. Draw a sequence diagram for online transmission of video lecture from a Studio. Make necessary assumptions. Ans.

Q5. What is UML? Briefly explain different types of UML diagrams. Explain advantages of using UML . Ans. The Unified Modeling Language (UML) is a general-purpose, developmental, modeling language in the field of software engineering that is intended to provide a standard way to visualize the design of a system. GAURAV S

7

The creation of UML was originally motivated by the desire to standardize the disparate notational systems and approaches to software design. It was developed by Grady Booch, Ivar Jacobson and James Rumbaugh at Rational Software in 1994–1995, with further development led by them through 1996. Types of UML Diagrams The current UML standards call for 13 different types of diagrams: class, activity, object, use case, sequence, package, state, component, communication, composite structure, interaction overview, timing, and deployment. These diagrams are organized into two distinct groups: structural diagrams and behavioral or interaction diagrams. Structural UML diagrams 1. Class diagram: Class diagrams are the backbone of almost every objectoriented method, including UML. They describe the static structure of a system. 2. Package diagram: Package diagrams are a subset of class diagrams, but developers sometimes treat them as a separate technique. Package diagrams organize elements of a system into related groups to minimize dependencies between packages. 3. Object Diagram: Object diagrams describe the static structure of a system at a particular time. They can be used to test class diagrams for accuracy. 4. Component Diagram: Component diagrams describe the organization of physical software components, including source code, run-time (binary) code, and executables. 5. Composite Structure Diagram: Composite structure diagrams show the internal part of a class. 6. Deployment Diagram: Deployment diagrams depict the physical resources in a system, including nodes, components, and connections. Behavioral UML diagrams 1. Activity diagram: 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. 2. Sequence diagram: Sequence diagrams describe interactions among classes in terms of an exchange of messages over time. 3. Use case diagram: Use case diagrams model the functionality of a system using actors and use cases. 4. State diagram: State chart diagrams, now known as state machine diagrams and state diagrams describe the dynamic behaviour of a system in response to external stimuli. State diagrams are especially useful in modelling reactive objects whose states are triggered by specific events. 5. Communication diagram: Communication diagrams model the interactions between objects in sequence. They describe both the static structure and the GAURAV S

8

dynamic behaviour of a system. In many ways, a communication diagram is a simplified version of a collaboration diagram introduced in UML 2.0. 6. Interaction overview diagram: Interaction overview diagrams are a combination of activity and sequence diagrams. They model a sequence of actions and let you deconstruct more complex interactions into manageable occurrences. You should use the same notation on interaction overview diagrams that you would see on an activity diagram. 7. Timing diagram: A timing diagram is a type of behavioural or interaction UML diagram that focuses on processes that take place during a specific period of time. They're a special instance of a sequence diagram, except time is shown to increase from left to right instead of top down. Advantages of UML 1. 2. 3. 4. 5.

Provides standard for software development. Reducing of costs to develop diagrams of UML using supporting tools. Development time is reduced. The past faced issues by the developers are no longer exists. Has large visual elements to construct and easy to follow.

GAURAV S

9

GAURAV S

10

Q6. Draw class diagram for Online admission system in Graduation Programmes of an Open University, which offer admission to the students on the basis of merit list created using marks obtained at 10+2 level. Make necessary assumptions. Ans.

GAURAV

1 H 0

Q7. Draw a DFD for Online Banking System. Make necessary assumptions required. Ans.

GAURAV

1 H 1

Q8. What is state diagram? Draw state diagram for online Train Ticket Booking. Make necessary assumptions required. Ans. Statechart diagram is one of the five UML diagrams used to model the dynamic nature of a system. They define different states of an object during its lifetime and these states are changed by events. Statechart diagrams are useful to model the reactive systems. Reactive systems can be defined as a system that responds to external or internal events. Statechart 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. The most important purpose of Statechart diagram is to model lifetime of an object from creation to termination. A state diagram is used to represent the condition of the system or part of the system at finite instances of time. It’s a behavioral diagram and it represents the behavior using finite state transitions. State diagrams are also referred to as State machines and State-chart Diagrams. These terms are often used interchangeably. So simply, a state diagram is used to model the dynamic behavior of a class in response to time and changing external stimuli. We can say that each and every class has a state but we don’t model every class using State diagrams. We prefer to model the states with three or more states. Uses of statechart diagram –

GAURAV

1 H 2

• • •

We use it to state the events responsible for change in state (we do not show what processes cause those events). We use it to model the dynamic behavior of the system . To understand the reaction of objects/classes to internal or external stimuli.

GAURAV

1 H 3...


Similar Free PDFs