- Object Oriented Programming (OOP is a programming method that combines data and instructions into a self-sufficient "object".
- "Object orientation provides a new paradigm for software construction. In this new paradigm, objects and classes are the building blocks, while methods, messages and inheritance produce the primary mechanisms"
- In an object-oriented program, objects represent the design. Objects have two sections, fields (instance variables) and methods.
- Fields represent what an object is.
- Methods represent how an object is used.
- These fields and methods are closely tied to the real world characteristics and use of the object. An object is used by means of its methods. The following figure shows a view of object oriented programming
Programming in the small
- Programs are developed by a single programmer/ small group of programmers.
- All aspects of the project can be understood by a single individual.
- The major problem is the development of the algorithms and data structures needed to solve the task at hand.
Programming in the large
- The software system is developed by a large team of programmers, often with considerable specialization.
- No single individual can (likely) understand all aspects of the project.
- The major problem is the coordination of the diverse aspects of the project--people and software systems
- Describing large, complex systems as interacting objects make them easier to understand than otherwise.
- The behaviors of real world objects tend to be stable over time.
- The different kinds of real world objects tend to be stable. (That is, new kinds appear slowly; old kinds disappear slowly.)
- Changes tend to be localized to a few objects.
An Object Model
- objects (i.e., abstract data structures)
- classes (i.e., abstract data types)
- inheritance (hierarchical relationships among ADTs)
- polymorphism by inheritance
- operations on objects of the class,
- the possible set of states.
- Overloading (or ad hoc polymorphism)
- Parametric polymorphism
Why is OOP Popular?
- OOP is revolutionary idea, totally unlike anything that has come before programming
- OOP is an evolutionary step, following naturally on the heel of earlier programming abstractions.
- People hoped that it would quickly and easily lead to increased productivity and improved reliability - solve software crises
- People hoped for easy transition from existing languages
- Resonant similarity to techniques of thinking about problems in other domains.