THE TEST ON OOM
(1)
Give 2 examples of inheritance. For both the egs, list 2 common attrbiutes to the base class and derived class. Also lis
t 2 attributes which would be specific to the derived class only. ?
example 1:-
student(base class)
attributes : name, id, address, marks
teacher(derived class)
attributes : name, id, address, salary, position
Example 2:-
Memory Device(base class)
attributes : name, price
volotile device(Derived class1):
attributes : name, price, speed, type
Non Volotile device(derived class2) :
attributes: name, price, storage capacity, type
PR Attribute ID Marks New Marks
OOM_3 3 1.5
(2) refer attached doc ?
Page 1 of 6
2/6/2009 http://10.203.161.13/OES/take1.jsp?s1=505&s2=20532
Writen on paper
PR Attribute ID Marks New Marks
OOM_6 5 3
OOM_9 3 2
(3) refer attached document ?
writen on paper
PR Attribute ID Marks New Marks
OOM_1 3 2
Page 2 of 6
2/6/2009 http://10.203.161.13/OES/take1.jsp?s1=505&s2=20532
OOM_7 5 3
(4) what are the advantages in OOAD vs structured approach ?
following a systematic phase wise approach to problem solving (Requirement ->Analysis->Design etc)
shorter analysis and design phase
easier to conceptualize due to similarity to real world
code reusability
(5) Refer to attached question ?
writen on paper
PR Attribute ID Marks New Marks
OOM_1 3 2
OOM_5 5 3
(6) Computer has a CPU, a monitor, a mouse. The relationship btn computer and CPU is : ?
aggregation
inheritance
association
composition
(7) Explain briefly what is a Design pattern. Explain the Singleton design pattern. ?
Page 3 of 6
2/6/2009 http://10.203.161.13/OES/take1.jsp?s1=505&s2=20532
Design patterns are the solutions for the common problems faced by the programs. In general, the
programming experts will give a solution in the form of Design pattern.
In order to use any design pattern we have to follow the set of rules provided by the exerts.
Eg: addaptor, using this we can integrate the functanilities provided by different languages
Singleton design pattern
------------------------
Example Problem: we have developed a desktop application, using which the user can intrract with
system. He opend interface in one window, again he may try to open the interface in another
window. But it is not supposed to be done.
In this situation, we can solve using singletopn design pattern.
Procedure:
---------
When the person open interface in one window, object will be created successfully. If he tries to
open another interface, object wont be created. Since the object is already running.
It can be inplemented by taking static variable in the class.
PR Attribute ID Marks New Marks
OOM_13 3 1
(8) What is difference between Aggregation and Composition? ?
Aggrigation
------------
In aggrigation we can easily add/remove the components but the system will not be disturbed.
Eg:
Database----tables----records.
database will exist with out tables and records
Composition
-----------
In composition all compnents come to gether and leave together.
eg:
car and its parts.
PR Attribute ID Marks New Marks
OOM_2 2 1.5
(9) Clearly explain OOAD concepts of static and dynamic polymorphism with examples ?
Page 4 of 6
2/6/2009 http://10.203.161.13/OES/take1.jsp?s1=505&s2=20532
Polymorphism:
polymorphism is a greak word i.e poly + morphism = many + behaviour
The same thing which exhibits diffrent behaviours.
Static Polymorphism:
-------------------
The polymorphism which is exhibited at compile time is known as static polymorphism.
Ex: function overloading exhibits static polymorphism,
In order to perform addtion of two numbers and three numbers. I will use only single name, addtion.
But i will have two implementations
addtion(int, int);
addtion(int, int, int);
The static polymorphism is also known as early binding.
Dynamic polymorphism
--------------------
The polymorphism which is exhibited at run time is known as dynamic polymorphism
Ex: Function overriding exhibits dynamic polymorphism
In order to perfor addtion of two intgers and addtion of two real number, i use single name add
The implementations are different
add(int, int);
add(float, float);
PR Attribute ID Marks New Marks
OOM_4 3 1.5
(10) which of the following statements are true ?
all the attributes of a class should be captured as part of class diagram in static modelling
use cases are expanded to show interactions between objects as part of dynamic modelling
determining active and passive objects should be done as part of state chart diagram
static model can be refined after progressing to the next phase of dynamic modelling
(11)
We have a stack class which has operations like push() and pop() and a list class with operations like addElem
(), deleteElem(), modifyElem
() etc. It would be a good idea to introduce inheritance relationship between the two classes. The operations pop
() and push() of stack class can be implemented using the addElem() and deleteElem() class of list. ?
True
False
Not Answer
(12)
Explain the Design Phase of OOAD. Explain in details what are the steps involved in the design phase and the model
s that are made as part of OOAD's Design phase. ?
Page 5 of 6
2/6/2009 http://10.203.161.13/OES/take1.jsp?s1=505&s2=20532
We have requirement, anylasis, design pahses.
The outcome of anylasis phase will be the input of the design phase.
The following steps are involved in the design phase:
1)Identifying the use cases, here the system will be viewed as a black box and we never look in to
the inner functionalities.
2)Class Design: Here the all the required classes are identified, we can identify associations,
compositions, and aggrigations. But flow is not required
3)Sequence Diagrams: These are used in represention flow of the system. This is dynamic modeling
4)statechart diagrams: This will represents the intrraction between the states, like turing machine.
5)Object Design: Here we identify colsely related objects and coupled together in to different sets.
PR Attribute ID Marks New Marks
OOM_1 2 0
OOM_11 2 0
(13) Which diagram is best suited to indicate behavior of an object across multiple use cases? ?
state diagram
collaboration diagram
functional diagram
sequence diagram
Page 6 of 6
2/6/2009 http://10.203.161.13/OES/take1.jsp?s1=505&s2=20532