I need to create a new website, I have the database modeling done and I need to start it, I also want to use MVC and LinqToSql.
My boss said that I’ll might need to create an app for Windows Phone 7.
I never follow any good practice or pattern when I’m working on this, what I mean is, when a user clicks a Register button in a web page, I create an instance of my DataContext, validate the input and etc all inside the event handler for that button click.
So, what about when I need to make the WP7 app? I’ll have to copy and paste the code again? I know that I should reuse it, but I don’t know actually how, where should I place the business rules, data access etc…
I was reading about Enterprise Patterns, but I found it too complicated for me as I don’t have much experience yet.
Please advice me on this.
Also, if you can point me to a good sample project that I can check its source code and follow the same architecture, would be great!
thanks!
The MVP design pattern is what you’re looking for !
I’m in a similar case (an application shared between mobile & Desktop on different screen sizes / frameworks) and by using this pattern the Business code is the same and you don’t need to duplicate your code.