January 2010 Entries
The NY ALT.NET Meetup group met last night and Scott Weinstein delivered a terrific presentation on the Reactive Framework (also known as Rx Framework). If you haven’t heard about it, the Rx Framework is a framework for composing (and consuming) asynchronous events. The way that the framework works is that you subscribe to an IObservable and get notified of new events. Since this is all done async, one of my questions was whether a single subscriber’s consumption of these events is blocking (to itself) or not. That’s probably not the best way to phrase the question, but the code’s...
Yesterday I posted a question to StackOverflow (http://stackoverflow.com/questions/2097364/mapping-to-serializabletype-in-fluent-nhibernate) asking whether anyone could tell me how to map a Serializable type using Fluent NHibernate. The outcome was disappointing to say the least. In 24 hours there have been less than 20 views. It was voted up twice, but no comments or answers were posted. Even worse, there’s another post on StackOverflow (http://stackoverflow.com/questions/2000798/map-to-serializable-in-fluent-nhibernate) that asks this same question and has an answer that’s incorrect (it compiles but throws an exception at runtime). Serializable types in NHibernate (XML) Before I continue, I’ll give a little background. Feel free to skip...
Problem I have a model that uses the State pattern. Some States allow read/write access to the Model’s properties and some are read-only. I wanted a good way to separate the logic for this from my Views; the View shouldn’t have to decide whether properties are displayed as TextBoxes or inside Divs. First Thought At first I was going to create a custom ViewEngine. That ViewEngine would be responsible for choosing the right View – that is, if the View was called “Edit” but the model was in a readonly state, it would change the View to...
Does size matter? .NET’s DateTime class supports a range between 01/01/0001 00:00:00 and 12/31/9999 23:59:59.9999999. Sql Server’s calendar is not quite as big – it starts at 1/1/1753. Therefore, if you have an object with a DateTime that’s set to DateTime.MinValue (or any other date before 1/1/1753) and you try to save that to a database, you’ll get the following exception: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. This recently got in my way. I’m building an application on top of a legacy database. There’s a...