views:

48

answers:

1

Windows-based client application and web-client application(consuming the same code which windows-client uses) what is the preferable pattern for this scenario? Is it ok to have the code in the common place where both the projects and refer it as dll i.e one which is a windows app and other which is going consume the same code which windows client will be exposing.

+2  A: 

This is the classic reason behind an n-tier architecture and for the most part, most design patterns like MVC or any other design that separates the UI ( view ) from the application logic.

As to sharing code, most definitely. Assuming you are using Visual Studio in my terminology, I would have (at least) one project specifically for the fat client, one for the web client, then multiple projects for your DLLs ( by making multiple DLLs, it enables easier code re-use if you just need a piece here and there ). Then have all your DLLs output to the same location using a post build event, so when you recompile either of your apps, they are always most current.

Serapth