Content deleted Content added
Undid revision 1228147403 by 2409:408C:8D4F:96D:18C0:F8E4:3AD1:BBF8 (talk) - broken |
Stevebroshar (talk | contribs) →Design patterns: Moved info from object (computer science) |
||
Line 237:
==Design patterns==
===Object patterns===
The following are notable [[software design pattern]]s for OOP objects.<ref name="R.C.Martin">{{cite web |url=http://www.objectmentor.com/resources/articles/Principles_and_Patterns.pdf |title=Design Principles and Design Patterns |last=Martin |first=Robert C. |author-link=Robert Cecil Martin |access-date=28 April 2017 |url-status=dead |archive-url=https://web.archive.org/web/20150906155800/http://www.objectmentor.com/resources/articles/Principles_and_Patterns.pdf |archive-date=September 6, 2015 }}</ref>
*[[Function object]]: with a single method (in C++, the function operator, <code>operator()</code>) it acts much like a function
*[[Immutable object]]: does not change state after creation
*[[First-class object]]: can be used without restriction
*[[Container (data structure)|Container object]]: contains other objects
*[[Factory object]]: creates other objects
*[[Metaobject]]: from which other objects can be created (compare with a [[class (computer science)|class]], which is not necessarily an object)
*[[Prototype pattern|Prototype object]]: a specialized metaobject from which other objects can be created by copying
*[[God object]]: knows or does too much; example of an [[anti-pattern]]
*[[Singleton pattern|Singleton object]]: only instance of its class for the lifetime of the program
*[[Filter object]]: receives a stream of data as its input and transforms it into the object's output
===Inheritance and behavioral subtyping===
|