Saturday, 1 August 2009

Parsley 2.0

On my last 2 projects I have been using Parsley 2.0. An IOC framework for Flex.

It is an alternative to Cairngorm and does a lot more on top. I have used Cairngorm for a long time and did like it but when you get used to Parsley you really start to appreciate the benefits.

Tom Sugden who I worked with on my last project has written a good blog post about IOC in general here and has some specifics about parsley.

I’ve implemented a sample project that demonstrates dependency injection, managed events and modules. The sample is here and a zip of the project is here. This is a Flex 4 project so you’ll need to download Parsley from SVN and patch it.

The sample project has 2 views in the root with a different instance of the same PM injected into them. The PMs both have the same global domain object injected into them that has a string in. This string is displayed in the text area and you can see that any changes are reflected in both views.

You can also load Module 1 and then load Module 2 inside Module 1. Parsley creates a child context for each of these modules but messages still flow to and from the modules as does the injecting of the global domain object.

The area at the bottom of the screen is a custom log target that displays logs from parsley so we can see what’s going on.

If you want to find out more about parsley the spice factory home page is here. There is some great documentation and a really good forum with excellent support from the creator Jans Halm.

Sunday, 5 July 2009

End of an Era – leaving MS

Friday was my last day at Morgan Stanley. I had a great time working there, made some good friends and met some very talented developers.

I was there for just over a year and learnt so much in that year.

It was quite sad leaving on Friday and I nearly had a tear in my eye at one point (but don't tell anyone ;) ). I'll only be across the road at my new job with HSBC though so I'll still be able to meet up with the guys.

Here is a picture from the last pink shirt Friday. It was the first time I participated as the pink shirt was a leaving present.

A special mention to Alex, Ged, Johnny, Ben, Sam, Leon, Tom, Dianne, James, Christie, Nick and Claire. I hope we’ll stay in touch and stay friends.

Sunday, 21 June 2009

Picasa Tool Update

I’ve updated my picasa tool slightly. Firstly I have corrected the spelling from picassa to picasa and I have added some more text fields. This is mostly to make it easier for me to include pictures on my car blog.

Updated version is here:

http://giles.roadnight.name/picasaTool/

There is still more that I would like to do with this tool. Ideally you’d be able to log directly into your picasa account and browse the albums and images directly and pick your image in that way.

Previous attempts to do something similar got tricky as picasa does not have a crossdomain.xml file.

Maybe I’ll do it in an air app one day.

Skinning Panel with borderSkin

I spent far longer than I should have about a week ago trying to skin Panel. This should have been a simple task but it took me about 2 days.

What I was trying to achieve was to skin a Panel with an asset from Flash as a border skin. To begin with we have an un-styled Panel (all the below versions have view source enabled):

If we then add a borderSkin style we can see that the content of the Panel overlaps the titleBar and controlBar:

As we are using our own skin class in this example one possible fix is to make our skin class extend IRectangularBorder:

The problem is though that if we are using an asset to skin our panel we can’t make the asset implement IRectangularBorder. Looking at the code for Panel there is a get viewMetrics function that is supposed to calculate the border around the content area. In our case this is not working so it seems logical that we can override it as follows:

override public function get viewMetrics() : EdgeMetrics
{
    var metrics : EdgeMetrics = super.viewMetrics;
    if( titleBar )
    {
        metrics.top = titleBar.height;
    }
    if( controlBar )
    {
        metrics.bottom = controlBar.height
    }
    return metrics;
}

However if we do this we get this result:

We get extremely odd behaviour in all sorts of other view components even outside our panel. The extra top and bottom that we add to the view metrics seems to get progressively applied to buttons, other non styled Panels and all sorts of other view components.

The solution to this is to change the above code very slightly:

override public function get viewMetrics() : EdgeMetrics
{
    var metrics : EdgeMetrics = super.viewMetrics.clone();
    if( titleBar )
    {
        metrics.top = titleBar.height;
    }
    if( controlBar )
    {
        metrics.bottom = controlBar.height
    }
    return metrics;
}

And we get the following:

I can only guess that the layout class used by Panel retains references to the EdgeMetrics objects returned from super.viewMetrics and this somehow messes up the layout of other components.

I have submitted a bug here that you can vote on if you like.

I hope this blog post helps someone else out who comes across the same problem.

Tuesday, 9 June 2009

Read Write Web article on the Matrix

Read Write Web have an article on the Matrix. They are pretty enthusiastic. Have a look here.

I think that this is all based on the microsite and don't think that they have looked at the actual app.

Shared via AddThis

Tuesday, 2 June 2009

Morgan Stanley Matrix

I’m finally allowed to talk about the project that I have been working on for pretty much the last year. I have been working for Morgan Stanley on a sales and trading platform.

This is by far the biggest project I have ever worked on and there are some really talented people on the team. I have really enjoyed working on this project. I have learnt so much in the last year. Despite the product launching soon there is still a lot of work to keep us all busy for the next few months.

Obviously I can’t link to the actual app as you need a login but there is a microsite that you can take a look at. I didn’t actually work on the microsite but it gives you some idea of what the actual application is like.

http://www.morganstanley.com/matrixinfo/

Google Wave

I'm really excited about Google Wave. It it becomes widely accepted I think it could be really useful. Check out the video:

http://www.youtube.com/watch?v=v_UyVmITiYQ