Checksum Aspect – Part 1

Aspects are part of the BOF (Documentum’s Business Object Framework) along with TBOs and SBOs.  Aspects are a Java programming  mechanism for adding behavior and/or attributes to instances of objects in the repository without changing their type definition. This allows common functionality and metadata to be applied to dissimilar object types.  Aspects are late-bound to objects (meaning after they are instantiated) and can be added or removed at any point in an object’s lifecycle.  Aspects are used internally by many Documentum applications including Retention Policy Services (RPS), Business Process Manager (BPM), Documentum Collaboration Services (DCS), and the tracing facility to name a few.  Aspects are saved in the repository as dmc_aspect_type objects.  They are written in a way very similar to TBOs and extend base object types (e.g., DfDocument) and implement their own interfaces.

A few things to note about Aspects in Documentum:

  • A persistent object instance may have multiple, uniquely named Aspects with or without attributes.
  • Different object instances of the same persistent type may have different sets of Aspects attached.
  • An Aspect attached by one application will customize the instance across all applications.

These are mixed blessings. On one hand, Aspects allow you to add metadata and behaviors to dissimilar object types from dissimilar applications in the same repository. On the other hand, this ability makes debugging a nightmare. Where exactly is the functionality defined that I am trying to debug? The application? The object model? A TBO? An Aspect in another project altogether?

Some additional things to keep in mind while working with Aspects:

  • To attach an Aspect, you cast your object to an IDfAspects type and use the attachAspect() method.
    ((IDfAspects) my_obj).attachAspect(“my_aspect”,null);
  • To work with the Aspect attached to my_obj you must re-fetch the object immediately after applying the Aspect.
    my_obj= (IDfDocument) session.getObject(my_obj.getObjectId());
  • To detach an Aspect, you cast your object to an IDfAspects type and use the detachAspect() method.
    ((IDfAspects) my_obj).detachAspect(“my_aspect”,null);
  • To get a list of Aspects attached to an object, use the IDfAspects.getAspects() method
    IDfList list = ((IDfAspects) my_obj).getAspects();
  • To get or set an Aspect attribute you can use the DfSysObject getters and setters, but the attributes must be identified using the Aspect name, like this:
    my_obj.setString("my_aspect.my_string_attr1","first value");
    int num1 = my_obj.getInt("my_aspect.my_number_attr1");
  • To execute Aspect behavior, you must cast your DfSysObject to the Aspect interface type and then call the method.
    ((Imy_aspect) my_obj).runMyBehavior();
  • Aspect attributes can also be queried in DQL as long as their names are qualified with the Aspect name.
    SELECT *, my_aspect.my_string_attr1 FROM my_object_type WHERE my_aspect.my_number_attr1 = 0;
  • By default, Aspect attributes are NOT full-text indexed, but can be by using the ALTER command
  • Aspect attributes DO NOT displayed in Webtop.

In the next post we will start to look at my code for implementing the checksum Aspect.


About Scott
I have been implementing Documentum solutions since 1997. In 2005, I published a book about developing Documentum solutions for the Documentum Desktop Client (ISBN 0595339689). In 2010, I began this blog as a record of interesting and (hopefully) helpful bits of information related to Documentum, and as a creative outlet.

4 Responses to Checksum Aspect – Part 1

  1. Deepak Shivnani says:

    Thanks, that you posted on linkedin.While reading your first post was trying to figure out how to track this article for any updates.

    Thanks once again for the good articles.



  2. Scott says:

    Thanks, and thanks for the feedback about LinkedIn. You can always follow this article — and the whole blog for that matter — by subscribing to the RSS feed in the upper right corner (orange square).


  3. Pingback: Checksum Aspect – Part 2 « dm_misc: Miscellaneous Documentum Tidbits and Information

  4. Pingback: Checksum Aspect – Part 0 « dm_misc: Miscellaneous Documentum Tidbits and Information

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: