The DBMS allows users to store and retrieve objects of type jpeg image, just like an object of any other type, such as integer. New atomic data types usually need to have type-specific operations denfied by the user who creates them. For example, one might define operations on an image data type such as compress, rotate, shrink,and crop.
The combination of an atomic data type and its associated methods is called an abstract data type,or ADT. Traditional SQL comes with built-in ADTs, such as integers (with the associated arithmetic methods), or strings (with the equality, comparison, and LIKE methods). Object-relational systems include these ADTs and also allow users to dene their own ADTs.
The label `abstract' is applied to these data types because the database system does not need to know how an ADT's data is stored nor how the ADT's methods work. It merely needs to know what methods are available and the input and output types for the methods. Hiding of ADT internals is called encapsulation.
In the case of integers, the standard methods for the ADT are the usual arithmetic operators and comparators. To evaluate the addition operator on integers, the database system need not understand the laws of addition|it merely needs to know how to invoke the addition operator's code and what type of data to expect in return.
In an object-relational system, the simplication due to encapsulation is critical be-cause it hides any substantive distinctions between data types and allows an ORDBMS to be implemented without anticipating the types and methods that users might want to add. For example, adding integers and overlaying images can be treated uniformly by the system, with the only significant distinctions being that different code is invoked for the two operations and differently typed objects are expected to be returned from that code.