In most of the documentation that you read about ASP.NET MVC, the whole "Problem Separation" is very much pushed. Dependency injection / control inversion, unit testing, preserving "logic" from views, etc.
But how far is it meant to push? Is this bad practice if a particular task requires additional logic beyond the “three-layer” View / Model / Persistence approach?
For example, I have a solution configured with four separate projects.
Project.Web (ASP.NET MVC) [ References Data.dll, Models.dll ] Project.Data (Fluent nHibernate Mapping) [ References Models.dll ] Project.Models (POCO, Helpers, Factories, etc) Project.Tests (Unit Testing)
So far it has served me well. But for some of my MVC views, I need a very abstract logic, so I need to get involved in Models and arrange the View Model , which is stored in the database.
This cannot happen in my Data section, as this will eliminate the need for reuse, as well as the business logic included in this process. This cannot happen in my Models section, because that would require knowing the Data section, which is not. And I do not want to put it in the Web section, because I do not need a data access code.
Question
Is it a massive violation for me to add, say, a Project.Presentation project that references Data.dll and Models.dll to build what I need? In addition, the project is on the sidelines: is this a bad approach overall or is it something that many of you find it necessary to do sometimes? Part of me feels that if I have to resort to this, I just created my software incorrectly, but at the same time I’m very sure that I did a pretty good job, it’s too abstract to make crude HTML interpretation without agreement the average person.