« Reminder: RIA Exemplar Challenge Deadline is 22-May-2010 | Main | What posts would you like to see about HTML5? »

May 31, 2010

Comments

James Weaver

Ah, good point, Jonathan.

Thanks,
Jim Weaver

Jonathan Giles

Jim,

No, I was meaning something like this:

public class BorderLayout extends Container {
public var north:Node;
public var east:Node;
public var south:Node;
public var west:Node;
public var center:Node;

override public function doLayout():Void {
...
}
}

It's not necessarily a better solution, just an alternative that seems a little cleaner to me.

James Weaver

Jonathan,

If I understand your question, correctly, would you have subclassed Node to hold the directional value for the node? I chose to use the id variable to avoid that, because it was readily available.

Thanks,
Jim Weaver

Jonathan Giles

Jim,

Great post. I am personally a fan of the BorderLayout from Swing and often made use of it.

I'm wondering why you chose to use node.id as the position identifier rather than, say, have 'north', 'south', 'east', 'west' and 'center' properties on your BorderLayout class?

I know it's basically 'six of one, half-a-dozen of another', but I'm curious what tipped you in your direction. I would have almost certainly chosen to have separate properties instead.

-- Jonathan

The comments to this entry are closed.