开发者

Domain Logic, DAL, Database - Where to place what, where? and how to interact with them?

开发者 https://www.devze.com 2023-02-18 15:32 出处:网络
I have the following task: I have to create the following: Domain Logic, Data Access Layer, Database. I will also have to create an ASP.Net Page to work with the aforementioned pieces (ASP.Net is on

I have the following task:

I have to create the following: Domain Logic, Data Access Layer, Database.

I will also have to create an ASP.Net Page to work with the aforementioned pieces (ASP.Net is only part of the system, there may be a desk开发者_开发知识库top app etc).

I want to use the Entity Framework as the Data Access Layer, but here is my confusion: I dont know how I should go about creating the different layers... I cant work out what project type they would be..I would usually use the ADO.Net Entity Framework within a C# Windows Form project with a SQL Database. However, the fact that I will have ASP.Net and Windows Forms possibly using the domain logic confuses me as to how and where I would place each part? The Domain logic, the DAL and the Database..? Also, how would I interact with each layer? Any help would be GREATLY appreciated as I have no clue how to go about this currently.. I hope I explained this reasonably, Thank you.


I would create separate projects for each, i.e:

  • Library project that houses the models
  • Another library project for business/domain logics
  • Web project (ASP.NET / MVC)

With that setup, you can reuse your library projects in WinForm, WPF, etc... project by just referencing the libraries.

0

精彩评论

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

关注公众号