The proposed package is designed with n-tier component architecture. There is an effort to make components as independent as possible. This components independence not only allows us to build a maintainable and scalable system but also allows us to swap out components without affecting the whole system. Also, there is an effort to use and implement design patterns and J2EE best practices. Before we go into details of packages, let us define few jargons.
Compile Order: It defines where the package is in its hierarchy of compilation. A package containing classes that compile independent of other packages of the system is given 1. For example, the util package containing utility classes compiles independent of other packages of the system. Similarly, the common package containing common classes to client and server depends only on util package for compilation. This package has order of 2.
We can categorize packages in layered architecture as n-tier component architecture. At an application level, there are two layers of Compile Orders. Those are base layer that contains library classes, and client/server layer that contains client component packaged in client package and server components packaged in server package.
A server package can be further categorized into four layers according to n-tier component architecture and component functions. Those package layers are as follows:
• Base package layer: The layer containing library classes for all server components with compile order of 1 and 2
• Persistence / Validater layer: The layer contains persistence package with compile order of 3, containing classes involved in data persistence; and Validater package with the compile order of 3, containing classes that contain business rules for validating data and business logic.
• Domain service layer: The layer has the business components of the system. This layer has compile order of 4 that means it depends on Persisence/Validater and Base layers for compilation.
• Façade / Adapter layer: This layer contains classes that are gateway to the server side connecting external systems and clients (GUI) to Domain service layer. This layer has compile order of 5.
We described package layer architecture. Now, we explain details of each layer. We start we base layer of application and then move to server layers in which also we start we base layers to top most layers describing why and what is the convention and basis in designing the packages.