Object-Oriented Programming (OOP) Pattern
(Redirected from object-oriented programming)
Jump to navigation
Jump to search
An Object-Oriented Programming (OOP) Pattern is a programming pattern that follows an object-oriented design (of OOP objects composed of OOP Fields and OOP Methods).
- Context:
- It can be instantiated in an Object-Oriented Programming Language and implemented by a Object-Oriented Programming System.
- It can involve programming techniques such as: Data Abstraction, Program Encapsulation, Message Passing, OOP Polymorphism, Modular Programming and/or Program Behavior Inheritance.
- …
- Counter-Example(s):
- See: Computer Program Object, Computer Programming Task, Object-Oriented Program, UML.
References
2020
- (Wikipedia, 2020) ⇒ https://en.wikipedia.org/wiki/Object-oriented_programming Retrieved:2020-5-6.
- Object-oriented programming (OOP) is a programming paradigm based on the concept of “objects", which can contain data, in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods). A feature of objects is an object's procedures that can access and often modify the data fields of the object with which they are associated (objects have a notion of “this” or "self"). In OOP, computer programs are designed by making them out of objects that interact with one another. [1] OOP languages are diverse, but the most popular ones are class-based, meaning that objects are instances of classes, which also determine their types. ...
2013
- (Chisnall, 2013) ⇒ David Chisnall. (2013). “The Challenge of Cross-language Interoperability.” In: Queue Journal, 11(10). doi:10.1145/2542661.2543971
- QUOTE: Object-oriented languages bind some notion of code and data together. Alan Kay, who helped develop object-oriented programming while at Xerox PARC, described objects as "simple computers that communicate via message passing." This definition leaves a lot of leeway for different languages to fill in the details:
2011
- http://en.wikipedia.org/wiki/Object-oriented_programming
- … As a result, a significantly different yet analogous terminology is used to define the concepts of object and instance. Benjamin C. Pierce and some other researchers view as futile any attempt to distill OOP to a minimal set of features. He nonetheless identifies fundamental features that support the OOP programming style in most object-oriented languages:
- Dynamic dispatch – when a method is invoked on an object, the object itself determines what code gets executed by looking up the method at run time in a table associated with the object. This feature distinguishes an object from an abstract data type (or module), which has a fixed (static) implementation of the operations for all instances. It is a programming methodology that gives modular component development while at the same time being very efficient.
- Encapsulation (or multi-methods, in which case the state is kept separate)
- Subtype polymorphism.
- Object inheritance (or delegation)
- Open recursion – a special variable (syntactically it may be a keyword), usually called
this
orself
, that allows a method body to invoke another method body of the same object. This variable is late-bound ; it allows a method defined in one class to invoke another method that is defined later, in some subclass thereof.
- Similarly, in his 2003 book, Concepts in programming languages, John C. Mitchell identifies four main features: dynamic dispatch, abstraction, subtype polymorphism, and inheritance.[2] Michael Lee Scott in Programming Language Pragmatics considers only encapsulation, inheritance and dynamic dispatch.[3]
- Additional concepts used in object-oriented programming include:
- Classes of objects
- Instances of classes
- Methods which act on the attached objects.
- Message passing.
- Abstraction.
- … Decoupling refers to careful controls that separate code modules from particular use cases, which increases code re-usability. A common use of decoupling in OOP is to polymorphically decouple the encapsulation (see Bridge pattern and Adapter pattern) - for example, using a method interface which an encapsulated object must satisfy, as opposed to using the object's class.
- … As a result, a significantly different yet analogous terminology is used to define the concepts of object and instance. Benjamin C. Pierce and some other researchers view as futile any attempt to distill OOP to a minimal set of features. He nonetheless identifies fundamental features that support the OOP programming style in most object-oriented languages:
- ↑ , section 1.6 "Object-Oriented Programming"
- ↑ John C. Mitchell, Concepts in programming languages, Cambridge University Press, 2003, ISBN 0-521-78098-5, p.278
- ↑ Michael Lee Scott, Programming language pragmatics, Edition 2, Morgan Kaufmann, 2006, ISBN 0-12-633951-1, p. 470 vikas