DAL -> BLL

Split up the ASP.NET MVC application in two:

  • One part is your original ASP.NET MVC application, but without any logic whatsover. Just keep the Composition Root and your Views (.aspx, etc.) in this project. Since this is the Composition Root, you can have references to all your other projects. However, since all logic would have been extracted, this is now a Humble Object, so it’s okay to have all the references at this level.
  • Extract all the logic (Controllers, etc.) into an Application Model project, which would just be a normal library project (.dll) that references the ASP.NET MVC binaries. This project would need to reference the BLL to get at the interfaces, but that’s okay. However, both the Application Model and the BLL are effectively shielded from the DAL.

The resulting layering would look like this:

  • ASP.NET MVC application
  • Application Model
  • BLL
  • DAL

Leave a Comment