In this chapter, we've taken a high-level look at J2EE architecture. We've considered:
The advantages and disadvantages of adopting a distributed architecture. Distributed apps are more complex, harder to implement, test, and maintain than apps in which all components are collocated. Distributed apps can also exhibit disappointing performance, unless designed carefully. However, distributed apps can be more robust and scalable in some cases and a distributed architecture may be the only way to meet some business requirements. Thus deciding whether to use a distributed architecture is an important decision that should be made early in the project lifecycle. It's best to avoid a distributed architecture unless it delivers real advantages.
Database portability. While J2EE can deliver portability between target databases, this does not always produce business value. Thus database portability may not justify any sacrifices in terms of performance or productivity.
Web app with business component interfaces
This is a simple, performant architecture that meets the requirements of many projects. Although it does not use EJB, it still delivers a clean separation between business objects and web-tier components. A layer of business component interfaces exposes all the app's business logic to web-tier components.
Important |
Good OO design practice is fundamental to a sound architecture. J2EE technologies should be applied in pursuit of a sound object model, and should not dictate the object model itself. |