14.01.2013 Views

Oracle JHeadstart Developer's Guide - Downloads - Oracle

Oracle JHeadstart Developer's Guide - Downloads - Oracle

Oracle JHeadstart Developer's Guide - Downloads - Oracle

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.4. Defining Java Package Structure and Other Naming Conventions<br />

2.4.1. Java Packages<br />

When working in a team, it is important to have standards on naming java packages and<br />

the various types of (business) components. Everybody seems to have different opinions<br />

on naming conventions, but remember, the important thing is to have naming standards<br />

in place and have them applied by all developers. The actual format of the naming<br />

conventions is less important.<br />

As a suggestion, here are the naming conventions as applied on projects by the<br />

<strong>JHeadstart</strong> Team, use them to your own advantage.<br />

The root package of an application is by convention the reverse of your companies<br />

internet domain name, followed by the application name, for example “com.acme.hr”.<br />

A suggested package structure within the application can be found in the table below.<br />

Subsitute the three dots with your application root package.<br />

Package Description<br />

….model Base package forbusiness service classes,<br />

classes who contain logic not specific for the<br />

web application built on top of it<br />

….model.adfbc Base package for ADF Business Components.<br />

….model.adfbc.base Package for base classes extended by the ADF<br />

Business Components you create for the<br />

application<br />

….model.adfbc.entity Base package for entity objects and<br />

associations<br />

….model.adfbc.entity. For larger applications, it is good practice to<br />

further organize entity objects into subsystem<br />

packages, for example<br />

“model.adfbc.entity.authorization”.<br />

….model.adfbc.query Base package for view objects and view links<br />

….model.adfbc.query. For larger applications, it is good practice to<br />

further organize view objects into subsystem<br />

packages, for example<br />

“model.adfbc.query.authorization”.<br />

….model.adfbc.service Contains application modules<br />

….controller Base package for classes that contain logic to<br />

control the behavior of the web application.<br />

….controller.jsf Base package for JSF-specific classes that<br />

contain logic to control the behavior of the web<br />

<strong>JHeadstart</strong> <strong>Developer's</strong> <strong>Guide</strong> Getting Started 2 - 13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!