# What Are Business Components

JDeveloper provides integrated support for the Business Components for Java framework. Using design tools such as wizards and property editors you define the characteristics of objects: their attributes, relationships, and business rules. Then JDeveloper generates executable Java code and XML to implement the behavior you define for the components.

In theory, you could write this code yourself. In practice, though, it's better to use the wizards to be sure that all necessary code is generated and all dependencies are addressed. Then you can edit the generated code to meet the specific needs of your applications. JDeveloper enforces no particular methodology, but the development process typically involves answering questions like these:

- What are the entities and business objects? You can use entity objects on their own (for example, a customer), or you can combine several entity objects (for example, a purchase order consisting of a header, line items, shipments, and distributions).

- How are the entities related? For example, you could define a one-to-many association between departments and employees.

- What are the validation rules? For example, a business rule might specify a minimum salary for employees with more than five years of service. You can apply rules to attributes, entities, and business objects.

- What data will be presented and manipulated? By creating views, you define SQL queries to select and filter data from the entities to minimize network traffic and client-side processing requirements.

### Design time

1. Real-world entities (for example, employees) are used to represent data stored in tables in a database.

2. JDeveloper uses data and metadata from the table to create a Java class that represents the entity. You can edit this Java code to change the default attributes and behavior.

3. JDeveloper also represents metadata in a customizable XML file.

4. JDeveloper can create default View Objects to specify criteria for selecting data. You can define your own View Objects in addition to (or instead of) the defaults.

5. JDeveloper generates customizable Java classes for each View Object: a class for the View definition and a class for the row. It also generates an XML file for each View Object.

6. You use a wizard to define an Application Module. An Application Module is a logical container for related objects. It provides a context for defining and executing transactions.

After the application service comprising the Business Components is designed, built, tested, and debugged, you can deploy it.

### Runtime

1. Client code initializes an Application Module, loading the entities and views it contains.

2. When a View Object executes a query at run time, it manipulates data from the corresponding entity or entities.

3. Each View Object provides a default iterator that you can use to navigate through its result set.

4. When a query fetches one or more result rows, individual rows are represented by Row objects. Each column value in the result row is accessed through an attribute of a Row object.

5. Controls in the client form enable users to view and edit the data. The controls display rows provided by View Objects, which are themselves bound to underlying Entity Objects. So, when a user changes a value in a control, the Business Components for Java framework sends the action to the View Object, which sends it to the Entity Object. Business rules (if any) attached to the Entity Object validate the new value before the framework sends it to the database.

.