Question about data layer

P

Paul

I can see where you are going with this but the concept of a BAL is a bit
missleading. The DAL in computer concept is described as the application
than returns a reference to an object in OO terms rather than a set of rows
or fields, allowing a high level of abstraction from the db. To return a
IDateReader here is misleading IMHO.

Personally I would rename your BAL as the DAL and rename your DAL as a
DataProvider/DataProviderFacade.

What your DAL (Data Provider) is in essence doing is acting as a
Facade/Strategy over potentially numerous Database Provider Types (SQL
Server, Oracle, My Sql etc etc) not doing the ORM stuff and returning a
model object.

Its a great model and one that I only thought a nutter like me used. Like I
said my personal preference would be to rename your layers, but I still like
it more than any other options I've ever heard developers mention on the
net.

Someone from microsoft, I think you ignored my previous comments cause you
thought I was been awkward but I was not. You should still try to understand
the GRASP principles in Larmans book and read up on Composites and
aggregation these will aid you significatly if you are creating a Data
Access Framework for your company. These are not gospel and even Larman
says...PICK YOUR BATTLES.. and this is the hardest point to learn of all,
and im still trying...;-)

Another thing to watch out for is because you have moved all functionality
(well maybe) out of model objects it can also be difficult to do things like
Lazy loading without further calls into the layers, so you will need the
notion of layers and to what extent your BLL needs to load Aggregated
Composites, not deep enough and you will not populate your object correctly
too deep and you grind the app to a halt, so try to make it flexible so you
can load layers only that are needed in the ui.

e.g.

Person employee
string name
Address homeAddress
Person Manager
string name
Address homeAddress
Person Manager
string name
Address homeAddress
Person Manager
string name
Address homeAddress
Person Manager
etc...
etc....

How much information do you need? Load only to that level.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top