Business Object creation for One to One Relationship

Business Object creation for One to One Relationship

Old forum URL: forums.lhotka.net/forums/t/4412.aspx


Inquistive_Mind posted on Tuesday, February 26, 2008

Hello All,

              I have requirement where in I need to create a BO for adding a row in one table ,simultaneously add a row in another table.The tables were denormalized due to the size of the single table and some other relationship among the fields.I was thinking of creating just one BO and handle the DB operations in the stored procedure using the ERROR rather than a Single Parent - Single Child BO. Aslo the second insert just adds some default values.Am I doing it right?Are there issues that I am not seeing at this moment?

Thanks In Advance,

Vikas

cliffordru replied on Friday, February 29, 2008

Vikas, you do not (and should not) have a one to one relationship between your BO's and database tables.  If your objects responsibility is to save some related data and that related data exists in multiple tables, then it would be correct to persist the data with one BO using a stored procedure as you have outlined above.

Regards,

Cliff

Copyright (c) Marimer LLC