Object–relational mapping: Difference between revisions

Content deleted Content added
Lexspoon (talk | contribs)
m Fixed a link to the wrong kind of garbage collection
It does not pertain to this page whether there are free or paid tools. This page should be a definition of ORM.
Tags: Mobile edit Mobile web edit
Line 3:
{{Refimprove|date=May 2009}}
{{short description|Programming technique}}
'''Object–relational mapping''' ('''ORM''', '''O/RM''', and '''O/R mapping tool''') in [[computer science]] is a [[Computer programming|programming]] technique for converting data between a relational database and the heap of an [[object-oriented]] programming language. This creates, in effect, a virtual [[object database]] that can be used from within the programming language. There are both free and commercial packages available that perform object–relational mapping, as well as many custom solutions used within a single codebase.
 
In [[object-oriented programming]], [[data management|data-management]] tasks act on [[object (computer science)|object]]s that combine [[scalar (computing)|scalar]] values into objects. For example, consider an address book entry that represents a single person along with zero or more phone numbers and zero or more addresses. This could be modeled in an object-oriented implementation by a "Person [[Object (computer science)|object]]" with an [[attribute (computing)|attribute/field]] to hold each data item that the entry comprises: the person's name, a list of phone numbers, and a list of addresses. The list of phone numbers would itself contain "PhoneNumber objects" and so on. Each such address-book entry is treated as a single object by the programming language (it can be referenced by a single variable containing a pointer to the object, for instance). Various [[Method (computer programming)|methods]] can be associated with the object, such as methods to return the preferred phone number, the home address, and so on.