UnderstandingObjectClasses

Overview#

Object Classes#

Object classes are essentially named sets of attribute types that may be used to control the type of data that may be stored in entries. Note that the terms "object class" and "objectclass" (i.e., with and without a space between the words) are generally used interchangably.

The Object Class Description Format#

The object class description format is described in RFC 4512, section 4.1.1. The definition is as follows:

     ObjectClassDescription = LPAREN WSP
         numericoid                 ; object identifier
         [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
         [ SP "DESC" SP qdstring ]  ; description
         [ SP "OBSOLETE" ]          ; not active
         [ SP "SUP" SP oids ]       ; superior object classes
         [ SP kind ]                ; kind of class
         [ SP "MUST" SP oids ]      ; attribute types
         [ SP "MAY" SP oids ]       ; attribute types
         extensions WSP RPAREN

     kind = "ABSTRACT" / "STRUCTURAL" / "AUXILIARY"

The elements of the object class description include:

The numeric OID used to uniquely identify the object class in the server. Although the specification requires a numeric OID, OpenDS also allows a non-numeric OID for the purpose of convenience and better compatibility with the Sun Java System Directory Server. In this case, the non-numeric OID should be the same as the name of the object class followed by the string "-oid".

For example, the following is the object class description for the standard person object class:

( 2.5.6.6 NAME 'person' SUP top STRUCTURAL MUST ( sn $ cn )
              MAY ( userPassword $ telephoneNumber $ seeAlso $ description )
              X-ORIGIN 'RFC 2256' )

In this case, the OID is "2.5.6.6". There is a single human-readable name of "person". The superior class is "top". The kind is "STRUCTURAL". Any entry containing the person object class will be required to include the sn and cn attributes, and will be allowed to include the userPassword, telephoneNumber, seeAlso, and description attributes. The object class definition was taken from RFC 2256. There is no description, and the object class is not considered "OBSOLETE".

Object Class Kinds#

As described above, all object classes must have a kind of either "ABSTRACT", "STRUCTURAL", or "AUXILIARY". These object class kinds may be described as follows:

The model represented by object class kinds translates very neatly to the model used by the Java programming language. Abstract LDAP object classes map directly to Java abstract classes, auxiliary LDAP object classes map directly to Java interfaces, and structural LDAP object classes map directly to Java concrete (non-abstact) classes. Just as Java classes must extend exactly one superclass but can implement any number of interfaces, so must LDAP entries contain exactly one structural class chain but can include any number of auxiliary class chains. Similarly, just as it is not possible to directly instantiate an abstract Java class, it is also not possible to create an LDAP entry containing only abstract object classes.

Note that the Sun Java System Directory Server has never enforced many of the restrictions noted here around object class kinds. In particular, it would allow the creation of entries that did not contain any structural object class chain, and would also allow the creation of entries containing multiple structural object class chains. This means that some deployments using the Sun Java System Directory Server may contain entries that violate this constraint. OpenDS will not allow this behavior by default, but for the sake of compatibility with existing Sun Java System Directory Server deployments, it will be possible to configure OpenDS to allow entries to violate this constraint, optionally writing a message to the server's error log each time this condition is detected. Note, however, that if there are entries that do not contain exactly one structural object class, then some schema elements like name forms and DIT content rules which depend on this constraint may not work as expected in all cases.

Object Class Inheritance#

As specified in the above description, object classes can have zero or more superior classes. If an object class references a superior class, then all of the required and optional attributes associated with that superior class are also associated with the subordinate class.

The following restrictions exist for object class inheritance:

More Information#

There might be more information for this subject on one of the following: