Developer Tools
JDeveloper
Managing ADF Development Across Multiple Applications with SubversionAn Oracle JDeveloper How To Document
IntroductionADF development can be approached in a number of different ways. Some organizations prefer to work with one ADF application consisting of many projects. Others prefer to divide development across multiple applications by functional area. How the development environment is managed can also be done in a number of ways. Among the many decisions to be made are how code is to be stored and versioned and how ADF Libraries libraries will be shared among teams. There are many approaches to this, among the most obvious are the use of a tool such as Maven, accessing shared resources through JDeveloper's Resource Catalog or making use of the facilities offered by your source code control system. This document proposes a methodology for the latter approach and more specifically using Subversion to both version and control the sharing of common components such as ADF libraries between teams and multiple applications. The use of Maven or the Resource Catalog are outside the scope of this document as is a discussion on how to achieve optimal deployment of shared components. But they will be covered in separate documents at a later date. Utilising SubversionThis document proposes a working methodology for Team Development where
This methodology is for distributed teams working on different functional areas with some common components. Typically one application is used to develop the reusable ADF business services. This application holds reusable entity objects. In addition it may hold reusable view objects. UI development is split across functional areas using multiple applications that access the common business services through ADF Libraries. Each UI application may also be exposed as an ADF Library to share common components (such as unbounded task flows) Application SetupDevelopment is split into a number of applications. This document does not propose naming conventions for applications it uses generic names that should be customized as appropriate. Common Components ApplicationThis application typically holds the business components that are to be shared through libraries or infrastructure components that can be shared between applications. Components may be:
Write access to this application is restricted to those working on shared components and libraries.
Team Development Application(s)Each application represents one functional area of the development. The application must be setup to share any ADF libraries directly from the SVN repository. Developers check out their 'working copy' of the application for development and update/commit to the SVN repository as normal. Deployed ADF libraries are shared directly from the SVN repository. This ensures that all developers working on applications are using the correct version of the library at any given time. It is an alternative to storing the library on a shared file system and accessing it from the Resource Palette. Using the Resource Palette is outside the scope of this document In addition to consuming the commonModelEO library it may be that each team application provides and consumes ADF libraries from other team development applications. Typically this occurs when bounded task flows are shared between different functional areas. A discussion on bounded task flows is outside the scope of this document. Working with Bounded Task Flows and ADF Libraries is covered in the Application Development Guides available from OTN Master Deployment ApplicationThis application pulls together all the common and team applications into the full development. It typically provides some functional development in its own right but also consumes all other shared components to provide the full application for testing and release purposes. SVN SetupRepository StructureThere are many ways to set up a development folder structure in SVN. This document proposes one approach when using multiple applications
Using Tags for Library SharingIn Subversion a tag directory is used to store milestones, versions of code. A tag is simply a copy* of development at a specific revision (point in time). It is up to the SVN repository administrator to control the creation and access to tag directories *SVN uses the term 'copy' when creating branches or tags of directories. However, this is not an expensive operation as it is pointers that are used under the covers.
Creating a Tag Using the Versioning Navigator
Accessing the file URL of a versioned directory
To add the library to a project from the SVN repository the svn:externals property is used. Once the property is set and committed to the SVN repository all users of the application will obtain the library when they next either check-out or update their working copy from the SVN repository. It is advisable to set up sharing as early as possible in an Application's development. Once the application has been initially versioned the svn:externals property can be used to obtain the library that is to be consumed Share ADF Library with Team ApplicationsTo add an ADF Library or other shared component between applications during development. It is advisable to access the library directly from SVN. This allows control of the release mechanism of versions during the development phase. This can be especially important if development is being done concurrently on both shared and non-shared components. To add code to a project from the SVN repository the svn:externals property is used. Once the property is set on an application all users of the application will obtain the library when they next check-out or update their working copy from the SVN repository. It is advisable to set up sharing as early as possible in an Application's development. Once the application has been initially versioned the svn:externals property can be used to obtain the library that is to be consumed Setting svn:externalsThe first step is to copy the File URL of the directory containing the library in the SVN repository. Use the technique described above.
Use the SVN Console - Log to see that the property has been set in the repository: Note that the project's Resources file source path (.../Team1App/TeamApp1Model) is where the new shared_commonComponents directory will be created to hold the shared library Finally, Update Working Copy to get the shared library copied into the local working copy. Import Shared Library into ProjectHaving shared a copy of a library from the SVN repository the next step is to set up your project to use the library. If you are using an ADF Library, the following steps are required. If it is another third party library then adding the library to the projects Libraries and Classpath may suffice (Use Project Properties to do this, it is not covered in detail in this document).
Setup Project for Business ComponentsIf your project is not yet setup for Business Components you need to do one of the following:
Import Shared ADF Library of Business ComponentsOpen Project Properties for the project to contain the library components. Under Business Components select Imports and add the commonModelEO.jar from the file system location specified in svn:externals. This gives you the option to automatically adds the jar file to Libraries. (you can check this by looking under the Libraries and Classpath project properties) In addition go to Project Source Paths - Resources to add the directory to the resources path and see read-only versions of the objects in the navigator. Moving To Latest Revision ADF LibraryPeriodically a new version of any shared ADF Library will be deployed. If this new version is to be picked up by other users, or is a milestone release of some sort, the Application should be tagged to ensure it is permanently and easily accessible. There are three stages to this operation:
Note: Similar instructions will apply to third party libraries being stored in projects/SVN
Create New Tag for Latest Revision of ADF LibraryUse the Versioning Navigator to access the Branch/Tag menu of the CommonComponentsApp.
Point Team Applications to Latest Tagged ADF Library VersionThis involves changing the svn:externals property set earlier. It is good practice to do this at specific milestones when user working copies have been merged and any conflicts resolved, to reduce any possible conflicts between old and new library code. Then, check out a working copy of the TeamApp to be updated.
Update Check Out Working CopyEach user must Update their working copy from the SVN repository to get the latest ADF Library downloaded from the repository. In addition, to ensure that the updated ADF Library is reloaded into the project either close and re-open the project from the Application Navigator or close and reopen JDeveloper. |
||||||||||||||||||||||