I am wanting to write an application for 3 platforms (iPhone, Android, and WPF). I am looking at using monotouch and monodriod to achieve this so I can keep all development in .net
Now I want to be able to reuse as much code as possible so I need a little advise on how I should do this as I don't really have a clue where to start.
How should I separate the project out to allow the most amount of code reuse between the 3 different platforms?
Any suggestions would be appreciated.
I can see code divisions along the lines of Model-View-Controller (MVC) working pretty well here. You can maybe have your Model & Controllers live in a single common project and just have separate projects for the "View" of each different platforms.
This way, you can keep your data model and logic separate from how its displayed to the user. Moreover, you'll be able to re-use your Model/Controller project easily amongst various mobile apps, web apps and desktop apps
I realize this wasn't your question but depending on your requirements you may want to take a look at PhoneGap. Not really a .Net solution but probably worth a look if cross platform is an important issue for you.
EDIT:
You probably also want to take a look at this blog posting (which was posted since you asked your question). Discusses the issues with attempting to support iOS and Android and WP7 with the same code base.
精彩评论