Object (computer science): Difference between revisions

Content deleted Content added
Vera Cruz (talk | contribs)
mNo edit summary
JuUunIOr (talk | contribs)
No edit summary
 
(764 intermediate revisions by more than 100 users not shown)
Line 1:
{{Short description|Software abstraction with state, behavior, and identity}}
In [[computer science]], an '''object''' is something that has an identity, a [[state]], and a [[behaviour]]. The state is encoded in [[instance variable]]s ([[data member]]s), the behavior is encoded in [[method]]s ([[member function]]s). Objects are bundles of related [[variable]]s and methods and are often used to model [[object (philosophy)|real-world objects]]. Objects can be affected by [[event-driven programming|event]]s. [[Object-oriented programming|Object-oriented programs]] typically contain a large number of objects.
 
In [[software development]], an '''object''' is an [[entity]] that has [[State (computer science)|state]], [[behavior]], and [[Identity (object-oriented programming)|identity]].
==Overview of Identities, States, and, Behaviours==
<ref name="ooa">{{cite book|title=Object-Oriented Analysis and Design with Applications |edition=3 |date=April 30, 2007 |author1=Grady Booch |author2=Robert Maksimchuk |author3=Michael Engle |author4=Bobbi Young |author5=Jim Conallen |author6=Kelli Houston |isbn=978-0201895513 |publisher= Addison-Wesley Professional}}</ref>
<ref name="Why Natural Scientists Should Care
About Object-Oriented Technology">http://www.literateprogramming.com/quantumoo.pdf</ref>
{{rp|78}} An object can [[model]] some part of [[reality]] or can be an [[invention]] of the [[design process]] whose collaborations with other such objects serve as the mechanisms that provide some higher-level behavior. Put another way, an object represents an individual, identifiable item, unit, or entity, either real or abstract, with a well-defined role in the problem ___domain.<ref name="ooa"></ref>{{rp|76}}
 
A [[programming language]] can be classified based on its support for objects. A language that provides an encapsulation construct for state, behavior, and identity is classified as [[object-based language|object-based]]. If the language also provides [[polymorphism (computer science)|polymorphism]] and [[inheritance (object-oriented programming)|inheritance]] it is classified as [[Object-oriented programming|object-oriented]]. A language that supports creating an object from a [[class (computer science)|class]] is classified as [[class-based programming|class-based]]. A language that supports object creation via a template object is classified as [[prototype-based programming|prototype-based]].
The identity of a dog might be "Rex". It's states may include being happy, black, and [[poodle]]. Rex can engage in behaviors such as [[sleeping]], barking, and eating. An event affecting Rex might be that he is hit by a [[car]]. A [[computer program|program]] containing an object which represents a [[bicycle]] might report such states as [[velocity]] or [[temperature]] and such behavior as [[acceleration|accelerating]] or the like.
 
The concept of object is used in many different software contexts, including:
==The Atomic Object and Encapsulation==
 
* Possibly the most common use is [[Computer memory|in-memory]] objects in a [[computer program]] written in an object-based language.
In the [[atom]]ic view of an object, the variables are considered to be within the [[nucleus]] and surrounded by methods. In other words, the variables and methods are [[encapsulation (computer science)|encapsulated]] within the object.
 
* [[Information systems]] can be [[object-oriented analysis and design|modeled]] with objects representing their components and interfaces.<ref name="ooa"/>{{rp|39}}
==Object-to-Object Communication==
* In the [[relational model]] of [[database]] management, aspects such as [[Table (database)|table]] and [[Column (database)|column]] may act as objects.<ref name=Oppel>{{cite book |first=Andy |last=Oppel |title=SQL Demystified |publisher=McGraw Hill |year=2005| page=7 |isbn=0-07-226224-9}}</ref>
 
* [[Distributed object|Objects]] of a [[distributed computing]] system tend to be larger grained, longer lasting, and more service-oriented than programming objects.
Objects can interact and communicate with each other. If object A wants object B to perform one of B's methods, object A will send a message to object B. Consider a program which models driving aa vehicle, Object A might be you and Object B might be a car. A message from A-B might involve the object being called upon to perform some action (YourCar), the name of the method (or action) to perform (changeVelocity), and a parameter such as (muchFaster).
 
In purely object-oriented programming languages, such as [[Java]] and [[C Sharp (programming language)|C#]], all classes might be part of an inheritance tree such that the root class is <code>Object</code>, meaning all objects instances of <code>Object</code> or implicitly extend <code>Object</code>.
Read on: [[object (philosophy)]], [[object-oriented programming language]], [[object-oriented programming]], [[object-oriented technology]], [[computing]]
 
==See also==
*{{annotated link|Actor model}}
*{{annotated link|Business object}}
*{{annotated link|Instance (computer science)}}
*{{annotated link|Object lifetime}}
*{{annotated link|Object copying}}
*{{annotated link|Semantic Web}}
 
==References==
{{Reflist}}
 
==External links==
*[http://java.sun.com/docs/books/tutorial/java/concepts/object.html ''What Is an Object?''] from ''The Java Tutorials''
 
{{Software engineering}}
{{Data types}}
{{Authority control}}
 
{{DEFAULTSORT:Object (computer science)}}
[[Category:Object (computer science)| ]]
[[Category:Object-oriented programming]]
[[Category:Data types]]
[[Category:Composite data types]]