Well-designed enterprise objects are reusable. That is, if you do not use SQL, access layer classes (besides EOUtilities), or WebObjects classes (com.webobjects.appserver) in enterprise object classes, your enterprise objects will be reusable.
The best way for multiple applications to share the same business logic is to build a framework. This framework holds custom Java classes generated by EOModeler and .eomodeld files. By using a framework, changes to enterprise object classes in that framework and to the model are picked up by all applications that use the framework.
To build a framework, make a new project of type WebObjects Framework (see the document Project Builder for WebObjects Developers for more information on project types). Then, add business logic classes and other resources to it.
The only tricky part is assigning classes and resources to the correct targets. Model files and server-side business logic classes should be assigned to the Application Server target, while client-side business logic classes should be assigned to the Web Server target. If you’re not building a three-tier desktop application, you’ll only have server-side business logic classes. See the document Project Builder for WebObjects Developers for more information on targets in WebObjects projects.
Last updated: 2007-07-11