Object-oriented programming: Difference between revisions

Content deleted Content added
Features: rm test edit https://en.wikipedia.org/w/index.php?diff=1057068638. did nobody proofread this article? O_O
Objects: not sure how relevant the Date&Darwen reference is, but it doesn't look much like traditional OO
Line 91:
Objects sometimes correspond to things found in the real world. For example, a graphics program may have objects such as "circle", "square", and "menu". An online shopping system might have objects such as "shopping cart", "customer", and "product".<ref>{{cite book|last=Booch|first=Grady|title=Software Engineering with Ada|year=1986|publisher=Addison Wesley|isbn=978-0-8053-0608-8|page=220|url=https://en.wikiquote.org/wiki/Grady_Booch|quote=Perhaps the greatest strength of an object-oriented approach to development is that it offers a mechanism that captures a model of the real world.}}</ref> Sometimes objects represent more abstract entities, like an object that represents an open file, or an object that provides the service of translating measurements from U.S. customary to metric. Objects are accessed somewhat like variables with complex internal structures, and in many languages are effectively [[Pointer (computer programming)|pointers]], serving as actual references to a single instance of said object in memory within a heap or stack. Procedures are known as [[Method (computer science)|methods]]; variables are also known as [[Field (computer science)|fields]], members, attributes, or properties.
 
Objects can contain other objects in their instance variables; this is known as [[object composition]]. For example, an object in the Employee class might contain (either directly or through a pointer) an object in the Address class, in addition to its own instance variables like "first_name" and "position". Object composition is used to represent "has-a" relationships: every employee has an address, so every Employee object has access to a place to store an Address object (either directly embedded within itself or at a separate ___location addressed via a pointer). Date and Darwen have proposed a theoretical foundation that uses OOP as a kind of customizable [[data type|type system]] to support [[RDBMS]], but it forbids object pointers.<ref name="ThirdManifesto">C. J. Date, Hugh Darwen. ''Foundation for Future Database Systems: The Third Manifesto'' (2nd Edition)</ref>
 
The OOP paradigm has been criticized for overemphasizing the use of objects for software design and modeling at the expense of other important aspects (computation/algorithms).<ref name="stepanov"/><ref name="hickey"/> For example, [[Rob Pike]] has said that OOP languages frequently shift the focus from [[data structure]]s and [[algorithm]]s to [[data type|types]].<ref name="RobPike">{{cite web |url=https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.html |title=Less is exponentially more |last1=Pike |first1=Rob |date=25 June 2012 |access-date=1 October 2016 }}</ref> [[Steve Yegge]] noted that, as opposed to [[functional programming]]:<ref name="yegge">{{Cite web|url=http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html|title=Stevey's Blog Rants: Execution in the Kingdom of Nouns|access-date=20 May 2020}}</ref>