Y
Yuval
Hello,
I'm trying to figure out a "best practice" way to tackle the business layer
design in a better way than I do now.
My options for the business logic layer are (AFAIK) as following:
1. Create a custom business entity object for interaction with each, some or
all of the DAL objects.
2. Use XML to move data between DAL objects and BLL objects, and between BLL
and UI objects.
3. Use a (strongly-typed) Dataset to represent my business entity along with
all it's relations.
Option 3 - using a typed dataset seems like the best since this object
relieves me of many troubles such as serialization, marshaling, and data
integrity issues. BUT I'm having a bit of trouble as to how exactly to
approach this solution (up until now I wrapped my typed datasets with custom
objects).
Consider a DB with 3 tables: Persons, Companies, and Addresses. 3 objects in
the DAL layer deal with each table.
The steps I am considering for the different tiers are as follows:
1. Create a typed dataset for the 3 tables and their relations. (the
business entity)
2. Let every DAL object handle the corresponding table's CRUD operations
using a dataadapter.
3. Let the BLL call the DAL objects to fill the dataset in the right order.
4. UI will call the business entity to show/update information.
What I am missing is a way to retreive, lets say, a list of companies. I
could just add method to the business entity to call only the companies DAL
object, and return the incomplete dataset to the UI, but then I have a
business entity that is not complete (no user info or addresses), in which
case why go through the BLL and not access the DAL from the UI?
Am I on the right track here? Does the approach I'm taking "sit right"?
Any comment would be appreciated.
Thanks for taking the time to read,
Yuval
I'm trying to figure out a "best practice" way to tackle the business layer
design in a better way than I do now.
My options for the business logic layer are (AFAIK) as following:
1. Create a custom business entity object for interaction with each, some or
all of the DAL objects.
2. Use XML to move data between DAL objects and BLL objects, and between BLL
and UI objects.
3. Use a (strongly-typed) Dataset to represent my business entity along with
all it's relations.
Option 3 - using a typed dataset seems like the best since this object
relieves me of many troubles such as serialization, marshaling, and data
integrity issues. BUT I'm having a bit of trouble as to how exactly to
approach this solution (up until now I wrapped my typed datasets with custom
objects).
Consider a DB with 3 tables: Persons, Companies, and Addresses. 3 objects in
the DAL layer deal with each table.
The steps I am considering for the different tiers are as follows:
1. Create a typed dataset for the 3 tables and their relations. (the
business entity)
2. Let every DAL object handle the corresponding table's CRUD operations
using a dataadapter.
3. Let the BLL call the DAL objects to fill the dataset in the right order.
4. UI will call the business entity to show/update information.
What I am missing is a way to retreive, lets say, a list of companies. I
could just add method to the business entity to call only the companies DAL
object, and return the incomplete dataset to the UI, but then I have a
business entity that is not complete (no user info or addresses), in which
case why go through the BLL and not access the DAL from the UI?
Am I on the right track here? Does the approach I'm taking "sit right"?
Any comment would be appreciated.
Thanks for taking the time to read,
Yuval