Business Model Wrapper Protopattern
Intent
How to deploy an object-oriented business model that has no distribution, persistence, and other technologies (a model that is nothing more than technologically dependent upon the language itself and some of the API's that support the building of a rich object model) in a way that the missing qualities it needs to become a fully functional enterprise business application are added without violating the models implementation.
Also Known
As Object Model Wrapper.
Motivation
The key to understanding and properly building an enterprise application is the business processes and entities of the organization. So we focus on modeling that which will drive the application and its development; the business model. The business model becomes the blue print to what the application is all about and is reflected throughout the application. So we focus on the model independent of technologies that usually influence its accuracy and quality.
To ensure accuracy and quality we build and implement a pure object-oriented business model independent of technologies. We then deploy the business model into various technologies by specifying its persistence, remote distribution, or rule firing without violating the models integrity. This is possible by building a wrapper around the business model.
A wrapper is the business models' deployment mechanism. It can be tailored for RMI, relational persistence, CORBA, object-oriented persistence, EJB, rule firing, and so forth. Its entirely possible to deploy with different characteristic at different locations and easily re-deployed with different technologies, but the business model stays intact and less likely to be influenced by changing technologies. Organizational changes and changes in technology become low risk because you have a pure business model that is easily re-deployed.
Applicability
You're building distributed multi-tier applications that are and wish to separate the implementation of the business model from surrounding technologies.
Structure
Participants
Client
Software component that accesses a business model and directly communicates to a business object through an adapter.
Adapter
Client side wrapper for a server side coupling. The adapter [Gamma95] transforms the couplings' remote interface into an interface that looks and behaves exactly like the business object. It also encapsulates and handles the complexities of making remote calls to the coupling; thus, to the client an adapter looks and behaves like a local business object. And it's the deployment mechanism by which the business object can be tailored for specific kinds of clients; for example, deferred update adapters are useful in building GUI clients.
Adapter Manager
The manager [PloP3] encapsulates the management of adapter objects. It provides services for creating, destroying, and querying the adapter objects.
Coupling
A coupling is the business object wrapper and deployment mechanism by which other technologies are coupled to the business object. It's a surrogate [Gamma95] to the business object and a mediator [Gamma95] to the adapter and technology objects. It's also the point at which remote capabilities are coupled to the business object.
Coupling Manager
The coupling manager [PloP3] encapsulates the management of coupling objects. It provides services for creating, destroying, and querying the coupling objects.
Technology Object
Technology objects; through the coupling, extend the business object into other technologies. They are describe the deployment options by which the business model can be wrapped.
Business Object
Models an entity within an organization's business process and the most influencing factor behind the accuracy and quality of an enterprise application.Collaborations
Consequences
Implementation Known
Uses JDBO (Java Distributed Business Objects) is a BMW generator. JDBO automates the process of generating a Business Model Wrapper.
Lattice Works is rule-authoring tool that uses a BMW to surface its business model to remote clients using RMI and provide relational database persistency to the business model. Related Patterns Layers [Frank96] "decomposes an application into groups of subtasks where each group of subtasks is at a particular level of abstraction". BMW has four layers: 1) business model layer, 2) coupling layer, 3) adapter layer, and 4) client layer. The lowest level of abstraction is the business model and the highest level of abstraction is the client.
References
[Gamma95] E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995.
[PloP1] Pattern Languages of Program Design. Addison-Wesley, 1995.
[PloP2] Pattern Languages of Program Design. Addison-Wesley, 1996.
[PloP3] Pattern Languages of Program Design. Addison-Wesley, 1998.
[Frank96] Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, and Michael Stall. Patter-Oriented Software Architecture: A System of Patterns. John Wilely & Sons, 1996.
© Copyright Walt Davis, all rights reserved.