Friday, December 21, 2007

JumpShip's Birthday!

Ok, so I realized a little late that it was a year ago that I released JumpShip to the OS world. Since that time I've been personally responsible for introducing the JumpShip framework to more than a few companies I've done Flash work for.

If anything the scope of the project has become more focused on core principles. I've taken some time to lean and use a few different frameworks over the past year and I'm glad to say that while I've learned a lot about the insights and usefulness of various frameworks, I've not needed to adjust the core design principals of JumpShip (which itself was inspired greatly by other people smarter than I).

So although my understanding of how frameworks should be used has changed, so has my understanding of why JumpShip is still a great framework.

As a new year gets started the focus on JumpShip will be to simplify the implementation while keeping the current feature set intact.

My recent experience with Cairngorm leaves me with the impression that Data Binding is a far more powerful tool than I first thought. And although it's implementation in Flex is far too specific and opaque for me (it's not even a standard feature of it's older brother Flash), there is still something about the ease of use as compared to the current JumpShip implementation that makes me think that this area might be a rich vein to mine.

And lets face it, the Rails gateway needs work. I simply haven't kept up with the whole REST movement in the Rails world, and I think adopting more RESTful approach could simplify the JumpShip Rails gateway a whole lot (mostly on the Ruby end).

I'm looking forward to the next year and I'm looking forward to see what becomes of JumpShip.

Jamie

Thursday, September 6, 2007

Enumerable Class for Flash

DOWNLOAD:
http://www.youbits.com/jumpship/JSEnumerable.as

Anybody who has spent any time with Ruby have surely come to appreciate the simple elegance of blocks especially as it relates to enumerable objects like arrays. For those not familiar, you can write something like:

myArray.each {|item|
item.do.something
}

This will iterate over the contents of the array and pass each item to a code block {...} allowing you to perform an operation. In Ruby, variables ( in this case items in the array ) are available within the block by defining them inside the "|...|".

The Ruby syntax makes it elegant but the true worth is in the concept. How many countless hours would be saved over the course of a Flash programmers career if he/she didn't have to always write out "for (var i = 0; i < myArray.length: i++) ...". Well we can't change the language but maybe we can attempt to use some Ruby concepts to make our lives easier.

The ajax library Prototype uses an Enumerable module in JavaScript to Incorporate the Ruby concepts of blocks and the Ruby Enumerable Module to do some pretty powerful things. After taking a look at their work, I thought it would be worthwhile to try to implement an enumerable (JSEnumerable) class in ActionScript that lets you traverse and search any list-based data type that extends it.

The Syntax looks something like:

myEnum.each(function(item) {
item.do.something();
});

You can also add a second parameter to the block function with will contain the index of the item. That would look like:

myEnum.each(function(item, index) {
item.do.something();
trace(index) // 0,1,2,3,...
});

Using the JSEnumerable class requires extending it and defining a hook function called doEach. Since not all enumerable objects are arrays, this class defines how to traverse the data. So if a class extended the JSEnumerable class and had all of its data stored in a private Array called myData, doEach might look something like:

protected override function doEach(iterator:Function) {
for (var i = 0; i < myData.length; i++) {
iterator(myData[i]);
}
}

if myData were an Object, the doEach function might look like:

protected override function doEach(iterator:Function) {
for (var a in myData) {
iterator(myData[a]);
}
}

The JSEnumerable class also includes the following methods:

public function all(iterator:Function):Boolean
true if all items match the conditions in the block, false otherwise.

public function any(iterator:Function):Boolean
true if any items match the conditions in the block, false otherwise.

public function collect(iterator:Function):Array
iterates over the items and returns a new array according to the code in the block.

public function detect(iterator:Function):Boolean
returns the item if the block conditions are true, false otherwise.

public function findAll(iterator:Function):Array
returns an array of all items that match the block conditions

public function grep(pattern:RegExp, iterator:Function):Array
returns the item if the pattern matches the string representation of the item. the item must have a toString() method to produce a result.

public function inc(object):Boolean
true if the object matches an item, false otherwise.

public function max(iterator:Function):*
returns the maximum value as determined by the block

public function min(iterator:Function):*
returns the minimum value as determined by the block

public function reject(iterator:Function):Array
returns an array of all items that DON'T match the block conditions

As far as JumpShip goes, future versions of the JSDataModel and JSDataRecord will extend this class and all the above functions will be available.

Sunday, September 2, 2007

JumpShip for AS3 Released!!!
After an exhaustive port. the AS3 version of JumpShip has been released! The principals differ little from the original AS2 version of JumpShip so there should be very few migration issues (hopefully).

While undergoing the migration I have had a few epiphanies about how to better implement the JumpShip Framework for AS3 / Flex / AIR and the coming months will be devoted to exploring those possibilities. Honestly, most of the room for improvement is on the Ruby on Rails end of the Rails gateway to put in more in line with the REST movement happening over there.

So there are a lot of things on my plate but help from anybody who may be interested is always welcome.

Jamie Scanlon



JumpShip for AS2 Released.
JumpShip, the original AS2 version, has been updated with a major release. It includes several bug fixes to the Ruby on Rails gateway, and a glaring implementation error in the JSDataModel. There are also bug fixes in the JSLayoutManager Class in the extras package.

Since we are all moving rapidly to AS3 I cannot promise that the AS2 version will be updated for much longer. Brave AS2 diehards are welcome to pick up this project where I leave off.

Sunday, July 29, 2007

AS3 Version... Really Soon.

I have basically finised porting the Jumpship Core and Rails code over to AS3. I just need to do do a little more beta testing to make sure it's working. If anybody wants to help beta test, just email me, I'll send you the latest code.

I really should release another update to JumpShip for AS2 also... It's done but I was waiting to reslease JS2 & JS3 at the same time.

Jamie

Monday, July 9, 2007

Update coming soon! the Rails package and the JSLayoutManager are soon to be updated. I found a few bugs and made a few improvements.

I see the JSLayoutManager class as being really key to the project that I'm working on. I want to build it out so that it can be the base class for a user page layout app. I want to be able to let the users place display elements in absolute or relative positions.

Wednesday, May 16, 2007

This is a forum for the JumpShip Framework, an MVC ActionScript Framework developed by Jaime Scanlon and JSStudios. This Blog is very lame, I know, but I'm n the process of acquiring a server to host a blog, and I just wanted to reserve this namespace on blogger. PLEASE feel free to post comments or join our mailing list Here for fuller discussion.