I have this idea in my head that I have started to call Relative Action Group Execution or RAGE. The way I see web applications, there are two main tasks that need to be accomplished:
- Figuring out what needs to be done.
- Figuring out how to do what needs to be done.
For example, in FuseBox, the fuse action would determine what needs to be done (user.list, product.edit) while the circuits/fuses, the MVC framework, or whatever framework you are running, determines the HOW of what needs to be done. RAGE is a twist on the first part, the figuring out of what needs to be done.
Before I get into Relative Action Group Execution, let me just touch upon the problems I have with other fuse-action style notations. But I don't want to pick on FuseBox specifically, so I will just refer to a generic "action variable" that houses some sort of defining value for the system. If you think of a web application like it is a map then the action variable would be the coordinates of a particular action to execute. So, if your action variable was something like "user.editAddress" you would know that you are editing the address of a user.
This is good, but in my head, this is very incomplete as far as coordinates go. If anything, this provides ONLY information About coordinates, not the coordinates themselves. Meaning, yeah, we're editing a user's address, but what user? What address? To make up for this short coming, frameworks will add other defining values to the coordinates such as a user ID and address ID. Now, the coordinates for the above action require an action variable, a user ID, and an address ID.
That's THREE pieces of information required just to define what action is going to take place. And what happens if the action is more specific? What happens if we have a system where we are editing the emergency contact's address associated with a user's contacts? What would that even look like?
user.editContractEmergencyContactAddress??? How many IDs would need to be passed around? Even with something like nested fuse actions (of which I know very little) would this even get any better? user.contract.editContactAddress. Is that better? Does that limit the amount of information needed to define an action?
The problem with most action variables is that the action is, for some reason, separated from the item upon which it acts. Relative Action Group Execution, or RAGE, merges these two required sets of data together into one easy-to-use action variable. So, for the above example where a generic action query string might look like:
... the RAGE query string would look like:
Notice that this is all one variable within the query string.
The RAGE action variable is composed of chained action groups. A group consists of an item and an optional key separated by a colon (:). Each chained action group is separated by a period (.). Going back to the crazy example above that was:
The RAGE'ing version of this might look something like this:
To read this, it would state that we are editing the address of ID (1) that is related to the contact of ID (1) that is related to the contract of ID (3) that is related to the user of ID (34). While this might sounds like a mouthful, it actually makes life much more simple; no more passing around multiple IDs in different variables. No more worrying about what values are called (id vs. userID) - everything is in one place that doesn't even depend on a name.
Relative Action Groups
The idea behind relative action groups is that you don't really need to know where you are in the system, you just need to know who your relatives are. Take, for example, the list of addresses; you shouldn't have to care where you are in the application in any kind of absolute way, you only need to know where you are relative to you nearest relative action group: listing user addresses, listing company addresses, listing "places we made out" addresses. I am not explaining this very well but trust me, this is some good stuff. By making all navigation relative, you tremendously limit the amount of information that you need to keep track of.
So that's my quick little introduction to RAGE (Related Action Group Execution). It's what I have been developing as a navigational system and so far, it is kicking some butt. It's just too easy to use. I am hoping to show some code about this very soon including some ColdFusion components that will parse this out into a linked list of action objects (CFCs).