chaos
We Are the World !!
发贴: 92
积分: 40
|
于 2003-03-03 01:15
This is an O/R mapping like questions. There are five strategies you can adopt :
1.Top-down: Start with an existing JavaBeans object model, develop a mapping that maps those objects to tables in your database, generate DDL to create your database, and then use a persistance API to persist those objects to that database.
2.Bottom-up: Start with an existing database schema, describe your database schema using using XML or some other meta-data representation, generate your JavaBeans object model, optionally add business logic to those objects, and use a persistence API to store and retrieve your objects.
3.Middle-out: Start with a meta-data description of your object model, generate your JavaBeans object model, generate DDL to create your dataBase, and use a persistence API to store and retrieve your objects.
4.Meet-in-the-middle: Start with an existing database schema and an existing JavaBeans object model, develop a mapping to map between the two, and use a persistence API to store and retrieve your objects.
5.Generic-object: Start with a meta-data description of your desired database schema, generate DDL to create your database, and use a persistence API to store and retrieve generic data objects, with values stored as a hash of name-value pairs, to and from your database.
|