开发者

DAL/BL design question

Am working on a .net 2.0 windows application. The data access layer[DAL] executes stored procs and returns datareader/dataset 开发者_StackOverflowto the business layer[BL].

The BL which refers to DAL dll, iterates through the datareader/dataset, reads columns values, creates business objects and returns it to the UI layer.

Given this, is it ok here that the business layer is referring to columns of a database table?

Is this a good practice wrt layer design?

If I return Business object from the DAL instead of dataset/datareader, then my DAL project will have to refer to BL dll too.So,wont there be a circular reference here? Thanks.


It is not good practice, as your data layer is exposing implementation details and thus information hiding and encapsulation are lost.

You should be passing objects that model your data.

For example, instead of an order data row, you should be passing an Order object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜