Oracle® Application Development Framework Developer's Guide For Forms/4GL Developers 10g (10.1.3.1.0) Part Number B25947-01 |
|
|
View PDF |
In this walkthrough, you've seen the steps to build a simple, yet complete J2EE application with an MVC architecture using:
Oracle ADF Model for declarative data binding for the model layer
JavaServer Faces with Oracle ADF Faces components for the view layer
JavaServer Faces page flow and declarative handlers for the controller layer, and
Oracle ADF Business Components for the business service layer
The experience was both visual and declarative: you didn't have to write any Java code to achieve the results shown here. In fact, if you were to search the workspace directory for all *.java
files created during the course of the walkthrough, you would see the results shown in Figure 2-37. Assuming you follow the recommended practices for ADF beginners of only generating Java code when you need it, you see that JDeveloper only created four *.java
files. And these files don't even count as "code", since all they contain are the translatable strings related to your ADF business components.
If you were to peek into one of the message bundle files like UserImplMsgBundle.java
, Example 2-1 shows what you would see. It contains the UI control hints you defined for the attributes of the User
entity object, along with the error message strings for the business rule validators. By automatically maintaining these standard Java message bundle files for you, JDeveloper simplifies creating multilingual applications. JavaServer Faces provides a similar mechanism to cleanly separate your translatable strings into separate resource files. At runtime, both JSF and ADF use the most appropriate version of the message resources based on the user's browser language settings.
Example 2-1 UserImplMsgBundle Translatable Control Hints and Errors Messages
public class UserImplMsgBundle extends JboResourceBundle { static final Object[][] sMessageStrings = { { "UserRole_LABEL", "Role" }, { "PostalCode_TOOLTIP", "Zip" }, { "UserRole_Rule_0", "Role must be user, technician, or manager" }, { "Email_Rule_0", "Please use the 8-character username without the domain name" }, { "User_Rule_0", "This user id is already taken. Please choose another." }, { "CountryId_TOOLTIP", "Country" }, { "City_TOOLTIP", "City" }, { "LastName_LABEL", "Last Name" }, { "StateProvince_TOOLTIP", "State" }, { "FirstName_LABEL", "First Name" }, { "Email_LABEL", "Email Address" }, { "StreetAddress_TOOLTIP", "Address" }, { "UserId_LABEL", "User Id" } }; // etc. }
So discounting these message bundle files, you developed the entire walkthrough without writing or generating a line of Java code. This is a testament to the depth and breadth of declarative functionality that the combination of JSF and Oracle ADF can offer you, especially when using the ADF Business Components technology for your business service layer. This concludes the introduction to building J2EE applications with Oracle ADF. The rest of this guide describes the details of building a real-world sample application using Oracle ADF, ADF Business Components, and JSF.