Aspects, the new member in the BOF family is one among the new additions to the Documentum 6 (D6). This short notes are just to give you insight to the fundamentals of Aspects.
What is Aspects?
In simple words Aspects are like TBO’s but they are not associated with any object types. That means you can attach or detach an Aspect at runtime to any object type. In other words Aspects are a mechanism for adding behavior and/or attributes to a Documentum object instance without changing its type definition (From DFC Study Guide)
Aspects like any other BOF types are stored in the repository. When a DFC runtime requests for a Aspect it will be downloaded to that system and used. Aspect belongs to the type dmc_aspect_type.
Aspects are saved in /System/Modules/Aspect in the repository which has a global registry. If any changes are made to any aspects DFC runtime detects that and downloads the latest version to its local cache of BOF.
What Aspects can do?
Aspects are different from other BOF’s because it is attached to the Object instance, not to the object types. They are not a per-application customization. Any Persistent object instance can have multiple aspects attached to it if each aspect has a unique name.
Aspects define custom additional fields and it can set custom values to the fields of any object that of type persistent object. There are no restrictions for the type of and number of attributes that you can create on an aspect. It can be of any supported types and be either a single value or a repeated value attributes.
Another aspect can access the Attributes defined in one Aspect. The Fully qualified aspects attributes are aspect_name.aspect_value. When you fetch an Object all values of attributes of attached aspects are also fetched. If you destroy an object it also deletes the attributes in the attached aspect.
Where Can I use it?
Aspects are used when you have a cross type functionality to be defined. When you create a application infrastructure or a corporate platform Aspects are the best way to implement business functionality which is common between different object types. When you have some functionality that is per instance based then also Aspects is the solution.
Lets see a real time scenario where you can use Aspect.
Lets imagine a scenario where you have system, which has user base of different countries, depending upon the country where a user belongs the behavior and fields of the application changes. You can create different aspect, which has the country specific behaviors and fields, and attach it as needed. If the user changes from one country to another simply remove the old country aspect and attach the new country aspect.
To be Continued ….