Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC and Mediator Pattern

I am trying to build set of reusable components for the ASP.Net MVC3 application. Each component is consisted of it's own model, view and controller.

The interaction between components should be solved using mediator "like" pattern.

Since the components are higher level concept (abstraction) and not "real" objects (technically component is short-lived bunch consisted of a model, view and controller functions), it is probably tricky to implement mediator pattern.

I need good ideas how to technically implement mediator interaction between components using ASP.Net MVC3 and AJAX?

My initial question with initial problem: MVC modular GUI components

like image 684
Dusan Avatar asked May 01 '26 02:05

Dusan


1 Answers

I would keep the controllers and views as simple and possible and create a service layer where all the interactions with other components and logic sits. Also I would create a separate project for the services layer so if you want to build different types of interfaces ( phone apps etc ) you can still use the same services layer. This would also enable some automated testing to check on the logic and interaction between your components. Hope this helps.

like image 196
hopper Avatar answered May 02 '26 17:05

hopper



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!