This post is similar to in MVC / MVP / MVPC, where do you put your business logic? but I am looking for more details. I bought into the Model as a place where the vast majority of business logic should exist. Nevertheless, the model, as I understand it, a lot of things are happening in it: the management of government applications, the persistence of data, storage, data transfer objects, and possibly other things.
I have an application with super complex business rules. When a user tries to perform one specific action in a view, there are about 20 different rules that must check whether this action should be allowed or if the user needs to request additional information. I would like to encode these business rules in a single method in order to support testability and documentation. Should these rules be in the repository class? Maybe in the service layer above the repositories? What is best here, bearing in mind that I am using an ORM solution such as Linq to SQL, EF, or nHibernate?
source
share