Thursday, December 3, 2015

What is Object Orientation? Explain the concept of class,objects, instance, generalization, and associations.



In object orientation the major emphasis is on specifying the characteristics of the
objects in a system, rather than implementing these characteristics. The uses of an
object depend highly on the facts of the application and regular changes during
development. As requirements extend, the features supplied by an object are much
more stable than the ways in which they are used, hence software systems built on
object structure are more secure.
While developing a system using the object oriented approach, main emphasis is on
the essential properties of the objects involved in the system than on the procedure
structure to be used for implementation. During this process what an object is, and its
role in system is deeply thought about.
Class : A class is a collection of things, or concepts that have the same characteristics. Each
of these things, or concepts is called an object.
Classes can serve as the foundation for data modeling. In OOM, the term classes is
usually the base from which visual modeling tools−such as Rational Rose XDE,
Visual Paradigm function and design the model of systems.
Attributes are named slots for data values that belong to the class.
Operations represent services that an object can request to affect the behaviour
of the object or the system itself.
The naming convention for classes are as follow:
Class names are simple nouns or noun phrases.
Attribute names in a class are simple nouns or noun phrases. The first word is
not capitalized, but subsequent words may be capital.
Operation names are simple verbs. As with attributes, the first word is not
capitalized and subsequent words may be capital.
Objects : The notation for an object is the same in basic form as that for a class. There are three
differences between the notations, which are:
Within the top section of the class box, the name of the class to which the object
belongs appears after a colon. The object may have a name, which appears
before the colon, or it may be anonymous, in which case nothing appears before
the colon.
The contents of the top compartment are underlined for an object.
Each attribute defined for the given class has a specific value for each object
that belongs to that class.
An instance is a concrete manifestation of an abstraction to which a set of operations
can be applied and which has a state that stores the effect of the operation
Generalization
Generalization and inheritance are powerful abstractions for sharing the structure
and/or behaviour of one or more classes.
Generalization is the relationship between a class, and it defines a hierarchy of
abstraction in which subclasses (one or more) inherit from one or more superclasses.
Generalization and inheritance are transitive across a subjective number of levels in
the hierarchy. Generalization is an “is-a-kind of” relationship, for example, Saving
Account is a kind of Account, PG student is kind of Student, etc.
The notation for generalization is a triangle connecting a super class to its
subclasses. The superclass is connected by a line to the top of the triangle. The
subclasses are connected by lines to a horizontal bar attached to the base of the
triangle. Generalization is a very useful construct for both abstract modeling and
implementation.
Associations are the basic means used for establishing relationships among
objects and classes of the system.

0 comments:

Post a Comment