libraries:

full
mvc
assets
storing
distributing
processing
conditions
caching
recycling
stating
responding
interpreting
base
monitor

examples:

tic tac toe

description

I don't know if you're familiar with the popular mvc project frameworks for as3. Some of them are working with these notifications. I hate them. I always feel like I am on a fish market: "I NEED TUNA." "I WANT HERRING." "HERE IS FISH!!!" What the heck? And then I heard an awesome idea during my work as programmer. It was part of a project and so deeply embedded in the project’s code that it could not be withdrawn. So I decided (and asked for permission) to implement my very own version, that can be used in different projects and here we are.
It is very easy to use if you have access to the Distributor. In that case you can simply plug a Cable. That is a custom class that takes a Wire at its constructor. Every call to that Cable should be made to the Wire reference as well. Your Cable should implement a custom interface, so you can cast the Cable into that interface when you take it. You can also install devices. These are custom classes that are just implementing the interface as well. If the Cable gets a call, all installed devices at that Cable are getting called, too. So you are able to call any function at that Cable with the chosen arguments including the return value, and your classes are controlled/protected by an interface. The position where you make a call to a Cable just needs to know the Distributor, the interface of the Cable (if you are working with interfaces, which I strongly recommend) and the key of the Cable. When installing a device you only need to know the Distributor and the key of the Cable. Your device should also know the interface, which you are hopefully using. As you can see, the position where you call the Cable, doesn't need to know the device(s), but you can make exact synchronized calls with custom arguments and return value.
No forced asynchronous calls.
No anonymous argument types.
All controlled by your custom interfaces.

This library is an important part in the mvc library of the codeboxes framework.

download

version 1.1 | released on Jan 5th 2016 | documentation

changes:
Added the functionality to generate the Cable classes at runtime from a given interface as template. All you need are some as3commons libraries, which are listed in the dependencies.
Added "[codeboxes]" to trace statements.

version 1.0 | released on Aug 29th 2015 | documentation

author

Stefan Dubsky - stefan[at]codeboxes.com

navigate:

description
download
author