Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I actually strugled with this a while myslef, there are different philosophies on how to implement it correctly, so this is how I understand it in my own words how I understand the relation between the different things involved (Models/Views/Controllers/Business Logic):</p> <ul> <li>Views<br> Have all the Html / jQuery code, they use the data in form of <code>Model</code> instances that come from the controller</li> <li>Models<br> The classes that hold the information your View needs to render (List of products etc)</li> <li>Controllers <ul> <li>They take incoming requests </li> <li>Make the necessary preparations (parameter extraction etc.) to call your actual business logic code.</li> <li>Then the call into the business logic code and retrieve the result</li> <li>Afterwards they take the result and transforms it into a Model that the UI understands </li> </ul></li> <li>Business logic<br> This is your actual business logic code, calling the db etc. I my eyes this is totally separate from the entire MVC thing, in fact it should not even know it is executed from a MVC web application. Usually we put this in a different assembly (class library) to make sure there is no dependency to MVC code at all.<br> This makes it very simple to unit test just the business logic, since there are no dependencies to MVC.</li> </ul> <p>I have seen other approaches where the business logic is actually put into the controllers, but in my eyes that defeats the purpose. We are not building MVC applications to have a nice structure, but also to be able to perform unit test better.</p> <p>Getting back to your question, how does it all relate to ASP.NET 3-tier architecture.<br> <strong>One could say that basically the entire MVC web application is nothing more the Presentation layer (+ wireing up the Presentation layer with the Busines layer).</strong> </p> <p>The other layers stay separate and independent from the presentation layer, as they should have before.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload