Articles

Tag Archive for 'collections'

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’

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’

The collections package

The collections package has some classes in it that provide a very powerful way of storing, retrieving, selecting, sorting and manipulating data. It features well known datastructures like lists (both the double linked list version and the array list version, very useful for storing lists of like object instances, which is useful in almost every application you encounter), queues (very useful for getting things done in a specified order, first in first out or FIFO), stacks , deques ( double ended queue, can function as a stack and a queue), heaps, priorityqueue, set, resultset (very useful when using flash remoting and a database) and trees (for menus, games, searching etc., both binary and n-ary trees). It is a very comprehensive library, influenced by the Java collections package, with a clear interface, easy to use and very consistent throughout the different classes. Know one of them, know ‘em all.
Continue reading ‘The collections package’

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′