c# - What to put in Business Logic Layer? -


I have read a lot of articles and they are getting different from one writer / developer to the next. In my situation, I'm thinking of this setup to test a project:

  1. Presentation layer via ASP.NET MVC

  2. Service Layer (my plan is ASP.NET MVC Web API, this is in separate assembly)

  3. Business Logic Level

  4. Some articles inserted said that I should not keep the operation of CLUD on BLL and should be the only business logic in BLL. Apart from this, some said that BLL should not reach DAL. But what would happen if the argument stored on DB for a business logic to calculate / work on arguments? I think my questions will be:

    1. If BLL should not reach DAL, then about those business logic arguments that require data in DB , for?

    2. There are BLL institutions, is not it? Are they like Poko or will I still have POCO in DOL?

    3. In addition, is DBCTX in BLL? Some people say that I should be confused that I am confused.

    4. What about CRUD in BLL? should I?

    5. Is the repository interface in DAL?

    Any additional comments / suggestions / information that will be very welcome in my planned setup (even if it is not related to BLL).

I had a project some time ago.

Our project Archivistate is according to the suggestion that you make.

We had an ASP.NET MVC site, which reached the web API (in external solution).

The Web API has referenced an external solution made entirely of static libraries, which includes data layer (bus bodies) and firmness layer.

We have to reduce the institutions by data transfer objects for web service and communication between customers (), and completely external solutions.

We had business logic in the web APIs project. We will create, manipulate and store entities from within Web APP HTTP methods.

But we did not reach the data and persistence layer directly, we had an intermediate layer, we called it the organization manager, these managers were asked by our web API controllers (we have dependency injection Will be injected) and will handle the construction, and firmness of the unit, so we want to reduce everything.

This approach has worked very well for us, and we have created a very well maintained and scalable project.

I hope this can be helpful for you, and of course, there is probably a better technique available here.

PS:

We used an IRPOSITIATI interface, which was issued by institutions issued by institutions. This was our only access to the persistence layer. Persistent strategies such as inner logic (such as EF's DBCTNext, or File IO) will be intrinsic to the project.


This is an example of our Business Logic in one of our Web API HTTP methods:

  // "repository" is an IRAP resource & lt; Unit & gt; EntityManager.Transaction (Repository) => {Entity ourEntity = repository.CreateNew (); // Manipulate the repository unit in any way. Add (ourEntity);});  

Comments