In fact, I think you have something a little from traditional layered architecture. Typically, the models of your data that your application is working on will be stored in the business layer along with code to work with them. Your data layer will use both the data models of your persistence structure and the code to interact with this structure. I think this could be a source of confusion between the proposed locations of your classes and your reaction to it based on your comments.
From this point of view, everything that retrieves or brings will necessarily be in your data layer - this is access to data in persistent storage. What it extracts ultimately translates into business-level objects in which your business logic operates. We are talking about conceptual models, such as an order table, or business activities in a business layer. I agree with @Adron, perhaps with the same confusion about where (3) goes depending on what it really is.
More specific:
- User preferences are business objects, things that retrieve this data-level object.
- Static data is converted into a business object (table or view or something else), a thing that accesses an external server is a data-level object.
- User law is a business object, what extracts it is a data-level object.
- The order table is a business object
- Emailing is a business activity, so the thing is that people with people are business objects.
[EDIT] My generalized 3-tier architecture for (simple) web applications
DataAccessLayer
This will include my TableAdapters and strongly typed DataTables and Factoryories, which turn the rows of my DataTables into business objects in pre-LINQ projects. Using LINQ, this will include DataQontext objects and constructors created by LINQ.
Businesslayer
This will include any business logic, including validation and security. In pre-LINQ, these will be my business objects and any other classes that implement the application logic. Using LINQ, these are partial implementations of the classes of my LINQ objects for security and validation, along with any other classes for implementing business logic.
Representation
These are my web forms - basically the user interface of the application. I include some validation logic in forms as optimization, although they are also validated in BL. This will also include any user controls.
Note: This is a logical structure. The project structure usually reflects this, but there are some cases, such as connections to web services, that can be directly included in a web project, although logically the components are indeed in BL / DAL.
Note. I will probably go to MVC through the 3-tier layer when ASP.NET MVC is created. I did some personal projects in Ruby / Rails, and I really like the MVC paradigm for web applications.
tvanfosson
source share