Hello to all,
I need help in creating Business Logic Layer...
Right Now I create a separate Class for each table in my Data Base, and place all necessary methods for that table in this class. this class is intermediate between Data Access Layer and Form. But My problem is that when I have to perform operations on more than one Table, the methods for operation are divided in separate class. For example I have an Employee Table and Address Table. To insert a new Record I have to perform Insert operation on both tables and methods for that are placed in two separate class. so sometimes problem occured for consistancy in this tables (one is updated and one is not)
Can any one suggest me the good structure for Business logic where more than one tables are updated Or how to develope Logic Layer when Operation is to be made on different Tables simultinously...
Thank U

Building Business Logic Layer
gregu33701
Use triggers to determine when a record is inserted, updated or deleted. Use the trigger as a tool to update, insert, or delete records to the corresponding tables.
Adamus
Rockstar_Rich
Hello Bhavin,
Why not just send a collection of your DAL classes to the datalayer and sort it all out there
You can write some cool logic to determine wich commands to run first based on the data relations present in your dataset.
barchard
you dont' necessarily need a class for each table, it's easier to use a dataset instead and put all your tables there, any methods for insert or update would be in the data access layer calling stored procedues in your database. It would be therefore easier to update two tables at the same time using the SqlTransaction object.
Hope this helps
Emeka
limethief
I had developed a Business Logic Layer.
BusinessLayer.Components released, too...!!!
http://guydotnetxmlwebservices.blogspot.com/2005/01/businesslayercomponents-released-too.html
Good coding.
Javier Luna
http://guydotnetxmlwebservices.blogspot.com/
MarcoViY
Hi,
It seems that you are missing a good object model for your structure, however, I think that the best way to do it in a good object model is to make your child class a member of the parent one, so you can write in your code Employee.Address(s), this way you can assure strong types but on the other hand you should insert the Employee record first into the database table then insert the child records, and here it's advisable to make your parent id as GUID that you should generate right from your code not using newid() generic function of SQL Server, or you can get last inserted id by @@Identity.
Note : I strongly recommend you reading this book ASP.NET Website Programming: Problem - Design - Solution C# Edition
Regards,