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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.2.3. Renaming Entity Objects and Associations<br />

• We first rename the entities and associations and the new names will be used<br />

when we create view objects and view links.<br />

• A default application module typically contains many (nested) view object<br />

usages that you do not need in your application. You should set up your<br />

application module data model based on the layout of the pages you will create<br />

to meet the functional requirements of your application.<br />

We recommend renaming entity objects and associations to comply with the naming<br />

standards you have set up for your project (see chapter 2).<br />

Renaming associations and the association accessors is important for the following<br />

reasons:<br />

• By default, associations are named after the foreign key constraint suffixed with<br />

“FkAssoc”. Foreign key names are often not very meaningful, so if you have<br />

many associations, they are easier to manage with meaningful names.<br />

• The accessor properties of an association determine the accessor method names<br />

generated into the entity objects to traverse entity object associations, something<br />

you will often do when coding business rules in your entity objects. Logical<br />

accessor methods make it easier to code this logic.<br />

• The view links that are created when you create default view objects for your<br />

entity objects are named after the underlying associations, saving you an<br />

additional renaming of the view links (although you typically will remove the<br />

“Link” suffix added to the view link name).<br />

For example, when you create entity objects for the EMPLOYEES and DEPARTMENTS<br />

tables in the HR schema of the <strong>Oracle</strong> database, an association named DeptMgrFkAssoc<br />

is created, with association properties named “Employees” and “Departments”. We<br />

recommend renaming the association to something like<br />

“EmployeeManagesDepartments”, and the association properties to “Manager” and<br />

“DepartmentsManaged”.<br />

3 - 6 Creating Business Components <strong>JHeadstart</strong> <strong>Developer's</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!