The Object Paradigm n Classes Templates for creating

The Object Paradigm n Classes – Templates for creating objects Includes Behaviors (methods) n Includes Data (attributes) n Object Paradigm 1

The Object Paradigm n Objects – Instances of a class Defined from a class template n Consumes memory n Identified with a object reference n Has a finite lifespan n Object Paradigm 2

The Object Paradigm n Encapsulation – How an object performs its duties is hidden from the outside world Methods can be used without the knowledge of the inner workings n Inner workings can be modified without impacting use (as long as the interface is unchanged) n Object Paradigm 3

The Object Paradigm n Association – Relationship between two classes Object Paradigm 4

The Object Paradigm n Composition – Supports a “part-of” relationship Object Paradigm 5

The Object Paradigm n n Aggregation – Whole/part relationship where the lifetimes of the whole and part are not necessarily bound together Composition – Whole/part relationship where the lifetimes of the whole and part are bound together Object Paradigm 6

The Object Paradigm n Inheritance – Defines a “kind-of” relationship. Supports reusing common attributes and methods from a base class to derived classes. “Specialization” Object Paradigm 7

The Object Paradigm n Abstract Classes Do not include implementation code sufficient to instantiate an object n Used to define the common data and behavior of the derived classes n Very powerful design & maintenance concept n Object Paradigm 8

The Object Paradigm n Interface – 100% abstract methods Derived classes must define behavior n A class can inherit from many interfaces (pseudo multiple inheritance). n Object Paradigm 9

The Object Paradigm n Polymorphism – The ability of objects with the same inheritance to perform any given behavior differently Object Paradigm 10
- Slides: 10