# Introducing Business Components for Java

Business Components for Java is JDeveloper's programming framework for building multi-tier database applications from reusable business components. Such applications typically consist of:

- A client-side user interface written in Java and/or HTML

- One or more middle-tier components that provide business logic and views of business objects

- Tables on the database server that store the underlying data

This figure illustrates an example of a multi-tier configuration.

The following figure compares client/server and multi-tier applications. A typical client/server application stores business rules, views, and custom code in client-side forms. Clients can quickly become thick with code and hard to maintain. For example, if a rule changes (as when the minimum salary is raised), developers must update every form that uses the rule.

In contrast, a multi-tier application built with the Business Components for Java framework deploys views, business rules, and custom code in components that clients can share. With the Business Components for Java framework, such components are easy to build and maintain, easy to use and reuse, and easy to customize. Components do not need modification to be deployed to any supported platform. This approach provides many features and benefits, including:

Feature | Description
Encapsulated business logic | Business logic, including validation, resides and executes in the middle tier, enabling truly thin clients, easy customization, and reuse.
Flexible views of data | Views of data are SQL-based and completely separate from the underlying entities, enabling flexible presentation schemes.
Thin clients | Business Components for Java supports thin clients--simple windows to business logic and views of data processed by the middle tier.
Flexible deployment | Deploy locally or on standard server platforms as CORBA server objects and EJB Session Beans.
Database interaction | Business Components for Java's component-based framework handles many repetitive coding tasks, such as master-detail coordination and locking.
Transaction management | Business Components for Java manages changes in its cache and handles posting of changes to the database.

Business Components for Java comprise a framework for building and customizing domain-specific components. As a developer, you derive objects from the classes and interfaces provided by the framework and add custom code to implement features specific to your application. The following Business Components are used to support this process:

Object | Description
Entity Object | An Entity Object encapsulates business logic for a database table, view or synonym. Clients access an Entity Object's data through one or more View Objects. A given Entity Object can be used by any number of View Objects. Relationships between Entity Objects are expressed using Associations.
View Object | View Objects use SQL queries to specify filtered subsets of attributes from Entity Objects. Clients manipulate data by navigating through the result set, getting and setting attribute values. Relationships between View Objects are expressed using View Links.
Application Module | An Application Module is a logical container for instances of View Objects, View Links, and transactions specified by other Application Modules.

Each Business Component you create is represented by an XML file and one or more Java files. The XML file stores metadata (the descriptive information about features and settings of an application you declare using wizards at design time), while the Java file stores the object's code (which implements application-specific behavior). Each object is organized into a package using the directory-based semantics of packages in Java.

For example, the files `DeptView.xml` and `DeptViewImpl.java` are in the package `d2ePackage` because they reside in the directory `d2ePackage`:

In the Business Components for Java framework, you select a package, and its code is correctly located for you.

The Java and XML files that represent Business Components use a similar syntax to identify the package they reside in, as shown below.

Java | XML
    package d2ePackage;
    ...
      public class DeptViewImpl extends
     oracle.jbo.server.ViewObjectImpl {
      ...
      }
    <ViewObject
       Name="DeptView"
       ...
    ComponentClass="d2ePackage.DeptViewImpl">