Monthly Archive
Browsing all posts from April, 2009.
June 26th, 2008
While asking the user explicitly for an increased quota makes good sense, it should be avoided whenever possible because it is irrelevant to the experience of using the application and it represents a potential barrier to use. With that in mind, the scant 100 kilobytes we have to work with could be stretched significantly by providing the GZipStream and DeflateStream classes from System.IO.Compression. Unfortunately that is not the case.
Two things get in the way in Silverlight when we attempt to serialize or compress values: serialization, and compression. You can find an approach to serialization here, and a port of…
Continue reading "Frictionless data persistence in Silverlight 2" »
June 26th, 2008
With a goal to create a Silverlight declarative persistence solution similar to one I recently wrote for ASP.NET WebForms, I quickly discovered that System.IO.Compression no longer contains the GZipStream class we could use to achieve the goal of compressing IsolatedStorage. With a 100kb quota imposed on the browser that can only increase with explicit user permission, it makes sense that we would want to reduce the size of our required state as much as possible to delay or prevent this prompt: it’s an opportunity for both user confusion and support overhead.
Our new goal, then, is to support zip compression in Silverlight…
Continue reading "Compression in Silverlight 2: porting SharpZipLib" »
June 26th, 2008
Note: This post is, essentially, a re-tread on the serialization solution explored by Rockford Lhotka during a prototype of CSLA.
That last little while I’ve been working on a persistence solution for Silverlight that requires both serialization and compression to have any value. These two concepts are, unfortunately, fairly difficult to implement in Silverlight due to the fact that they no longer exist. Serialization is slowed by the following limitations:
1. There are no Serialization attributes. This means no concept of a formatter that we could use to blast objects into binary, or XML, like we enjoy in .NET today.
2. Reflection is limited…
Continue reading "Serialization in Silverlight" »
June 21st, 2008
Sometimes you come across a riff that really strikes a chord; for me, this happened when I read an older article demonstrating using attributes to declare where fields on an ASP.NET page persist; in the Application store, Context, or ViewState. I think the value of this approach is that it allows a developer to treat their Page and UserControl members as plain properties, and then declare how those properties will persist without having to write implementation-specific code. Even at its most elegant, saving a value to one of the many persistent targets might look something like this:
public int Foo
{…
Continue reading "Frictionless data persistence in ASP.NET WebForms" »
Socialized