|
Design
Depending on how you want to work, you can automatically create
entity objects from existing database tables (reverse generation) or define
entity objects and use them to automatically create database tables (forward
generation).
With reverse generation, you first define your database tables
(and perhaps views, synonyms, and snapshots), and then use them to create entity
objects and associations with one or more of the following tools: Entity Object
Wizard or Editor Business Components Project Wizard Package Wizard or Editor.
Your team usually starts with a database design or UML diagram, and the database
administrator creates a table for each entity in the diagram. The table has
columns corresponding to the attributes of the entities, and has database constraints
based on the relationships between the entities. The tables are used to create
the initial definitions of entity objects and associations using the business
components wizards. After, programmers customize these business components to
implement the application's business logic.
With forward generation, database tables and database constraints
are automatically created based on business component definitions. The database
administrator can then refine the generated tables and database constraints
as needed.
OTN developers used reverse engineering in the BC4J-VSM because
the application is based on a database schema that was used previously in the
J2EE version of the VSM. Therefore, it was easier to develop entities from the
tables than build them from scratch.
However, if you're building a completely new application,
forward generation can give you better control over behaviors of entities (elements
in the problem domain) than defining behaviors based on the data.
Other aspects of the BC4J-VSM design are covered in various
lessons in this tutorial series.
|