Object-oriented programming: Difference between revisions

Content deleted Content added
m del unnecessary colon
change paradigms template to navbox (see Template talk:Programming paradigms#too long). move UML image up to top
Line 2:
{{Redirect|Object-oriented|other meanings of object-oriented|Object-orientation (disambiguation){{!}}Object-orientation}}
{{Use dmy dates|date=January 2020}}
[[File:oop-uml-class-example.png|frame|right|[[Unified Modeling Language|UML]] notation for a class. This Button class has [[Variable (computer science)|variables]] for data, and [[Method (computer programming)|functions]]. Through inheritance, a subclass can be created as a subset of the Button class. Objects are instances of a class.]]
{{Programming paradigms}}
 
'''Object-oriented programming''' ('''OOP''') is a [[programming paradigm]] based on the concept of ''[[Object (computer science)|objects]]'',<ref name=alanKayOnOO /> which can contain [[data]] and [[source-code|code]]: data in the form of [[Field (computer science)|fields]] (often known as [[Attribute (computing)|attributes]] or [[Property (programming)|properties]]), and code in the form of [[Procedure (computer science)|procedures]] (often known as [[method (computing)|methods]]). In OOP, [[computer program]]s are designed by making them out of objects that interact with one another.<ref>{{Cite journal
Line 77:
 
==Features==
[[File:oop-uml-class-example.png|frame|right|[[Unified Modeling Language|UML]] notation for a class. This Button class has [[Variable (computer science)|variables]] for data, and [[Method (computer programming)|functions]]. Through inheritance, a subclass can be created as a subset of the Button class. Objects are instances of a class.]]
{{See also|Comparison of programming languages (object-oriented programming)|List of object-oriented programming terms}}
Object-oriented programming uses objects, but not all of the associated techniques and structures are supported directly in languages that claim to support OOP. The features listed below are common among languages considered to be strongly class- and object-oriented (or [[multi-paradigm]] with OOP support), with notable exceptions mentioned.<ref name="ArmstrongQuarks">Deborah J. Armstrong. ''The Quarks of Object-Oriented Development''. A survey of nearly 40 years of computing literature identified several fundamental concepts found in the large majority of definitions of OOP, in descending order of popularity: Inheritance, Object, Class, Encapsulation, Method, Message Passing, Polymorphism, and Abstraction.</ref><ref>[[John C. Mitchell]], ''Concepts in programming languages'', Cambridge University Press, 2003, {{ISBN|0-521-78098-5}}, p.278. Lists: Dynamic dispatch, abstraction, subtype polymorphism, and inheritance.</ref><ref>Michael Lee Scott, ''Programming language pragmatics'', Edition 2, Morgan Kaufmann, 2006, {{ISBN|0-12-633951-1}}, p. 470. Lists encapsulation, inheritance, and dynamic dispatch.</ref><ref name="pierce">{{Cite book|last=Pierce|first=Benjamin|title=Types and Programming Languages|publisher=MIT Press|year=2002|isbn=978-0-262-16209-8|title-link=Types and Programming Languages}}, section 18.1 "What is Object-Oriented Programming?" Lists: Dynamic dispatch, encapsulation or multi-methods (multiple dispatch), subtype polymorphism, inheritance or delegation, open recursion ("this"/"self")</ref> [[Christopher J. Date]] stated that critical comparison of OOP to other technologies, relational in particular, is difficult because of lack of an agreed-upon and rigorous definition of OOP.<ref name="DatePage650">C. J. Date, Introduction to Database Systems, 6th-ed., Page 650</ref>
Line 480 ⟶ 479:
*[https://thenewstack.io/why-are-so-many-developers-hating-on-object-oriented-programming/ Discussion on Cons of OOP]
* [http://java.sun.com/docs/books/tutorial/java/concepts/index.html OOP Concepts (Java Tutorials)]
{{Programming paradigms navbox}}
{{Types of programming languages}}
{{Software engineering}}