简体   繁体   English

.net应用程序架构指南

[英].net application architecture guidance

I am in confusion . 我很困惑。 Please guide me. 请指导我。

See, I have .net application (say for web application). 看,我有.net应用程序(比如Web应用程序)。 which is n-trier . 这是n-trier。 basically it is 3-tier. 基本上它是3层。 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 where 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. 因为根据我的想法,在业务层中使用System.Data是不合适的。 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. 但在架构级别,如果我使用User对象然后传递数据,我需要访问所有层中的用户对象。 so where should be the User object place in layers in application ? 那么User对象应该放在应用程序的各个层中?

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. 创建User类并在从users表读取时将IList<User>从数据层返回到业务层。

Question 2: I use a separate assembly/class library which defines all business objects. 问题2:我使用一个单独的程序集/类库来定义所有业务对象。

您可以使用DTO ,它们是用于在层之间传输数据的类

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. 你可能没有足够的时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM