An object model is to model the business domain. The DB schema is to relate the object state to its persistence across execution. The simplest way to think of it is that the objects that are in memory have a state that makes sense to your business - i.e. they embody the business rules that make your software "smart". The DB allows this state to persist over time, such as between system startup and shutdown, as well as to facilitate smart ways to only instantiate the objects you need at the time.
E.g. if you have are in the banking industry, you will surely have SavingsAccounts and CheckingAccounts, which will be associated with Persons ("owners") and will maintain state such as balance. As transactions take place, these objects' state (such as the amount in the balance) will change and be persisted to disk - the whole transaction will make it or not (commit/rollback).
If you have an existing DB schema, then it will provide good clues to the types of objects (classes) and behaviors (methods) you will have in your object model. But be careful - often a DB model is not a one-to-one mapping to a well-designed object model.
Best of luck, Mark
Main Topics
Browse All Topics





by: DarrenDPosted on 2009-08-04 at 02:52:20ID: 25011886
Hi srivmanish007,
classes/mi s431s05/ 43 1ReverseEn gineer.asp logs/2007/ 05/14/easy -database- schema-dia grams-with -dbvisuali zer/
'How we can create a object model for a given database schema.'
A schema is generally used to validate a something, so I'm not really sure what you mean. Can you give some more information about what you want?
'What is the basic purpose and functionality of object model.'
The basic purpose of the object model is for the design the database, it's the same as a Entity Relationship Diagram (ERD). It may be used to introduce new members of a team to the database they are going to be working with. In order to keep the database model up to date if it has become obsolete is to generate the model from the database itself. You can use tools such as Viso to reverse engineer a database and create a model of the database structure.
SQL Server: http://www.cbe.wwu.edu/mis
MySQL: http://www.sitepoint.com/b
Cheers,
Darren