I am currently designing a new .NET application and would like to keep it UI independant.
Whilst I initally would like to use WPF, I would like to have the option of swapping the UI to ASP or WinForms if necessary.
In a layered design:
View – Interface Controller (ViewModel) – Model – Persistance
is it possible to design the Interface Controller so that it will work with different view technologies, or will I need to replace the interface controller at the same time as the View?
Take a look at my answer to the question “Silverlight with MVVM Inheritance: ModelView and View matching the Model”.
The answer I gave works for your situation too.
In a nutshell, I define the following general interfaces:
Which allow me to define specific interfaces like this:
By implementing your layers against these interfaces you can swap your implementation of the
IView<VM>interface with WPF, Silverlight, Windows Forms or even ASP.Net.