Saturday, February 20, 2010

Is it a pattern?

I have noticed a trend in application design, one which I suppose became obvious some years ago when I really became interested in the use of reflection and the advantages of metadata in the form of attributes used at design time.

I was busy with a project for a financial sector client and had to come up with applications that were able to edit really complex data types but do it in a way that was easy for a developer to reuse in an application. At the time I was doing a lot of .Net design time work so my awareness of attributes such as TypeConverterAttribute and EditorAttribute came in handy. I also developed my own attributes to be used in presentation layer stuff and found that the idea of creating a tiny helper class that was instantiated when required, used and let go again was a recurruing theme. For example, when properties are read for databinding, the TypeConverter for the data type will be invoked and I found that I applied the same model to many other things in my applications.

Now I see the same trend in WPF for example when its so simple to write a tiny bit of code which is instantiated in the static resources and used to provide useful calculation, binding or conversion routines. As an application designer and, as I see this as a pattern, I wonder if there is really room for a formal "Granular instance" pattern and if it becomes worthy of mention.

Friday, February 12, 2010

Styles and storyboards in code


Today I have been playing wit some WPF to emulate the idea of the Mac dock in a scrollview that shows pictures.
I thought I would use a mixture of XAML and code to create storyboards that expand an image when the mouse is over it and reduces it again once it leaves.
For this I created a single style, programmatcally filling the EntryAction and ExitActiion for the trigger.
This all worked fine until I tried to cope with a resize. First I noticed that my effects ran slower as I resized. Obviously I had added and compounded the storyboards such that there were many being triggered at once. Upon trying to remove them I found that animations get "Sealed" and can no longer be changed. As this is interesting I think i'll do a wee article on it.
I had a discussion with a friend the other day who said that WPF still seems to be difficult for use in desktop line of business apps. My current investigation is in some way related to that idea because I think that with judicious use of code and XAML much more is possible.



Wednesday, February 10, 2010

Climate madness

I swear I just saw a glacier shoot past my window and take the roof off the house next door!