开发者

.net application architecture guidance

I am in confusion . Please guide me.

See, I have .net application (say for web application). which is n-trier . basically it is 3-tier. as usual. it having Presentation layer , business layer,Data access layer. Where as I am fetching the records in the Data layer in dataset and data tables whe开发者_如何转开发re the found sophisticated. but when i am passing the data from data layer to business layer then what i have to use there . because as per my thinking the use of System.Data in business layer is not proper. it may harms the performance in case. then what should be the media to transfer data between these two layers?

another question in same scenario is , let say I have stored procedure in my database having user information insertion functionality. I want to pass the data from presentation layer to data later through the business layer. what is the correct way pass data vise versa between layers. I may use User Object. but in architecture level if i used User object then to pass the data, i need to access the User Object in all layers. so where should be the User object place in layers in application ?


Question one: Classes. Create a User class and return a IList<User> from the data layer to the business layer when reading from the users table.

Question 2: I use a separate assembly/class library which defines all business objects.


You could use DTOs which are classes designed to transfer data between layers


I would point you to domain driven design. But it may not suite you/your team because of the learning curve. You might not have sufficient time at hand.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜