Newbie:-Pros and Cons?
Hi,
Given a classic n-tier architecture, I've seen a couple of ways to utilize the data tier and was wondering what the pros and cons of each approach were. One approach has a data tier object referenced/instantiated in the business tier and then its methods and properties are used, whereas in the other approach the data tier was inherited by the business tier. Which method is best/most used and what are the pros and cons of either and are other approaches which are also quite prevalent.
Dave (old VB dude embarking on the oop life!)
[556 byte] By [
drmcl] at [2007-12-16]
Hi,
I have always used the first apprroach which you have mentioned which is to have a data tier object isntantiated in the business tier. I would recommend that approach for the following reasons:
The main advantage I have found with this approach, is that all the technical intricasies of accessing the database are well encapsulated within this data tier class and so the application is shielded from the changes that may happen to the data access object model in future.
Further, the responsibility of the business logic layer becomes well defined since it does only actions related to business logic and does not deal with database related code. This would be a big plus from the perspectibe of maintenance and extensibility as the boundaries are well defined.
Regards,
Vikram