Unit 3 Flashcards
An Object Is:
something that is perceived as an entity and referred to by name;
something perceptible by one or more of the senses;
something intelligible or perceptible by the mind.
Attributes
Attributes are features, properties, qualities or characteristics that are associated with an object.
Attributes are usually paired with values that qualify or quantify the attribute.
Operations
An operation is what an object does or is capable of doing.
•Student studies
•Faculty member teaches
•A television increases its volume
Operations are known as Methods in OO Terminology
Invoking a method (making an object perform the operation) is done by sending a message to the object
State of an Object
State is the condition of an object at a certain stage in its lifetime.
An object has a set of attributes and these attributes accept a range of values. The combination of these attributes and their associated values constitute the state of an object.
Student X has a cumulative GPA of 2.8. This student is in the probationary state; if the GPA changes to above 3.0, the student’s state will change to good-standing state
Class
Class is a set of objects that share the same attributes and operations.
It could be considered as a generic object or a template for similar objects
Instance
Another term for object An instance is the concrete manifestation of a class. For example, John Doeis an “instance” of the class Human.
Messages and Methods
Messages are information sent to objects to trigger methods
Concept of Encapsulation
Encapsulation is the packaging of data and processes within one single unit.
Objects encapsulate attributes and operations of things using a single model
Information Hiding
Information hiding conceals and protects what goes on inside an object from the outside world.Private and Public Attributes
Private and Public Methods
Information Hiding Example
you are not burdened with the complexity of how the machine works,
cannot perform operations that you are not allowed to, and
cannot change the way the machine operates.
Interface
An object’s interface consists of operations that are available to the public.
For instance, suppose student object has the following methods (+ stands for public and –stands for private)
+Get Student Name
+Compute GPA
-Get Social Security Number
-Get Course Grades
The Interface for student object is: get student name, compute gpa
Superclass and Subclass
A superclass results from generalizinga set of classes. Example: Student A subclass results from specializinga superclass. Example: Undergraduate Student, Graduate Student The relationship among superclassesand subclasses is called class hierarchy.Also known as is-a relationship
Inheritance
Person Class-> Patient Class
Person Class->Doctor Class
Aggregation
In object-oriented terminology, the relationship of one object to its component objects is called aggregation
.A computer object aggregates monitor, cpu, keyboard, DVD Drive objects
Also know whole-part relationship –computer is the whole and monitor, cpu, … are parts
Abstract and Concrete Classes
Classes that can be instantiated into actual (real orvirtual) objects are called concreteclasses.Classes that cannot be instantiated into actual (real orvirtual) objects are abstractclasses.