How to organize a Windows Phone database for the target platform 7x and 8

I took over the Windows Phone project, which had previously targeted the WP 7.1 platform, and with the recent announcement of the new platform, it was also aimed at WP 8.

My VS 2010 solution consists of several projects (data access, model, tests, and the WP7 client application), and I'm wandering around turning on WP8 support.

I should note that the code base is not compatible with WP8 due to the use of Toolkit controls and other third-party libraries specifically designed for WP7.1.

There is also another problem with Visual Studio versions - WP7.1 can work with VS 2010, but WP8 requires VS 2012. Do I have to move the entire code base to VS 2012?

Any good tips on how to properly organize your codebase to avoid duplication and possible painful maintenance?

I think between one solution - several projects and several solutions - reusable projects . Code duplication (for example, two separate folders / solutions) should be the least possible (backup).

+6
source share
1 answer

It is best to do this so that you upgrade all projects to VS2012 in order to be able to support both versions of WP (you can still open a WP7 project in VS2010, despite the fact that it is a VS2012 solution, they cause backward compatibility).

As for the best way to organize the code base, in my opinion, you should create a portable library that supports both WP7 and WP8, and get the whole common code base (probably mostly business logic, especially good if you use such a template like MVVM). Not forgetting the problem with the controls, you should have several different controls for WP8, because the screen sizes do not match, and you can get more information and use different controls. If you still want to use the same XAML code, use only one file in one of the projects and add the same โ€œAs a Linkโ€ file to the other project that you want to reuse.

Finally, you can, and probably also use some compilation of conditional code using the #if directive.

Hope this information helps, and if any sample code is needed, just say it and I will try to collect something.

+3
source

All Articles