About Structuring Business Component Projects and Packages

Structuring Projects

A business component project is a collection of files grouped together for your convenience. You might want to have several projects in your workspace, with each project optimized for a particular task. For example, your main project would contain all the packages in your business components application; when you compile or deploy your entire project, you would do so from there. For simplicity or to speed up performance, you might have a design-time project that loads only some of the available packages. You might have yet another project that contains only the packages needed to perform a specific task, such as debugging part of the program.

Structuring Packages

A business component package is a Java package containing classes for part or all of a business logic tier. In addition, a business components package has an associated XML file.

Deciding what packages you want in a business logic tier is the same as when you are developing any Java program. Different application feature teams might need to be able to work independently on their functionality. You need to functionally decide what objects to put together in packages according to what methods you want internal team members to use versus what you want external teams to use. If a portion of your product gets delivered together as a component, you probably want to put it in one package.

In a product using business components, you need to decide what business components you want to group in the same package, so they have access to package private methods and variables, and which business components should be in different packages. Business components in separate packages can interact through public methods and variables; you can also reuse the packages in other projects as needed. As a general guideline, you need to decide what "subproduct" your product is made of. Then you can create the following packages in your business components project(s) for each subproduct:

Another consideration is the size of the package. Small packages are loaded faster than very large packages both during development and deployment. JDeveloper has a "lazy loading" feaure that can help speed up performance during development, by loading only the classes needed at that time, rather than all classes in a package.