1 / 43

CSci 152: Programming II Fall 2004

Objected Oriented Design (OOD) and Objected Oriented Programming (OOP)The fundamentals of OOD are:1. Encapsulation?combine data and operations on data in a single unit. 2. Inheritance?create new objects from existing objects.3. Polymorphism?the ability to use the same expression to denote differ

jalen
Télécharger la présentation

CSci 152: Programming II Fall 2004

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


    1. CSci 152: Programming II Fall 2004 Composition

    2. Objected Oriented Design (OOD) and Objected Oriented Programming (OOP) The fundamentals of OOD are: 1. Encapsulationcombine data and operations on data in a single unit. 2. Inheritancecreate new objects from existing objects. 3. Polymorphismthe ability to use the same expression to denote different operations.

    3. In OOD an object is a fundamental entity, while in structured programming a function is a fundamental entity. In OOD we debug objects, while in structured programming we debug functions. In structured programming a program is a collection of interacting functions, while in OOD a program is a collection of interacting objects. OOD encourages code reuse. In structured programming the programmer is action oriented, while in OOD the programmer is object oriented. The object-oriented programming (OOP) implements OOD. C++ supports OOP through the use of classes. A polymorphic function or operator has many forms. In C++ a function name and operators can be overloaded. Templates provide parametric polymorphism. C++ provides virtual functions as a means to implement polymorphism in an inheritance hierarchy.

    4. Objects are created when class variables are declared. Objects interact with each other via function call. Every object has an internal state and external state. The private members form the internal state and the public members form the external state. Only the object can manipulate its internal state.

More Related