2. Basic Concepts about Object-Orientation
•object-orientation is what’s referred to as a
programming paradigm. It’s not a language
itself but a set of concepts that is supported by
many languages. If everything we do in these
languages is object-oriented, it means, we are
oriented or focused on objects.
3. Objects, Attributes, Methods, and
Encapsulation
•Object-oriented analysis (OOA) is based on several
concepts. Some of these concepts require a new way
of thinking about systems and the development
process.
•OOA is concerned with defining the static structure
and dynamic behavior models of the information
system instead of defining data and process models,
which is the goal of traditional development
approaches.
4. •The object-oriented approach to system
development is based on the concept of objects
that exist within a system’s environment. Objects
are everywhere. An object is a real-world element
in an object–oriented environment that may have
a physical existence like a customer, a car, etc. or
an intangible conceptual existence like a project, a
process, etc
5. •object is something that is or is
capable of being seen, touched,
or otherwise sensed and about
which users store data and
associate behavior.
•In object-oriented circles, an
attribute is the data that
represents characteristics of
interest about an object
Figure 1. Object, State and Behavior (Source: Charlie-Anne's Gaming Blog (:)
6. • In object-oriented circles, an object’s behavior is commonly referred to as a
method, operation, or service. Object-oriented approaches to systems
development simply requires an adjustment to how we commonly perceive
objects.
• Another important object-oriented principle is that an object is solely
responsible for carrying out any functions or behaviors that act on its own
data (or attributes).
• This leads us to an important concept in understanding objects: encapsulation.
Encapsulation is the packaging of several items together into one unit.
Applied to an object, both attributes and behavior of the object are packaged
together. They are considered part of that object. The only way to access or
change an object’s attributes is through that object’s specific behaviors.
7. Classes, Generalization, and Specialization
•Object class is a set of object instances that share the same
attributes and behaviors; often referred to simply as a class.
For example, it would be natural for you to classify both your
Systems Analysis and Design Methods textbook and another
textbook, such as Introduction to Programming, as a BOOK.
Both these object instances have some similar attributes and
behavior. For example, similar attributes might be ISBN
NUMBER, TITLE, COPYRIGHT DATE, EDITION, and so
on. Likewise, they have similar behavior, such as being able to
OPEN and CLOSE. There may be several other objects within
your environment that could be classified because of their
similarities.
8. •We can also recognize subclasses
of objects. For example, some of
the individuals in the room might
be classified as STUDENTS and
others as TEACHERS. Thus,
STUDENT and TEACHER object
classes are members of the
object class PERSON
•Inheritance is the concept
wherein methods and/or
attributes defined in an object
class can be inherited or reused
by another object class
Figure 2. Example of Subclasses of Objects (Source: System Analysis and Design Methods)
9. • Generalization/Specialization, sometimes
abbreviated as gen/spec, is a technique wherein the
attributes and behaviors that are common to several
types of object classes are grouped (or abstracted)
into their own class, called a supertype. The
attributes and methods of the supertype object class
are then inherited by those object classes known as
subtypes.
10. • the object classes STUDENT and
TEACHER contain attributes and
behaviors which are unique to them
(making them more specialized) but
that they also have access to the
generalized attributes and behaviors
of the PERSON object class via
inheritance.
Figure 3. Supertype and Subtype Relationships between Object Classes (Source: System Analysis and Design
Methods)
11. •The object class PERSON is referred to as a
supertype (or generalization class). A supertype is an
entity that contains attributes and behaviors that are
common to one or more class subtypes. It is also
referred to as abstract or parent class. The object
classes STUDENT and TEACHER are referred to as
subtypes (or specialization classes). A subtype is an
object class that inherits attributes and behaviors from
a supertype class and then may contain other
attributes and behaviors that are unique to it. It is also
referred to as child class and, if it exists at the lowest
level of the inheritance hierarchy, it is referred as
concrete class.
12. illustrates how to depict the supertype-subtype
relationship between the PERSON, STUDENT, and
TEACHER object classes using UML notation. All
the attributes and behaviors of the PERSON object
class are inherited by the STUDENT and
TEACHER object classes. The attributes and
behaviors that uniquely apply to a STUDENT or
TEACHER are recorded directly in the subtype
class symbol (Whitten & Bentley, 2005).
For example, an object “Person” can be described according to some common attributes such as LAST NAME, SOCIAL SECURITY NUMBER, PHONE NUMBER, and ADDRESS.
And each person represents an instance of a “Person” object. An object instance is each specific person, place, thing, or event, as well as the values for the attributes of that object.
For example, only YOU (an object) may CHANGE (behavior) your LAST NAME and HOME ADDRESS (attributes about you).