25-08-2017, 09:32 PM
OBJECT ORIENTED ANALYSIS AND DESIGN TWO MARK AND SIXTEEN MARK Q and A
OBJECT ORIENTED ANALYSIS.pdf (Size: 224.6 KB / Downloads: 31)
Write about the traditional development methodologies?
Most traditional development methodologies are either algorithm centric or
data centric.
a) Algorithm-centric methodology
You think of an algorithm that can accomplish the task, and then
build data structures for that algorithm to use.
b) Data- centric methodology
You think how to structure the data, and then build the algorithm
around that structure.
Define objects.
Object is a real-world entity, identifiably separate from its surroundings,
has a well defined set of attributes and a well-defined set of procedures or
methods.
Properties (or attributes) describe the state (data) of an object.
Methods (procedures) define its behavior. Object means a combination of
data and logic that represents some real-world entity.
(E.g.) Car is an object. Color, manufacturer, cost, owner etc are attributes.
Drive it, lock it, tow it, carry passengers in it are all methods.
Give a brief note on object behavior
Object behavior is described in methods or procedures. Behavior denotes the
collection of methods that abstractly describes what an object is capable of doing.
Each procedure defines and describes a particular behavior of an object. Methods
encapsulate the behavior of the object. Objects take responsibility for their own
behavior.
What do you mean by information hiding?
Information hiding is the principle of concealing the internal data and
procedures of an object and providing an interface to each object and
providing an interface to each object in such a way as to reveal as little as
possible about its inner workings.
An object is often said to encapsulate the date and a program.
Per-class protection.
· Class methods can access any object of that class and not just the
receiver
Per-object protection.
· Methods can access only the receiver.
Define class hierarchy
Object oriented system organizes classes into a subclass-super class hierarchy.
At the top of the class hierarchy are the most general classes and at the bottom
are the more specific.
A subclass inherits all of the properties and methods defined in its super class.
Subclasses may refine or constrain the state and behavior inherited from its
super class.
A class may simultaneously be the subclass to some class and a super class to
another class.
Formal or abstract classes have no instances but define the common behaviors
that con be inherited by more specific classes.
Write briefly about inheritance and explain the types of inheritance.
Inheritance is the property of object-oriented systems that allows objects
to be built from other objects.
Inheritance is a relationship between classes where one class is the parent
class of another derived class called base class or super class.
Inheritance allows classes to share and reuse behaviors and attributes of all
its super classes.
Types of inheritance
Dynamic inheritance.
It 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 form more than one super class.
What do you mean by polymorphism?
Polymorphism means that the same operation may behave differently on
different classes. Polymorphism allows us to write generic, reusable code more
easily, because we can specify general instructions and delegate the
implementation details to the objects involved.
Explain object relationship and associations.
a. Association represents the relationships between objects and classes.
b. Associations are bidirectional.
c. Cardinality specifies how many instances of one class may relate to a
single instance of an associated class.
d. Cardinality constraints the number of related objects and often is described
as being “one” or “many”
Pilot Planes Can fly Flown by
What do you mean by consumer-producer association?
It is also known as client-server association. It uses relationship. It is a oneway
interaction in which one object requests the service of another object.
The object that makes the request is the consumer or client and the object
receives the request and provides the service is the producer or server.
Write about static and dynamic binding?
o Static binding
The process of determining which functions to invoke at compile
time is termed as static binding. Static binding optimizes the calls.
o Dynamic binding
The process of determining which functions to invoke at runtime
are called as dynamic binding. They occur when polymorphic calls
are issued. Dynamic binding allows some method invocation
decisions to be deferred until the information is known.
Define object persistence
A file or a database can provide support for objects having a longer lifeline,
longer than the duration of the process for which they were created. This is called
object persistence. An object can persist beyond application session boundaries,
during which the object is stored in a file or a database. The object can be
retrieved in an other application session and will have same state and relationship.
Define meta-classes.
If a class is an object, it must belong to a class which is called as meta-class or
a class of classes. All the objects are instances of a class and all classes are
instances of a meta-class. Meta-classes are used by the compiler.