Andrew Stephens
Andrew Stephens

Reputation: 10193

Should I consider Portable Class Libraries?

I'm about to start developing a new client-server application, initially consisting of a Windows (WCF) client, but we may look at developing clients for other platforms in the future (web, Win phone, iOS, Android).

Without any firm plans for other client platforms, is there any point in creating PCLs from day one? Or should I just start out with a sensible solution architecture, i.e. keeping potentially shared client code in separate projects, with a view to moving this code into PCLs if we start developing for other platforms?

Upvotes: 2

Views: 67

Answers (2)

Daniel Plaisted
Daniel Plaisted

Reputation: 16744

I'd also suggest using the MVVM pattern, whether you use PCLs or not. This will help you keep your business logic separated from your platform-specific view code, so it will probably make it easier to port to multiple platforms down the road.

Upvotes: 2

bland
bland

Reputation: 1994

Two questions to ask yourself:

  • How far out is this future of other platforms?
  • What are the limitations of PCL functionality/namespaces to your current needs?

PCL will expand further to encompass more functionality and will continue to grow. As it is now, there are some limitations. Do these limitations create obstacles in your development of the base product? If so, is it worth it to use PCL now when you don't even know if/when you will go to other platforms? If you're going to these platforms soon, then start now. If not, you may have too many obstacles today to make it worth it.

Yes, you absolutely should consider PCL. Starting off as PCL would make life easier down the road. But only if it makes sense to do it now.

Upvotes: 3

Related Questions