Wednesday, September 28, 2011

.NET portability is not an afterthought (adding another layer of indirection - Portable Libraries part 3)

Before //build/ I was not aware of the Portable Class Libraries Project. The origin of the project is the notion that the number of platform that provide .NET support has increased from one to four and that this number will increase in the future. Making .NET available on more platforms is the future of .NET.

The Portable Class Libraries Project was the first attempt of solving the portability issue but it ran into some constraints. One of them was the increasing complexity: “Portability is an afterthought”.

After watching some of the presentation at //build/ and experimenting with Visual Studio Express for Windows Developer Preview I thought that the whole purpose of creating a portable library was to bridge the gap between .NET and the WinRT.


This is not the case. Yesterday I watched .NET 4.5: Portable Libraries by David Kean and Mircea Trofin at Channel 9. It all made more sense to me.


The show:

  • The first 15 minutes explains portability and the first version of the Portable Class Libraries Project.
  • 15:00 whiteboard time.
  • Explaining the first way to solve portability problem:
  • wb1
  • wb2
  • Explaining the problems with System.NET
  • wb3
  • 22:00 the new solution: one portable library by design.
  • Portability is not an afterthought
  • 28:00
    • You program against a contract
    • It is up to the platform to implement the contract
    • Type forwarding:
    • You program against the exposed api.
    • wb4
    • And the GAC will forward to dll that implements the actual code.
    • 33:00 Portability is a first class citizen
  • 35:00 It is about granularity a method is too small a dll is too big.
  • 36:00
    • Q: Are there two gacs in the Windows 8 world?
    • A: there is one gac. The metro mode is under “us”.
  • 37:00 breaking changes:
    • Type
    • wb6
    • wb7
  • 45:00 Close and Dispose. Close is disposed, no more closing just disposing.
  • They reference: A .NET developer's view of Windows 8 app development by Krzysztof Cwalina
  • 50:00 .NET has a great future with portability in mind.

So it makes sense to fix and recompile your legacy libraries. You can port them to all platforms that will have .NET available.

No comments:

Total Pageviews