Articles

Archive for the 'desing patterns' Category

running tasks in order with a task based sequence manager

The job of running a certain sequence of logic where the next task is dependent on the completion of the previous one is a recurring thing in software development. An example of this is an asynchronous queue of which we wrote in an earlier post right here. Sequence management is something that is invented time and time again by lots of developers but there is hardly any good complete sequencing solution out there. We have fixed this by releasing our nl.dpdk.commands.tasks package which features an incredibly powerful solution for managing sequences of virtually anything in actionscript.
Do you want to make your life simpler? Then read on…
Continue reading ‘running tasks in order with a task based sequence manager’

Using a flashvars / flash parameters registry: configure your flash files externally

Providing data to your flash movie can be done through javascript, through loading data from xml, UrlVariables (post and get) or flash remoting with the actionscript message format (amf), or by passing FlashVars to your movie at embed time in your html page. We are using a software design pattern known as a Registry to be able to have easy access to our externally provided parameters known as FlashVars throughout our application.

Continue reading ‘Using a flashvars / flash parameters registry: configure your flash files externally’

folding, mapping and applying commands on datastructures and collections

Hi, we have a great update on the collections package featuring methods that allow us to map the list, fold it and to apply commands on every item in the list. This sort of extremely powerful functionality can be compared in intention to using specifications on collections on which we wrote an earlier post here. Some more updates include some bugfixes in the unittests and a stack overflow problem occuring only on macs. But this article will focus on highlighting the high level methods we just added. Want to have a huge boost in productivity and clarity of code??? Read on!
Continue reading ‘folding, mapping and applying commands on datastructures and collections’

Flash Remoting and resultsets for ActionScript 3

One of the great features of our opensource as3 package is that it contains a flash remoting package (nl.dpdk.services.remoting), for sending data via the amf protocol, that is fully integrated with our collections package to also be able to use a ResultSet. It is robust, fully unittested, has the power of sorting and selecting via the underlying lists from our collections package and has some very very very convenient features that really make it shine when using remoting as a means of communicating with a remote service.

update 2008-10-21: we added a timeout detection mechanism.
Continue reading ‘Flash Remoting and resultsets for ActionScript 3′

Specification pattern for selection on lists

One thing I really like to use is selection or validation based on the Specification pattern, as originally proposed by Martin Fowler and Eric Evans.

Specifications are a very powerful way to perform selection, searching and validation on any object without putting the logic on the object itself. We would really like a way to reuse our business logic, throughout our application, in several use cases, without cluttering our domain object. We also want a way to generalize the selection criterium on a list kind of structure, instead of writing a wrapper around a list based structure that holds some logic that is needed for our problem domain. We also need a way to explicitly state what our business logic is and make it easily reachable, as business logic changes all the time, depending on the wishes of the client, the users of the application, on the weather and other stuff beyond our control ;). This is where the Specification pattern is a great way of doing business with our application.
Continue reading ‘Specification pattern for selection on lists’

AsUnit modification for asynchronous testing

In an earlier post I wrote something about unittesting with the asunit framework.

In this post I want to shed some light on asynchronous testing and a minor modification we made to the asunit package to be able to run asynchronous tests that can be used to do some flow testing, especially important when the order of the calls to a remote server is important.
Continue reading ‘AsUnit modification for asynchronous testing’

AsUnit unit testing on flash package

One of the main things that need to be done to create any serious kind of software package, is making sure that it is tested to make qualitative statements about the code itself, be able to use it with confidence and to make sure it will continue to work when changes to the code are made.

For our package, one of the goals was to create high quality code, with unittesting in place to make sure the code will behave as expected.
Continue reading ‘AsUnit unit testing on flash package’