MCS-032 Solved Assignment
MCS-032 Solved Assignment
Qst1. What is OOAD? Explain advantages of OOAD over structured analysis and design of system.
Ans: OOAD- OOAD is stand for Object oriented analysis design is basically a bottom up approach which
supports viewing the system as a set of components (objects) that can be logically kept together to form the
system.
Unified Modeling Language (UML) is a well accepted language for OOAD. It is used for visualizing,
specifying, constructing, and in final documentation. The basic building blocks of UML used for OOAD are
things, relationships, and diagrams. Basically, the Unified Modeling Language focuses on the concepts of och,
OMT, and Object Oriented Software Engineering (OOSE). The result of these concepts is a single, common,
and widely usable modeling language for users of these and other methods. The Unified Modeling Language
also promotes the concept of what can be done with existing methods
Advantages and Disadvantages of Object Oriented Analysis and Design
Advantages:
The OO approach inherently makes each object a stand alone component that can be reused not only within a
specific stat problem domain, but also is completely different problem domains, having the requirement of
similar objects. The other main advantage of object oriented (OO) is the focus on data relationships. You cannot
develop a successful system where data relationships are not well understood. An OO model provides all of the
insight of an ER diagram and contains additional information related to the methods to be performed on the
data. We will have more detailed discussion on this aspects in Block 3 of this Course.
Advantages and Disadvantages of Structured Analysis
With experience, you will come to know that most customers understand structured methods better than object
oriented (OO) methods. Since one of the main reasons of modeling a system is for communication with
customers and users, there is an advantage in providing structured models for information exchange with user
groups or customers.
In fact, specifications are typically in the form of a simple English language statement of Work and
Requirement Specification. Therefore, the system to be built, must be understood in terms of requirements
(functions the system must perform), that is why this naturally leads to a structured analysis, at least at the top
level. Specifically structured methods (functional decomposition) provide a natural vehicle for discussing,
modeling, and deriving the requirements of the system.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 1
MCS-032
The disadvantage with structured methods is that they do not readily support the use of reusable modules. The
top down process works well for new development, but does not provide the mechanisms for “designing in” the
use of existing components. The top down process of functional decomposition does not lead to a set of
requirements which map well to existing components.
When the requirements do not map cleanly, you have two choices: either you do not use the existing
components, or force fit the requirements to the existing components and “somehow” deal with the
requirements which are only partially covered by the existing components, which does not lead to a good
successful system. Now, we will discuss how actually object oriented analysis (OOA) system is performed.
Qst 2. What is class diagram ? Explain with an example, how Inheritance is shown in class diagram
Ans: . Class diagram : A class diagram is used to support functional requirement of system. In a static design
view, the class diagram is used to model the vocabulary of the system, simple collaboration, and logical
schema. It contains sets of classes, interfaces, collaborations, dependency, generalization and association
relationship. The notation for classes and the relationship between classes is shown as:
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 2
MCS-032
Qst 3. What are characteristics of OOAD. Critically explain why “Object Identification is one of the
major challenge in OOAD”
Ans : OOAD : Object-oriented analysis and design (OOAD) is a popular technical approach for analyzing,
designing an application, system, or business by applying the object-oriented paradigm and visual modeling
throughout the development life cycles to foster better stakeholder communication and product quality.
Object-oriented analysis
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 3
MCS-032
Class And Object : Classes are used to distinguish one type of object from another. In the context of object-
oriented systems, a class is a set of objects that share a common structure and a common behavior; a single
object is simply an instance of a class A class is a specification of structure (instance variables), behavior
(methods), and inheritance for objects.) Classes are an important mechanism for classifying objects. The chief
role of a class is to define the properties and procedures (the state and behavior) and applicability of its
instances. The class car, for example, defines the property color. Each individual car (formally, 9th instance of
the class car) will have a value for this property, such as maroon, yellow, or white. In an object-oriented system,
a method or behavior of an object is defined by its class.
OB.JECTS RESPOND TO MESSAGES: An object's capabilities are determined by the methods defined for
it. Methods conceptually are equivalent to the function definitions used in procedural languages. For example, a
draw method would tell a chart how to draw itself. However, to do an operation, a message is sent to an object.
Objects perform operations in response to messages. For example, when you press on the brake pedal of a car,
you send a stop message to the car object. The car object knows how to respond to the stop message, since
brakes have been designed with specialized parts such as brake pads and drums precisely to respond to that
message. Sending the same stop message to a different object, such as a tree, however, would be meaningless an
could result in an unanticipated
response.
INHERITANCE: Inheritance is the property of object-oriented systems that allows objects to be built from
other objects. Inheritance allows explicitly taking advantage of the commonality of objects when constructing
new classes. Inheritance is a relationship between classes where one class is the parent class of another
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 4
MCS-032
(derived) class. The parent class also is known as the base class or super class. Inheritance provides
programming by extension as opposed to programming by reinvention The real advantage of using this
technique is that we can build on what we already have and, more important, reuse what we already have.
Inheritance allows classes to share and reuse behaviors and attributes. Where the behavior of a class instance is
defined in that class's methods, a class also inherits the behaviors and attributes of all of its super classes.
DYNAMIC INHERITANCE : Dynamic inheritance allows objects to change and evolve over time. Since
base classes provide properties and attributes for objects, changing base classes changes the properties and
attributes of a class.
MULTIPLE INHERITANCE : Some object-oriented systems permit a class to inherit its state (attributes) and
behaviors from more than one super class. This kind of inheritance is referred to as multiple inheritance. For
example, a utility vehicle inherits attributes from both the Car and Truck classes.
POLYMORPHISM: Poly means "many" and morph means "form." In the context of object-oriented systems,
it means objects that can take on or assume many different forms. Polymorphism means that the same operation
may behave differently on different classes. Booch defines polymorphism as the relationship of objects of many
different classes by some common super class; thus, any of the objects designated by this name is able to
respond to some common set of operations in a different way.
ASSOCIATIONS: Association represents the relationships between objects and classes. For example, in the
statement "a pilot can fly planes" the italicized term is an association. Associations are bidirectional; that means
they can be traversed in both directions, perhaps with different connotations. The direction implied by the name
is the forward direction; the opposite direction is the inverse direction. For example, can fly connects a pilot to
certain airplanes. The inverse of can fly could be called is flown by.
AGGREGATIONS AND OB.JECT CONTAINMENT: All objects, except the most basic ones, are
composed of and may contain other objects. For example, a spreadsheet is an object composed of cells, and
cells are objects that may contain text, mathematical formulas, video, and so forth. Breaking down objects into
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 5
MCS-032
the objects from which they are composed is decomposition. This is possible because an object's attributes need
not be simple data fields; attributes can reference other objects. Since each object has an identity, one object can
refer to other objects. This is known as aggregation, where an attribute can be an object itself. For instance, a
car object is an aggregation of engine, seat, wheels, and other objects
Qst 4. Draw a sequence diagram for transferring fund from one account to another using online
banking.
Ans: Sequence Diagram: A sequence diagrams are interaction diagrams that emphasize the time ordering of
messages. In UML it is shown as a table that shows objects arranged along the X axis and messages, ordered in
increasing time, along the Y axis. It has a global life line and the focus of control. An object life line is the
vertical dashed line that represents existence of an object over a period of time. The focus of control is tall and
thin rectangle that shows the period during which an object is performing an action. The notation for depiction
of sequence among objects with certain conditions is shown as:
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 6
MCS-032
sequence diagram for transferring fund from one account to another using online banking are :
Qst 5. (a) Generalization? How it is different from specialization with the help of an example.
Ans: Generalization : Generalization means extracting common properties from a collection of classes, and
placing them higher in the inheritance hierarchy, in a super class. Generalization and specialization are the
reverse of each other. An object type hierarchy that models generalization and specialization represents the most
general concept at the top of an object type: hierarchy as the parent and the more specific object types as
children. In other words, specialization is a top-down activity that refines the abstract class into more concrete
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 7
MCS-032
classes, and generalization is a bottom-up activity that abstracts certain principles from existing classes, in order
to find more abstract classes.
We often organise information in the real world as generalisation/specialization hierarchies. You can see an
example of generalization/specialization in Figure 1.
Specialization involves the definition of a new class which inherits all the characteristics of a higher class and
adds some new ones, in a subclass. Whether the creation of a particular class involves first, or second activity
depends on the stage and state of analysis, whether initial classes suggested are very general, or very particular.
Qst 5. (b) What is state diagram? Explain the characteristics of the system that can be identified by
examination of the state diagram of that system.
Ans: state diagram: An object can receive a sequence of input instructions. The state of an object can vary
depending upon the sequence of input instructions. If we draw a diagram which will represent all the processes
(input) and their output (states) then that diagram is known as state diagram. Processes are represented by the
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 8
MCS-032
arrow symbol and states by an oval symbol. For example, the screen of an ATM machine has many states like
main screen state, request password state, process transaction state.
In other words A state diagram is a diagram used in computer science to describe the behavior of a
system considering all the possible states of an object when an event occurs. This behavior is represented and
analyzed in a series of events that occur in one or more possible states. Each diagram represents objects and
tracks the various states of these objects throughout the system.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 9
MCS-032
In other words, UML is simply another graphical representation of a common semantic model. UML
provides a comprehensive notation for the full lifecycle of object-oriented development.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 10
MCS-032
Structural Diagrams: Structure diagrams emphasize on the things that must be present in the system being
modeled.Since structure diagrams represent the structure, they are used extensively in documenting the software
architecture of software systems.
Behavioural Diagrams: - Behavior diagrams emphasize on what must happen in the system being
modeled.Since behavior diagrams illustrate the behavior of a system, they are used extensively to describe the
functionality of software systems.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 11
MCS-032
4. Object diagrams :represent objects and their relationships and correspond to simplified collaboration
diagrams that do not represent message broadcasts.
5. Class diagrams represent the static structure in terms of classes and relationships
6. Statechart diagrams: represent the behavior of a class in terms of states at run time.
7. Activity diagrams: represent the behavior of an operation as a set of actions
8. Component diagrams: represent the physical components of an application
9. Deployment diagrams: represent the deployment of components on particular pieces of hardware
1. Use Case Diagram: A use case diagram describes how a system interacts with outside actors.- It is a
graphical representation of the interaction among the elements and system. - Each use case representation a
piece of functionality that a system provides to its user.Use case identifies the functionality of a system.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 12
MCS-032
2. Activity Diagram: Used to document complex use case logic. It is not required for simple use case logic.
Symbols:
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 13
MCS-032
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 14
MCS-032
3. Sequence Diagram:
Time ordered message passing:
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 15
MCS-032
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 16
MCS-032
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 17
MCS-032
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 18
MCS-032
6. Class Diagram:
Class: A Class is represented like this:
Class
Attribute1
Attribute2
MethodA()
MethodB()
The top part showing the class name, the second showing the attributes and the third showing the methods.
Object: An object looks very similar to a class, except that its name is underlined:
AnObject
Attribute1
Attribute2
MethodA()
MethodB()
Relationships:
Relationships between classes are generally represented in class diagrams by a line or an arrow joining the
two classes. UML can represent the following, different types of object relationships.
3.1 If A depends on B, then this is shown by a dashed arrow between A and B, with the arrowhead pointing
at B:
Association: An association between A and B is shown by a line joining the two classes:
1. Bidirectional:
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 19
MCS-032
Aggregation:
An aggregation relationship is indicated by placing a white diamond at the end of the association next to the
aggregate class. If B aggregates A, then A is a part of B, but their lifetimes are independent:
Composition:
Composition, on the other hand, is shown by a black diamond on the end of association next to the composite
class. If B is composed of A, then B controls the lifetime of A.
Multiplicity:
The multiplicity of a relationship is indicated by a number (or *) placed at the end of an association.
The following diagram indicates a one-to-one relationship between A and B:
A multiplicity can also be a range of values. Some examples are shown below:
1 One and only one
* Any number from 0 to infinity
0..1 Either 0 or 1
n..m Any number in the range n to m inclusive
1..* Any positive integer
Naming an Association
To improve the clarity of a class diagram, the association between two objects may be named:
Inheritance
An inheritance (generalization/specialization) relationship is indicated in the UML by an arrow with a
triangular arrowhead pointing towards the generalized class.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 20
MCS-032
If A is a base class, and B and C are classes derived from A, then this would be represented by the following
class diagram:
Multiple Inheritance
The next diagram represents the case where class C is derived from classes A and B:
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 21
MCS-032
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 22
MCS-032
7. State Diagram:
Withdrawal States of objects are represented as rectangles with rounded corners. The transition between
difference states is represented as an arrow between states, and a condition of that transition occurring may be
added between square braced. This condition is called a guard.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 23
MCS-032
8. Component Diagrams: Component diagrams describe software components and their relationships within
the implementation environment; they indicate the choices made at implementation time.
They may be simple files, or libraries loaded dynamically.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com
[email protected]@gmail.com, FB Page- facebook.com/bilalali0786 24
MCS-032
9. Deployment Diagrams
Deployment diagrams show the physical layout of the various hardware components (nodes) that compose a
system, as well as the distribution of executable programs on this hardware. Deployment diagrams may show
node classes or node instances. As with other types of diagram, the graphical difference between classes and
objects is implemented by underlining the object name. The following example shows the deployment diagram
of a building access management system:
Each process named in the deployment diagram executes a main program with the same name as the one
described within the component diagram.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 25
MCS-032
Ans: DFD: A data flow diagram is a graph which shows the flow of data values from their sources in objects
through processes that transform them to their destinations in other objects A DFD also known as ‘bubble
chart’, has the purpose of clarifying system requirements and identifying major transformations. It shows the
flow of data through a system. It is a graphical tool because it presents a picture. The DFD may be partitioned
into levels that represent increasing information flow and functional detail. Four simple notations are used to
complete a DFD. These
notations are given below:-
DATA FLOW:- The data flow is used to describe the movement of information from one part
p of the system to
another part. Flows represent data in motion. It is a pipe line through which information flows. Data flow is
represented by an arrow.
PROCESS:- A circle or bubble represents a process that transforms incoming data to outgoing data. Process
shows a part of the system that transform inputs to outputs.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com
[email protected]@gmail.com, FB Page- facebook.com/bilalali0786 26
MCS-032
EXTERNAL ENTITY:- A square defines a source or destination of system data. External entities represent
any entity that supplies or receive information from the system but is not a part of the system.
DATA STORE:- The data store represents a logical file. A logical file can represent either a data store symbol
which can represent either a data structure or a physical file on disk. The data store is used to collect data at
rest or a temporary repository of data. It is represented by open rectangle.
OUTPUT:-The output symbol is used when a hard copy is produced and the user of the copies cannot be
clearly specified or there are several users of the output.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 27
MCS-032
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 28
MCS-032
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 29
MCS-032
Qst 8. (a) How do you identify concurrency in system? Explain the important issues related to
concurrency management.
Ans: identify concurrency : While designing the analysis, model we map the real world model into our
analytical model. Real life objects are concurrent in nature, but all design model objects are not concurrent in
nature as a single process may support multiple objects. Let us see what concurrency actually is: Concurrency
in objects can be identified by the way they change state. Current objects can change state independently.
Aggregation implies concurrency. Concurrency in OOAD study is described and studied in dynamic
modeling. One of the important issues in system design is to find the concurrency in objects. Once we identify
non-concurrent (mutually exclusive) objects, we can fold all the objects together in one thread of control, or
process. On the other hand, if the objects are concurrent in nature we have to assign them to, different thread of
control. For example, withdraw and deposit operations related to a bank account may be executed in parallel
(concurrently).
� A thread of control is a path through a set of state diagrams on which a single object is active at a time.
� Objects are shared among threads, that is, several methods of the same object can be active at the same time.
� Thread splitting: Object sends a message but does not wait for the completion of the method.
Identification of concurrency: Concurrency is identified in a dynamic model. Two objects are said to be
concurrent (parallel) if they can receive events at the same time. Concurrent objects are required to be assigned
to different threads of control. We will see how if is used in this example:
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 30
MCS-032
Concurrency issues
� Data integrity: Threads accessing the same object need to be synchronized, for example: banking account.
� Deadlock: One or more threads in the system are permanently blocked Example: Thread A waiting on
Thread B, which is waiting on Thread A.
� Starvation: A thread is not getting enough resources to accomplish its work Example: All requests from one
user are being handled before another users requests.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 31
MCS-032
� Synchronized methods
Methods
� Deadlock avoidance
� Verification
� Simulation
Key:
1) Develop a clear strategy for dealing with all concurrency issues during system design.
2) Concurrency must be dealt with during the design process as dealing with concurrency after the system is
implemented is difficult.
Qst 8. (b) What is unidirectional implementation ? Explain how it is different than bi-directional
implementation with an example.
Ans: unidirectional implementation : unidirectional implementation associations are those in which the
decision has been taken to maintain the association in only one direction.In this association will only be
supported in one direction. This design decision can be represented on a class diagram by writing an arrow (�)
on the association to show the required direction of traversal.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 32
MCS-032
One-to-One Associations
Some of the properties of associations can be implemented directly by providing suitable declarations of data
members in the relevant classes. Other semantic features of an association can be enforced by providing only a
limited range of operations in the class’s interface, or by including code in the implementation ofmember
functions that ensures that the necessary constraints are maintained. Now, let us consider the association shown
below in Figure 2.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 33
MCS-032
are essentially the same as discussed in the unidirectional implementation. The only difference is that suitable
fields have to be declared in both classes participating in the association.On problem with bi-directional
implementation is that the extra complexity in its implementations arises due to the need to keep the two
pointers that implement a link consistent at the run-time.
It is necessary that the guarantor of an account must guarantee the same account type of the property of an
association should hold between the accounts and guarantors as shown in Figure 4(a). Figure 4(b) violates this
property, the top account object holds a reference to a guarantor object which in turn holds a reference to
entirely a different account. These two references cannot be understood as being an implementation of a single
link. This is a case of not being in referential integrity. It should be clear from the above example that referential
integrity cannot be ensured by simply giving appropriate definitions of data members in the relevant classes.
The unidirectional implementations will not support every association needs for all possible forms of
manipulation of links. The behaviour that is required to be supported will depend on the details of individual
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 34
MCS-032
applications, and will be defined by the active operational interfaces of the classes participating in the
association.
For More Solution’s Contact To Mr. Bilal Ali : Brain Café Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_ID- [email protected]@gmail.com, FB Page- facebook.com/bilalali0786 35