Skip Headers

Oracle® Application Developer's Guide - XML 10g (9.0.4) Part Number B12099-01 |
Home | Contents | Index

# 12
Building BC4J and XML Applications

This chapter contains the following sections:

- Introducing Business Components for Java (BC4J)

- BC4J Features

- Building BC4J XML Applications in JDeveloper

## Introducing Business Components for Java (BC4J)

Oracle Business Components for Java (BC4J) is a Java, XML-powered framework that enables development, portable deployment, and flexible customization of multi-tier, database applications from reusable business components.

#### Maps XML Messages

The Business Components for Java (BC4J) framework provides a general, metadata-driven solution for mapping E-commerce XML Messages into and out of the database.

#### Test BC4J Applications using JDeveloper

You can use Oracle BC4J framework and Oracle JDeveloper 's wizards and component editors to assemble and test application services from your reusable business components.

In JDeveloper, you can also customize the functionality of existing Business Components by using the visual wizards to modify your XML metadata descriptions.

See Also: Chapter 11, "Using JDeveloper to Build Oracle XML Applications" Oracle9i Java Developer's Guide http://otn.oracle.com/products/bc4j

## BC4J Features

BC4J features include the following:

- Write Once, Deploy Anywhere

- A 100% Java application framework for building component-based, multitier enterprise applications

- Easily separate business logic and user interface (UI)

- Easily customize using extensible markup language (XML) and Java

- Helps automate complex database interactions

- Allows you to flexibly map hierarchies of SQL-based "view components" to underlying business components that manage all application behavior (rules and processes) uniformly.

- Supports *dynamic* functionality, such that features can be driven from XML metadata.

- You can build a layer which maps any XML document in and out of the database using this framework; when these XML Documents are used in the system, they will automatically have all the same business rules validated.

### BC4J Advantages

BC4J has the following advantages:

- Reusable business logic

- Entities encapsulate business logic

- Associate and compose business components

- Flexible, updateable SQL-based views

- Optimized data retrieval and caching

- Automatically coordinated with business logic

- 100% pure Java

- Local, remote CORBA and EJB session bean support

#### Flexible Deployment

BC4J-developed services can then be deployed as CORBA Server Objects or EJB Session Beans on enterprise-scale server platforms supporting Java technology.

The same server-side business component can also be deployed without modification, as a JavaServer Pages/Servlet application or Enterprise JavaBeans component.

This flexibility, enables you to reuse the same business logic and data models to deliver applications to a variety of clients, browsers, and wireless Internet devices without needing to rewrite code.

## Building BC4J XML Applications in JDeveloper

The Business Components for Java (BC4J) framework in JDeveloper9i uses XML to define the metadata that represents the declarative settings and features of the objects. Custom or complex business logic can be implemented in Java.

- The BC4J Tester enables you to see data in view objects as XML.

- Business rules, such as validation rules, are stored in XML rather than Java source code

- Easy customization of business applications by changing XML rather than Java source code

- Applications are easier to read and understand by abstracting the logic in XML

##### BC4J uses XML to Store Metadata

The business components for Java framework that ships with JDeveloper uses XML to store metadata about its application components. Important information is now stored in a structured document rather than in Java source code. This makes the application easier to understand and customize.

The application is now customizable without having access to the source code.

Figure 14-1 shows how BC4J is used with XSQL servlet to generate XML documents.

#### Figure 12-1 Using Business Components for Java (BC4J)

Text description of the illustration adxml086.gif

Business rules can be changed on site without needing access to the underlying component source code.

### Building XSQL Clients with BC4J

In JDeveloper9i, you can build XSQL Pages which can integrate with BC4J application modules and thereby serve application logic from the middle tier to multiple clients. You can retrieve XML data and present it to any kind of a client device just by applying the corresponding stylesheet.

See Also: Chapter 11, "Using JDeveloper to Build Oracle XML Applications" Oracle9i Java Developer's Guide Oracle9i Case Studies - XML Applications

### Ease of Code Generation and Management when Building XML and Java Applications

The following lists some typical JDeveloper code requirements when using the BC4J framework to build an XML application:

- A .java file and a .xml file for each entity object and each view object

- A .java file for each association object and each link object

- A .java file and a .xml file for the application module

- Double-click any of these files in the JDeveloper navigator to view the file contents.

The BC4J framework represents each Business Component that uses a combination of XML and Java code.

- XML. The XML code defines the metadata representing declarative settings and features of the object.

- Java. The Java code implements the object's behavior.

Other typical generated files are:

- Java implementation of the entity

- View XML file

- Java implementation of the view

- Application module XML file

- Java implementation of the application module

| Copyright © 2001, 2003 Oracle Corporation. All Rights Reserved. |
Home | Contents | Index