Articles

Archive for the 'datastructures' Category

Asynchronous queue demo with a LinkedList

This post will show you the principle of an asynchronous queue, demonstrating it with the LinkedList structure in our package, used as a Queue by making it’s datatype nl.dpdk.collections.core.IQueue.

An Asynchrounous Queue is a queue that is processed with asynchrounous operations. Instead of processing a Queue in synchronous fashion, where you would remove all items from the queue in a loop, the items are removed only when the previous operation has finished (succesfully or not). The time when this is handled is not known in advance, and is event driven rather than procedurally driven.

Most browser cannot handle more than a couple of simultaneous http requests from flash, and just trying to load them all at once (in a loop) is error prone. A queue is a lifesaver in a case like this.
Continue reading ‘Asynchronous queue demo with a LinkedList’

Factory for creating ResultSet from an SQLResult in AIR

There is a minor update in the nl.dpdk.air package.

While creating some AIR applications, it turned out the SQLResult, a resultset wrapper used when working with a local SQLite database is not as powerful as we want it to be. Therefore we wrote a little Factory to convert an SQLResult to an nl.dpdk.collections.sets.ResultSet.

Our ResultSet is also used when doing flash remoting and when returning data from a remote database, (see the post about that here).
So it’s convenient to use when working with local data from a database as well. As an added bonus, it offers some more features than the very simple SQLResult, which is essentially an Array of anonymous objects.

The ResultSet makes use of our very powerful List datastructure, which features sorting (which is better done by the database), selecting, mapping, folding and applying commands as well as a very rich api where you can use the datastructure as a Queue or a Stack.
Continue reading ‘Factory for creating ResultSet from an SQLResult in AIR’

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’