Code Reuse Analysis: Portable Libraries for Windows 8 and Windows Phone 8

I have written apps for both systems – Windows 8 and Windows Phone 8 by using portable class library to share and reuse code. Some people like to know how much synergy you will get while developing apps the two systems.

Analysis key figures


Part of the analysis is a single project.


The Windows 8 app and the Windows Phone 8 app are having about 80 percent of features in common. Round about 20 percent are specific features that are unique to one platform.


The project is done by using MVVM pattern. Models, View-Models and Services are part of portable libaries. While the views, all the UI stuff and the background tasks (agents) are part of the platform libraries.


In the Windows 8 app there are 10 views and 7 views in the Windows Phone 8 app.

Analysis Results

I think the best way it to compare the lines of code of the projects. I’m using the Code Metrics feature in Visual Studio to find out the values. So please be aware, that XAML is not part of the analysis.

All Lines of Code: 4887 = 100%

  • Portable Class Library: 2580 = 53%
  • Windows 8 and Windows Phone 8: 2307 = 47%
    • Windows 8: 866  = 17%
    • Windows Phone 8: 1100 = 22%

As you can see, in my project I was able reuse about 50% of the whole code by using portable class libaries.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: