Reputation: 893
I've created a business/data architecture that I'm happy with, and I'm presenting it in Winforms in a fairly standard way by having a controller consume a service and bind the result to a Winforms Datasource. Now, I want to expose my architecture through MVC 3, and I'm looking for guidance on how to avoid duplicating all my controller classes. I'm a little thrown by Controller and ViewResult not simply implementing interfaces that I can apply to my existing controller classes and plug into web views. Ideas?
Upvotes: 0
Views: 139
Reputation: 236328
ASP.NET MVC uses front controller architecture, which provides entry point for handling web requests. This controller is coupled with web environment (HttpContext, Request, Response, etc), and it returns view, instead of updating existing one. Thus you can't and should not use it in WinForms development. What you should reuse is model, which is environment independent and does not know anything about controllers or views.
Upvotes: 2