Documentum BOF
Documentum BOF
Documentum BOF
The main purpose of BOF is to act as a business logic middleware layer for your
applications. Prior to DFC 5.1, Documentum did not provide any middleware tools. BOF
is Documentum's attempt to give developers a framework on which to add customer-
specific extensions.
Another important thing to note is that BOF was developed and optimized for web-based
applications. There are several features that make it easy to use BOF within an
application server, such as trusted logons and connection pooling. However, you will also
get huge value out of BOF if you are creating a client server application or customizing
the Desktop Client.
Benefits of BOF
There are several benefits of using the Business Object Framework, providing an
enhanced development environment for building and maintaining Documentum systems.
If you are doing any non-trivial Documentum-related development, you are probably
going to want to use Business Objects. Not only will your code be available in multiple
Documentum clients, but you will no longer have to re-integrate your customizations
whenever Documentum releases a new version of the client.
Even if you are not planning to support multiple clients, you should still probably use the
BOF. It forces you to use object-oriented principals and to keep the business logic out of
the GUI layer, both of which are good things. Also, we expect to see the BOF becoming a
more and more important part of Documentum's development methodology, so the
sooner you become familiar with it, the better.
If you are developing a web-based application that accesses a docbase, you will
absolutely want to use the Business Objects Framework. The BOF was created with web
application developers in mind, and there are enough performance improvements and
conveniences offered by the framework that it will certainly be worth your time to learn
about it.
Key Features
Polymorphism
In Documentum 4.x, DFC didn't really support polymorphism (at least not from the point
of view of a developer using DFC to create an application). You could not sub-class DFC
objects or extend their behavior. Clever programmers would get around this by creating
their own objects that implement the same interfaces as the DFC objects. But in this case,
they would have to re-implement every method in the DFC object's interface. This is a
real pain.
However, with the addition of BOF, you can now sub-class DFC objects and extend them
to either override existing methods or add your own methods. You don't have to re-
implement every method - you only need to re-implement the methods that you want to
override.
BOF Page 3 of 5
An object factory is design pattern where one object (the factory) creates other objects.
Factories are used to prevent programmers from explicitly declaring the implementation
class in their code. Instead, programmers declare the interface that they are using and
have the factory instantiate the implementation class.
DFC has always used an object factory to create the Java objects that you use in your
code. You have never been able to create a DFDocument directly, you always have to use
the factory to create one.
The main drawback to this approach is that in version 4.x, even if you were a clever
programmer and rolled your own object that implemented the IDFDocument interface,
there was no way that your object would get used by any existing DFC applications.
Since all the applications used the object factory, and the object factory only created
Documentum's objects, your custom objects would never get created.
In DFC version 5.1, this shortcoming is rectified. You can now tell DFC's object factory
to create your custom objects instead of the normal DFC objects. As a result, existing
Documentum applications such as Desktop Client and WebTop will be able to call all the
custom business logic you include in your custom business objects. This is accomplished
through the use of the Documentum Business Object Registry. If your objects have been
registered with DBOR, the object factory guarantees that your custom object will be
created and used whenever it is appropriate.
Once registered, DFC will automatically create and use your business object whenever it
is dealing with a document object belonging to that custom object type. The object
factory guarantees that this will happen.
To register a business object with an object type, you can use the DborManage tool
provided with DFC or you can manipulate the DBOR registry with a new dbor object in
DFC.
BOF Page 4 of 5
There are two types of business objects, Type-Based Objects (TBOs) and Service Based
Objects (SBOs).
Type-Based Objects
Type-based business objects (TBOs) are the most common types of business objects.
They correspond to custom object types in the Docbase and used to apply custom
business logic to those object types. You create a TBO by extending a DFC object such
as DFDocument.
Type-based objects allow developers to override the typical DFC methods to add
validation logic or change the way that the original methods behave. You can also add
your own custom methods for your own purposes. Because all objects are created via the
object factory, your TBO is guaranteed to be used even by existing Documentum clients.
There are many ways that type-based objects can be used. One of the most common uses
is to apply custom validation logic that goes beyond what the data dictionary provides.
For example, imagine that you have created a custom object type in your Docbase called
a report. This object type has two custom attributes, report_type and report_number. You
have set up value assistance for the report_type attribute, creating a list of the types of
reports your organization creates. This list contains three possibilities: Marketing Report,
Engineering Report, and Research Report. Marketing and engineering reports can have
arbitrary report numbers that are specified by the author of the report. But research
reports must have report numbers that follow very specific rules. In this case, the report
number for a research report must be unique and it must already have been created in the
Research Department's report database
Let's examine how we would enforce this rule using Documentum 4.x. You might first
attempt to use the data dictionary, but this will not work. Unfortunately, the attribute
constraints provided in the data dictionary can not have conditional logic; you can not
have the constraint for report_number depend on the value of report_type. Also, you
can not make the data dictionary fire off a script to check with the research department's
database.
Therefore, in version 4.x, you must customize the properties dialog GUI in order to add
this logic. Unfortunately, you will have to customize the dialog for every application you
use: Desktop Client, Intranet Client, WebPublisher, etc. And each time that Documentum
upgrades one of these applications, you will have to re-integrate your customizations into
the new version.
In version 5.1, however, enforcing these validation rules is much easier. You would
simply create a business object java class to represent your report. To do this, you extend
BOF Page 5 of 5
the existing DFDocument object. To insert your custom validation logic, you re-
implement the save() and checkinEX() methods, adding your custom code to check for
uniqueness and query the external database. Don't forget to call the superclass method to
actually do the save or checkin once the validation is complete. After you register this
object with the DBOR, all of the existing Documentum clients will begin to use your new
code. You don't have to make any GUI modifications at all.
Service-Based Objects
A service-based business object doesn't map to a particular object type in the Docbase.
Instead, it provides general purpose functions for your application to use. Service-based
objects can be used across docbases, even accessing multiple docbases at once. These
service-based objects are intended to be called from your own custom GUIs or as
convenience functions from within your type-based objects.
Service-based objects were designed and optimized for multi-user, mutli-threaded, multi-
docbase web applications.
Currently, there are not many service-based objects being provided by Documentum.
However, in the future, this will change. For example, all of the business logic in
WebPublisher 5.1 is being developed using BOF. This means that developers will be able
to override the existing WebPublisher SBOs with their own to change the behavior of
WebPublisher.
For example if there is a requirement where you have to validate the name of a document,
like making sure hat the document name is unique in the docbase. For this requirement
we need to implement the functionality in different components like Import, Create new,
Properties components where ever the user get access to modify the document name. In
this case, instead of writing the code in all the components, we can just create a service,
which will validate the name of the document. Use this service wherever you want to
implement this functionality.