In my previous post ADF Naming Conventions – Part I I have focused my attention on:
- Application & Project Naming
- Packages Naming
- Business Components Naming
Today I will start to talk about Model & View Controller Project naming.
ADF Model Naming
For new ADF applications we are requested to set the names for Model and ViewController projects. In what concerns the Model it should following naming:
<PROJECT_NAME> + <MODULE_NAME> + Model
Example: RMKMyAdfLibModel
For the package structure it should be configured as follows:
<DOMAIN_NAME> + . + <PROJECT_NAME> + . + <MODULE_NAME> + . + model
Example: red.mavericks.rmk.my.adf.lib.model
As you can see, package structure follows the same structure defined in my previous post plus “model“.
ADF View Controller Namings
In ViewController projects we have a wide range of naming we can follow since we have multiple features we can take advantage of. For that reason we divided it in sub topics. .
Project Name
The name for the project should be defined as follows:
<PROJECT_NAME> + <MODULE_NAME> + Controller
Example: RMKMyAdflibController
By using “Controller” prefix we are able to automatically identify projects type and purpose.
Project Default Package Structure
Package structure for View Controller project should be defined as follows:
<DOMAIN_NAME> + . + <PROJECT_NAME> + . + <MODULE_NAME> + . + view
Example: red.mavericks.rmk.my.adf.lib.view
As you can see, package structure follows the same structure defined in my previous post plus “view“.
Images, CSS and JavaScript Directories
Images, CSS and JavaScript directories should be defined right under “Web Content” folder. The folders should have the following names:
FOLDER TYPE | FOLDER PATH |
---|---|
To contain images | resources/images |
To contain CSS files | resources/css |
To contain javascript files | resources/js |
Example:
Inside “web.xml” file in ViewController project set the following mappings:
Bounded Task Flows, JSFF, JSPX Directories
Reusable bounded task flows can be published in ADF Libraries and consumed by other ADF applications. For this use case is important, and a must, that all bound task flows have a unique name. If this isn’t accomplished ADF has no way to distinguish between task flows with the same name.
Before creating bounded task flows you should set a folder structure under “WEB-INF” folder. After this folder structure is created you can start creating your bounded task flows.
Folder structure should be created according to the following convention:
<DOMAIN_NAME> + <PROJECT_NAME> + <MODULE_NAME> + view + <BUSINESS_AREA>
Example:
JSF, JSFF and JSPX files must be saved on the same folder of the task flow.
Page definitions will be automatically generated with same package structure under Application Sources folder. Example: red.mavericks.rmk.my.adf.lib.view.financial or red.mavericks.rmk.my.adf.lib.view.retail
Managed Beans for Task Flows should be created under Application Sources folder with the following package structure:
<DOMAIN_NAME> + <PROJECT_NAME> + <MODULE_NAME> + <BUSINESS_AREA>
Example:
We decided to create Managed Beans outside “view” package to avoid a mixture between page definitions and java classes.
In my next post I will focus my attention on:
- Task flows as well as Templates and some more regarding View Controller Projects
- JAR, WAR, EAR files
Don’t miss my next post 🙂
Cheers,
Pedro Gabriel
@PedrohnGabriel
Post Header photo by Lefteris Heretakis