Introduction to the Oracle ADF Framework)

Source: Internet
Author: User

This section describes the structure and key functions of the Oracle ADF framework, and highlights the typical process of developing Web applications using Oracle ADF, EJB, Oracle toplink, and jsf in the jdeveloper 10g ide tool.

 

1
Introduction to Oracle ADF framework

 

Oracle Application Development Framework is an end-to-end application framework built on J2EE standards and open-source technology. It is used to simplify and accelerate the construction of service-oriented web applications. For example, to develop enterprise-level solutions, you must use web, wireless networks, desktop applications, web services, and other interfaces to search, display, create, change, and update data, oracle ADF can simplify your work. Currently, Oracle jdeveloper 10 Gb can be combined with Oracle ADF, improving the development speed.

 

2
Architecture and supported technologies of the Oracle ADF framework

 

Using Oracle ADF can achieve a clear separation model, view, and controller, which fully implements the MVC design mode. The Figure1-1 shows the position of each ADF module in the framework architecture. The central module in this architecture is the data binding tool for JSR-227 specifications-Oracle ADF model, which can bind any user interface to any business service in a unified way without any code. Other Oracle ADF modules include:

 


Oracle ADF controller integrates struts and JSF.

 


Oracle ADF faces provides a component library for creating web applications using JSF.

 


Oracle ADF swing uses swing to extend the Oracle ADF model to desktop applications.

 


Oracle ADF Business Components allows developers to use the 4gl tool to simplify the establishment of business services, such as Oracle Forms.

 

 

 

3
View layer Technical Support

 

The view layer is the place where the user interface is designed and can be developed using technologies such as JSP and JSF. Of course, you can also use the swing Component Library in desktop applications. Either way, WYSIWYG (WYSIWYG as WYSIWYG) is used to bind the drag-and-drop (drag-and-drop) data. However, choosing JSF is the best option, because the ADF faces module provides a complete component library of nearly 100 JSF components.

 

The ADF faces Component Library contains complex features, such as skin Replacement Technology and Ajax technology.

 

 

 

4
Control Layer Technical Support

 

The control layer is a key service for processing web application page streams. Oracle ADF integrates the popular Apache Struts Framework and the JSF framework with built-in page navigation functions. Regardless of the Framework, jdeveloper provides a visual page flow chart to design the page flow, in addition, in the page processing cycle of the control layer, the ADF controller module also provides a suitable plug-in to integrate into the ADF model data binding tool.

 

 

 

5
Business Service technologies supported by the ADF model

 

At the model layer, the Oracle ADF model implements the abstract service called Data Control in the JSR-227, and provides out-of-box data control technology to implement most common business services. Supported technologies include:

 

■ EJB Session Bean
Because most J2EE applications require transaction processing services, EJB Session Bean is a logical choice because it provides open transaction processing control. After the EJB session bean of the service, you can use a Java object (pojos) or an EJB Entity Bean to represent the business domain object. Jdeveloper provides integrated functions that support creating EJB session beans, generating an initial session appearance tool, and creating Java classes or entity beans. You can also use ORACLE toplink to configure the Orm.

 

 

 

■ JavaBeans

 

 

 

■ Web Services
When your application needs to list standard web service interfaces, you only need to provide the Oracle ADF with the URL associated with the web service. The description language of the service endpoint is bound to the interface that interacts with the user, and the result is displayed.

 

 

 

■ XML

 

 

 

■ ADF application modules
These services are the features of the ADF business component module, which can automatically execute business rules to list the datasets of SQL query results that can be updated.

 

The ADF is an end-to-end framework. Like spring, it provides support at every layer of the enterprise application architecture. Shows the architecture of the ADF: each layer has some of its components. This time I want to talk about the data binding of the ADF, because it isolates the business logic layer and the web layer, making the two layers more independent. However, the ADF seems to be too complex, making it difficult to get started. The key concept of data binding in the ADF is as follows: Data Control is the abstraction of business interfaces. That is to say, all methods for accessing business objects are now implemented through data control, this allows the binding layer to access data in one way, regardless of the background data object. Data control can be viewed as a proxy mechanism. Iterator bindings and control bindings: binding is a lightweight object. Its main purpose is to decouple background data from Foreground Data, let's see how the ADF works. Iterator binding cooperates with data control that provides collection object data. Control bindings provides a standard interface for the user interface to process collection objects or call business methods. Binding containers: the binding container object records which iterator binding and control binding are used on a user interface. An XML file records the content and produces a binding iner at runtime. Binding context: binding context is a larger concept than binding iner. It contains all binding iner and data control information. Next we will introduce a simple application blueprint: this application is like this. Now there is a forum where a page is used to review some threads and specify a team to reply to it, this page is called reviewthreads. JSP. This page needs to obtain data from the background forumservice and specify the team to reply. forumservice is an application module component (the application module component is an abstraction of the business logic. It can be implemented as Java class, EJB, WebService, and so on, it also has its own method to call the view object. Here you only need to think of it as a business component ). In addition, a drop-down box for all available teams is required for this page. The data in this drop-down box comes from a Web Service lookupcodes. Each business component has a data control that encapsulates the business methods of the component. The binding context of the application contains two binding iner, reviewthreads, and unansweredpostings. The former is provided for reviewthreads. jsp, while the latter supports uix pages (uix is an XML-based interface language) and a swing panel of jclient. The reviewthreads binding container contains the following binding: 1. Three iterator bindings pointing to the data set used by the application. Two are provided by forumservice, one is provided by lookupcodes, and the other is provided by lookupcodes. three Control bindings that support elements on the interface are first an attribute control binding, which is used to display the Forum name in the name input box on the page, and then a list binding to support a range binding in the drop-down box. supports displaying team objects in jstl. 3. A control binding is used to call a method of forumservice to specify that the team replies to the thread. It should be noted that the control value bindings needs to obtain their data through the iterator binding. In particular, List Value binding requires two iterator bindings at the same time. One is used to obtain the values in all lists, and the other is used to provide the values selected in lists. Describes how the above components work together at runtime. A binding context contains one or more data control and binding container. Each binding container has one or more iterator bindings that specify the data set used by the page. Each iterator binding obtains and changes data from a specific data control. Binding container also has one or more control bindings to support page control. When the control binding needs to be bound to data, an iterator binding is required. If it is a control action binding, for example, the binding associated with the submit key on the page will be associated with a data control to call the service layer method.

As a solution specifically developed by Oracle to simplify the complexity of J2EE program development, the ADF simplifies the development difficulty of J2EE by reducing the amount of code that implements the design mode and application framework. Its advantages are mainly reflected in the following four aspects:

(1) Development Environment: Most J2EE frameworks do not have any supporting development tools. Oracle provides jdeveloper development tools for the ADF, which perfectly integrates with the ADF, it facilitates program development.

(2) independent platform: The ADF can run on any J2EE-compliant application server.

(3) Technology Selection: developers can use the technology they are good at to develop different layers of applications.

(4) end-to-end solution: the ADF not only focuses on a layer of the application, but also provides a complete solution for each layer of the application.

Architecture of Oracle ADF

The architecture of the Oracle ADF is based on the MVC design mode, as shown in architecture 1. From figure 1, we can see that the application is divided into four layers, and we will introduce them separately:

1) Business Service Layer

The business service layer consists of three small layers (see figure 1): the persistent business objects, the data access layer, and the interface layer (ADF application module ). The order of the three layers is as follows. First, the object (entity object) of the persistence layer is established, then the view object (viewobject) of the data access layer is established, and finally the interface layer is established. Objects in the persistence layer are mainly associated with tables or synonym objects in the database. viewobject in the data access layer is based on object objects in the Object layer, the interface layer is the interface of the entire business service layer and model layer. view objects created at the data access layer must be registered in the interface layer, in this way, access is only available at the model layer.

2) model layer

This layer consists of two parts (see figure 1): The ADF bindings and the ADF datacontrol. The ADF bindings is a binding technology provided by the ADF, ADF dataconrol refers to the view object (viewobject) that we have registered in the interface layer ). In actual development, developers do not need to do much work.

3) controller Layer

In the Controller layer, the ADF extends the Struts Framework of the Apache Foundation. It provides a page flow chart for struts to simplify application development. Developers can drag struts components to the chart, which automatically updates the Struts-config.xml file synchronously. The most commonly used is the datapage component, this component is mainly used to create a page and automatically create a dataforwardaction for it. If we have some custom methods, we can also write an action and overwrite dataforwardaction.

4) view layer

The view layer can adopt the uix Technology of Oracle, which defines a large number of powerful components. Oracle jdeveloper provides a visual layout editor at the view layer. developers can use the component panel to add visual components to applications and use the property inspector editor) to define the attributes of these components. The visual editor is synchronized with the source code, so developers can choose their preferred development method.

  
Figure 1 architecture of Oracle ADF

Application Development Process

The following is a brief introduction to the specific implementation process of the ADF. We chose Oracle's jdeveloper10g as the development tool. Among the various development tools currently, jdeveloper is the best tool to support the framework of the ADF, it directly integrates various tools required during the development of the ADF, which brings great convenience to the development. Take the "bidding for equipment in a contract management system" module as an example.

Step 1: In jdeveloper, create a workspace named testproject. In the application template, select Web application (default), as shown in Workspace 2 after confirmation, according to the architecture described above, we first establish the persistence layer object of the business service layer, right-click the new project on the top of the model, and then select the business component under the Business tier, select entityobject, and then figure 3 is displayed. schema object allows us to select tables, synonyms, and other objects in the database. Name is the name of the created persistent layer object, here we name the name cdtequipmenteo, and Package specifies the package under which this object is placed.

  
Figure 2 created workspace testproject

  
Figure 3 entityobject wizard Step 1

Step 2: After the object of the persistence layer is created, we need to create a view object (viewobject) in the data access layer ). Right-click model and choose new viewobject. Figure 4 is displayed. On the left side, select the existing object (entityobject) of the persistent layer. In this example, select the newly created object cdtequipmenteo.

  
Figure 4 step 2 of the viewobject wizard

Step 3: Create an interface layer (applicationmodule) and register the viewobject in the data access layer to applicationmodule. As shown in step 5, select the view object cdtequipmentview1, and add it to appmodul1.

  
Figure 5 applicationmodule creation wizard

Step 4: According to the ADF architecture, we basically don't need to do any work on the model layer. Then we will start to build the Controller layer. First, we need to create a datapage, either in uix format or JSP, here we use uix format. In the Struts-config.xml, from the component on the right, you can directly select datapage, drag it over, listequipment is our given name.

  
Figure 6 struts_config.xml Section

Step 5: After the Controller layer is created, you need to set up the display layer (View) in listequipment. set the page layout on the uix page. You can drag and drop the view in datacontrol. 7. Select cdtequipmentview1 in the Data Control Panel. This is the view we just created, select the read-only table as the drag type below.

  
Figure 7 listequipment. xml cross section

Step 6: Click the listequipment. uix file and select Run (as shown in Figure 8) to directly obtain the data of all devices. The running result is shown in Figure 9.

  
Figure 8 struts_config.xml Section

  
Figure 9 run

Conclusion

In July 10g, the combination of the ADF framework enables developers to build J2EE applications and web services from scratch. Because of the high combination of the Oracle ADF and the excellent technologies provided in it, the development of applications becomes very simple and convenient, which greatly improves the development efficiency of applications and has high application value.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.