-
14
pages
-
English
-
Documents
Description
Cours de C++Programmation orientée objetsCécile Braunsteincecile.braunstein@lip6.frCours de C++ 1 / 14Programmation oriented object (POO)Advantages• Re use• Modularity• MaintainabilityLanguage oriented objectBefore : POO :• Data more or less well • Modules (classes)organised representing data andfunctions• Functions and computationapplied on these data • A program is a set of objectsinteracting by calling their• A program is a following ofown functions(methods),affectation and computationCours de C++ 2 / 14ConceptsObjectsAn object is a recognizable element characterized by its structure(attributes) and its behavior (methods)Û Object = Class instanceClassGroups and creates objects with the same properties (method andattributes).Class members :• Attributes : define the domain of value• Methods : define behavior; set of function modifying the state ofan objectA class has got at least one attribute and two methods (create anddelete)Cours de C++ 3 / 14Information hidingPurposeRestrict access to a class by its interface• Put constraints for the use and the interaction between objects.• Programmer see only a part of the object corresponding to itsbehavior• Help updates and changes for a class.Class has two parts• An interface : access for external users,• Internal data and internal implementation.Cours de C++ 4 / 14InheritanceModels the dependency between classes• Allows re use of class property by specialization• Programming by ...
-
Publié par
-
Langue
English