Book Home Java Enterprise in a Nutshell Search this book

11.8. Relationship Service

This service allows for the explicit definition of relationships among objects. Relationships are defined in terms of type, roles within the relationship, and the cardinality of each role. An object fulfills a role when it participates in a relationship. You can define an agent/proxy relationship, for example, in which a single object fulfills the agent role and multiple objects serve as proxies for that agent.

The Relationship and Role interfaces are at the heart of the service. RelationshipFactory and RoleFactory objects create Relationship and Role objects, respectively. A RelationshipIterator can iterate through the relationships a given object plays roles in. In addition to these generic relationship interfaces, the service also provides several specific relationship types, in their own modules. Object graphs can be created using the interfaces in the CosGraphs module, containment relationships can be created using the CosContainment module, and reference relationships are defined using the CosReference module.



Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.

This HTML Help has been published using the chm2web software.