Object Oriented Concepts
Objects are entities that contain
data and
behaviors.
Objects contain
methods that operate on the data types
or attributes
(encapsulation).
Class - a template from which
objects are made. It is a blueprint for
an object.
Instantiated - when
objects are created they are
instantiated.
Class is the table definition with
the rows in the table being the objects.
A cookie cutter is the class - the
cookies are the objects.
Public &
private
attributes &
methods.
- Public - other
objects can directly access the
attribute or
method
- Private - only that specific
object can access it directly.
- Protected - only related objects
can access it directly.
Encapsulation
- Interfaces - normally do not
include attributes only
methods (If a user needs access to an
attribute, then a
method is created to return the value
of the attribute. In this way the
attribute is
encapsulated in the object.
- Implementations - The
implementation can change without effecting the interface and
therefore without effecting the user's code.