Book Image

Oracle ADF Real World Developer's Guide

By : Jobinesh Purushothaman
Book Image

Oracle ADF Real World Developer's Guide

By: Jobinesh Purushothaman

Overview of this book

Oracle ADF in combination with JDeveloper IDE offers visual and declarative approaches to enterprise application development. This book will teach you to build scalable rich enterprise applications using the ADF Framework, with the help of many real world examples. Oracle ADF is a powerful application framework for building next generation enterprise applications. The book is a practical guide for the ADF framework and discusses how to use Oracle ADF for building rich enterprise applications. "Oracle ADF Real World Developer's Guide" discusses ADF framework in detail. This book contains a lot of real life examples which will help developers to design and develop successful enterprise applications. This book starts off by introducing the development environment and JDeveloper design time features. As you read forward, you will learn to build a full stack enterprise application using ADF. You will learn how to build business services using ADF, enable validation for the data model, declaratively build user interfaces for business service and enable security across application layers.
Table of Contents (20 chapters)
Oracle ADF Real World Developer's Guide
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Developing with ADF


The best way to learn technology is to start coding. In the next section, we will build a simple web application and walk through the application source generated by the development tool. In the coming chapters, we will analyze each piece in detail, taking real-life use cases.

Setting up the development environment

Let us set up the environment for building applications with ADF. The development environment setup includes setting up the Integrated Development Environment (IDE), version controlling the source, picking up the right build tool, and setting up team collaboration.

Picking up the tool for development

The success of a development framework is well complimented by a smart development tool, which simplifies the creation of applications by using this framework. Oracle JDeveloper is the IDE that we will be using for building ADF applications. JDeveloper has better tooling support for ADF, covering an end-to-end development lifecycle. You can download and install the studio edition of the latest JDeveloper release from http://www.oracle.com/technetwork/developer-tools/jdev/downloads/index.html. The studio version of JDevloper comes packaged with Java EE and ADF libraries.

Tip

If you just want to try out Oracle ADF, installing studio version of JDeveloper alone is enough to keep you going with the technology. In this chapter, you will find some other discussion points such as versions controlling the source, automated build process, and team collaboration. These are required only in real-life enterprise application development with ADF.

Setting up the Software Configuration Management tool

Once you have decided on tools and technologies for development, the next step may be to set up the Software Configuration Management (SCM) tool. SCM is the task of tracking and controlling changes in the source code during the application development. There are many source control tools available on the market. JDeveloper is packaged with client support for Subversion (SVN)—the most popular version control tool among Java developers. In fact, you are not limited to SVN; JDeveloper can work with most of the popular tools if you have the right extensions installed. The supported version control list includes Concurrent Version System (CVS), Perforce, Serena Dimensions, Rational ClearCase, and so on.

Build tool

JDeveloper has built-in support available for compiling and generating deployable artifacts from the application source. This may be enough when you build less complex applications. However, if you are building more complex enterprise applications and the team size is fairly big, you may need to have automated build support and a Continuous Integration (CI) process to improve the quality of the work and fast delivery. In such scenarios, it's required to build the applications outside of JDeveloper. Fortunately, we have multiple options available to address such requirements. Let us take a quick look at the options that are available to build the ADF applications:

  • Built-in Make and Rebuild options on JDeveloper: When you right-click on a project in JDeveloper and use the Make option, the IDE compiles source files that have changed since they were last compiled, or have dependencies that have changed. The Rebuild option allows you to fire an unconditional compilation on the source.

  • Ant: Ant is a Java-based build tool, which automates the build process. JDeveloper has in-built support for using ant as build tool for projects. To learn more about ant, go to http://ant.apache.org/index.html.

  • Maven: Maven is a software management and build automation tool, which bridges ant's shortcomings in many areas. You can learn more about Maven at http://maven.apache.org. JDeveloper provides basic infrastructure support through which Maven can be used for building ADF projects. If you plan to use Maven for building an ADF application, you may need to follow some manual tasks such as adding all the dependencies to your project's pom.xml and populating the Maven repository with the required ADF libraries.

Note

To learn more about version controlling with JDeveloper and build tools, refer to the Oracle Fusion Middleware User's Guide for Oracle JDeveloper documentation. To access the documentation visit http://www.oracle.com/technetwork/developer-tools/jdev/documentation/index.html and navigate to Oracle JDeveloper and ADF Documentation Library | User's Guide for Oracle JDeveloper. Use the search option to find specific topics..

Team collaboration

When you work on larger projects, you may end up using different tools to perform various tasks at various stages of the application lifecycle. Many of these tools do not run co-operatively and may call for a lot of manual labor to get your job done. What we really need is a platform that will integrate all these tools—making our life easier. JDeveloper supports such a platform, which is shipped as Oracle Team Productivity Center.

Oracle Team Productivity Center is a JDeveloper-based Application Lifecycle Management tool that is useful when we work with a larger team spread across different geographic regions in a connected network. The list of features includes the following items:

  • Team navigator, which enables multiple grouping of users and acts as an access point for the team collaborative features

  • A build dashboard displaying the nightly built test results on your IDE

  • Chat window

  • Administration console to manage users and teams

The Oracle Team Productivity Center consists of three components:

  • The Team Productivity Center client software: This is the JDeveloper client software for the Team Productivity Center. As with any other JDeveloper extensions, this can also be downloaded from the JDeveloper update centre.

  • The Team Productivity Center server software: The server software manages the connections between the team's Team Productivity Center features in Oracle JDeveloper and data repositories such as a bug database, feature wiki, or directory of product features and specifications.

  • The Team Productivity Center connectors: As you may have imagined, connectors are used for enabling the connection between the Team Productivity Center client software, running inside JDeveloper and data repositories such as bug-tracking systems, feature databases, and so on. Standard connectors can be installed from the update centre. Even you can build your own connectors, if needed.

Note

In-depth coverage of the Team Productivity Center is beyond the scope of this book. More details on the Oracle Team Productivity Centre including an installation guide and downloads are available at http://www.oracle.com/technetwork/developer-tools/tpc/overview/in dex.html.

Taking a quick tour of the JDeveloper IDE

Oracle ADF and JDeveloper go hand in hand. JDeveloper is aimed to simplify your job as an application developer by providing visual and declarative aids for development. Let us take a quick tour of the IDE to get familiarized with the commonly used editor windows and tools.

  • Application navigator: The application navigator window helps us to manage the contents and associated resources of an application. You can create new projects and source files using the options available in this window.

  • Application resource panel: The application resource panel window displays the application-level resources and configuration files. This includes database connection information, metadata files used to configure ADF Business Components, and so on.

  • Data control panel: The data control panel displays the data collections, attributes, built-in operations, and business methods from the business services exposed through a data control registry. The exposed items from the data control panel can be dragged-and-dropped on the UI, which will generate a metadata XML file to bind the business data with the UI.

  • Structure window: The structure window displays a structural view of the data in the document that is currently selected in the active window. Structure window can be used to view or edit the contents. For example, you can drag-and-drop components from any palette to the structure window.

  • Visual editor: The visual editor window will help you to visually build the UI for ADF applications. It provides a visual WYSIWYG— What You See Is What You Get—editor for HTML, JSP, JSF, Facelets, native mobile UI, and Java Swing. The visual editor allows developers to visually lay out the UI. Note that JDeveloper synchronizes the selection in the structure window with the visual editor and vice versa.

  • Component palette: The component palette window lists down available components associated with the selected technology that you are using for designing pages or for defining navigation.

  • Property inspector: A property is a named attribute of a class or component that can affect its appearance or its behavior. The property inspector displays the exposed properties of the component selected in the structure window or in the visual editor.

  • Log window: The log window displays the logs from various components such as compiler, audit rules, debugger, and profiler.