I have an ASP.NET MVC 3 web application with various components / layers, for example:
- Web
- Services (cache, external APIs, cloud services, etc.)
- Kernel (domain logic, POCO, etc.)
- Repository (Entity Framework)
Now, when I do something on my website (for example, submit a form, as well as POST), in the worst case, all layers may need to be notified.
Now I could build all this logic in the HTTP POST action of my controller, but in the logic it becomes really thick and weighty.
I tried using the Publisher-Subscriber (AOP) template, but have not yet found a very good .NET implementation, and I also had people who told me that this is not good practice for application websites.
Can someone give me some advice here, or am I stuck with this code:
[HttpPost] public ActionResult Do(Something model) { _repository.Save(model);
I'm not talking about multithreading or anything like that, but I just take abuse from the controller and put it in components that take care of these actions.
source share