Some time ago we discussed the status of the db4o Silverlight port effort at that point in time.
Well, we are happy to let you know that since then we have been working on the issues presented and that we have made slow but steady progress towards a better developer experience.
Basically we have improvements in three areas:
- Tests ported to Silverlight
- continuous build integration
- assembly loading issues
When we announced that we were working on a db4o Silverlight port we had just a few tests of our test suite running and, worst, the Silverlight build was not integrated into our continuous build loop.
As of today we have fixed, to some extent, both issues; the major bulk of our test suite is already running under Silverlight (with the ones that don't make sense disabled or removed) and better, we are currently building and running the tests in our continuous build process! This ensures that we are not going to introduce regressions on the Silverlight port! The goal is to continue adding tests and eventually start to write specific tests for Silverlight.
One of the most frustrating issues I've found while working on the db4o Silverlight port was related to assembly loading; for some reason we were misled to believe that we could not load assemblies in a Silverlight application and that led us to introduce a workaround that required users to write more code in order to be able to use db4o under Silverlight. Thanks to a Silverlight program manager and some extra research we figured out that actually it is possible to load assemblies and so we fixed our code rendering the proposed workaround unnecessary (the test application has been updated to reflect this change). For those who read the previous post, that means that you don't need to worry about that scary, red warning message anymore :).
In other words, there's no more need for the following code:
#region Assembly.Load() issue workaround
private static readonly IDictionary _assemblyCache = new Dictionary();
_assemblyCache[AssemblyNameFor(typeof(Person))] = typeof(Person).Assembly;
_assemblyCache[AssemblyNameFor(typeof(Db4oFactory))] = typeof(Db4oFactory).Assembly;
TypeReference.AssemblyResolve += (sender, args) => args.Assembly = _assemblyCache[args.Name];
Actually if you try to run a Silverlight application that was written with this workaround you'll notice that it won't compile because the Event AssemblyResolve on the TypeReference class is no more; if you find yourself with such an error, just remove the offending line and related code!
The message? We are still committed to provide a solid solution for object persistence on the Silverlight platform!
As always, feel free to comment.
Your db4o team.