====== 2.1.3.2 Object Oriented Programming ====== [[dido:public:s_cli:05_contents:01_prt:02_basics:03_paradigim:start| Return to Programming Paradigm ]] [[dido:public:ra:xapend:xapend.a_glossary:o:oop]] is a form of [[dido:public:ra:xapend:xapend.a_glossary:i:imperative | Imperative]] and procedural programming. The main difference is how the procedures, functions and data are organized. OOP encapsulates data and behavior into [[dido:public:ra:xapend:xapend.a_glossary:o:object|objects]]. In other words, an object is the definition of data and the operations that can be performed on that data. OOP [[dido:public:ra:xapend:xapend.a_glossary:a:application|applications]] use a collection of objects to accomplish the overall [[dido:public:ra:xapend:xapend.a_glossary:g:goal|goal]] of the program or application. For example an object represent a person (i.e., a person-object). The person-object has, by definition, certain attributes or properties which are made public or held private. In addition, the person-object has methods that ensure the validity of the name attribute within the person-object as defined by the person-object. OOP also has abstraction for objects called [[dido:public:ra:xapend:xapend.a_glossary:c:class|classes]] that are blueprints for real world [[dido:public:ra:xapend:xapend.a_glossary:i:instance|instances]] of things. In the example above, there is class of objects called people. Each individual person is represented by an instance of the people-object (i.e., john-people-object, and jane-people-object). All the instances of the people-objects offer the same attributes and methods. Some examples of Object Oriented Programming languages are: * C++ * Java * [[dido:public:ra:xapend:xapend.a_glossary:j:javascript|JavaScript]] * Python * Ruby * PHP * Scala * Visual Basic .NET In Figure {{ref>OOProgramming}}, the green boxes represent functions (i.e., operations) and the blue cylinders represent data associated with the an Object represented by the outer orange boxes. Objects encapsulate the [[dido:public:ra:xapend:xapend.a_glossary:d:data_object|data objects]] and the operations that work on that data. The data flow and control is accomplished by invocation of operations (i.e., methods) between the different objects.
{{ dido:public:s_cli:05_contents:01_prt:02_basics:screen_shot_2021-04-12_at_10.41.46_pm.png?600 |}} [[dido:public:ra:xapend:xapend.a_glossary:o:oo]] Data Flow
/**=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- /* To add a discussion page to this page, comment out the line that says ~~DISCUSSION:off~~ */ ~~DISCUSSION:on|Outstanding Issues~~ ~~DISCUSSION:off~~