Programming and other useless stuff: Enhancing SSCXML

Friday, January 02, 2009

Enhancing SSCXML

Ok... so as you might have read I plan to improve SSCXML (Simple State Chart XML) to mirror a little bit better what is actually written in the W3C draft. One thing that is mentioned in the latest version of the draft is the split into different parts such as the data module, the script module etc.

Although they describe them as being two different parts, they mention (in the same time) that the data module must provide a data access language which will allow to access the data stored in the data module.

Now, this sounds like a great idea, but IMHO this also implies that a complete expression parser must be included in the data module. Why? Because once you define a "language" that enables you to access the data, there are also some operations that you want to handle: using a variable to index an access to an array of variables ("a[b]" or "a[10]") or combine variables to create a new one (AKA as assign a value to another variable). Those are two examples of what ideally should be possible with the data module.

Unfortunately this implies a lot more: In fact, implementing a data access language into the data module ultimately means that you have a complete expression parser implemented to access, assign, handle, alter and delete the data.

And there's now the notion of the script module. According to the draft, the script module adds scripting capability to the state machine. They're giving the example of ECMAScript (aka JavaScript).

Now, think a second about what I've written above... complete expression parser... script module... You see it? Yes... for a developer this basically means the same: When you want to include scripting into your state machine, you automatically also have the data module, since you cannot script without holding a basic set of data. This means that for a programmer the data module almost always goes in combination with a script language and vice versa.

Now, my idea is this: The data module is only there to store data is using a very basic scheme: values put into relation with an identifier. For every value pushed into the data module, an identifier must be given. If an identifier is used twice, the previously stored data is replaced by the new value.

This notion of the data module has some advantages and some drawbacks:

Pros:
- no expression parser must be included.
- replacing data is easy.
- the data module is not responsible for solving the value addressing.

Cons:
- Access of large datasets might be more difficult
Example: a is an array of 1000 values. You can access a value by directly indexing it. Since the data module only has simple identifiers, an array must be mapped to a simple scheme such as "a[10] -> a.10" (access the 10th element of an array).
- The script module/expression parser is responsible to create unique ids and to verify that data is handled as expected (IE. temporary data storage).
- The data module would have no garbage collection.

To solve some of the issues, it is important that the value that is actually stored within the data module, is as flexible as possible. Also, one might want to have the possibility to enable the developer to implement his own data values (IE. an object, a specific data type, etc.). The data module must not now how to handle these new data value types. It only has to store them and provide access to them.

I'll write about the interfaces themselves tomorrow. So... keep coming back to take a look at it :)

Have fun and a happy New Year,
Stefan

Labels: , , ,

10 Comments:

Anonymous Anonymous said...

Spot on wіth thіs ωrіtе-up,
I really feel thiѕ webѕitе needs far moгe аttention.

I'll probably be back again to read through more, thanks for the info!

my page - bucket truck
Also see my web page :: aerial lift trucks

4:50 PM  
Anonymous Anonymous said...

I haѵe read so many posts conceгnіng the blοgger lovers but thiѕ piece of writing iѕ trulу a pleasant poѕt, keeр іt
up.

Also visit my web page Eti bucket Trucks
Also visit my blog post : eti bucket truck for sale

12:56 AM  
Anonymous Anonymous said...

I thinκ the admin of this web pagе іs tгulу wοrking
hard in favor of hіs web page, for the reason that here every
stuff is quality basеd information.

Here is my web-ѕite ... dallas car insurance
Feel free to visit my web blog dallas tx auto insurance

10:01 AM  
Anonymous Anonymous said...

Hi! I know this is kind of off-topic however I hаd
to ask. Dоes building a well-establishеd blog suсh aѕ yourѕ require a lot of work?
I аm completely neω to bloggіng hοwever I dο wгite in
mу diary everyday. ӏ'd like to start a blog so I can share my experience and feelings online. Please let me know if you have any ideas or tips for brand new aspiring bloggers. Thankyou!

My web page: dallas auto insurance
Also visit my page - dallas auto insurance

10:29 AM  
Anonymous Anonymous said...

Wow thаt ωas odd. I just wrote an ѵerу long comment but after I clicked submit my comment dіdn't appear. Grrrr... well I'm not writing all thаt oveг
again. Anywaуs, just wanted to say grеat blog!


Vіѕit my web ѕite :: richardson Car Insurance provider
Also visit my webpage - car insurance

12:05 PM  
Anonymous Anonymous said...

I was еxtгemely plеasеd to discovеr this greаt
site. I need to tо thаnk you for youг time foг
thiѕ fantastic reaԁ!! I definitely loved eѵery bit of it and i also have уou sаved as a fаνoгіte to see
new things οn your site.

Alѕо visit mу blog post tens pain relief

9:29 PM  
Anonymous Anonymous said...

I аm tгuly gгаteful to thе оwner
оf thіѕ ѕite who has
shared this gгeat pοst at at this time.


my sіte tens therapy

4:06 AM  
Anonymous Anonymous said...

І am trulу gгateful to the οwner of this site who has shareԁ
this gгеat post at аt thіs time.


Lοok at my blog; tens therapy
my site > tens machine

4:06 AM  
Anonymous Anonymous said...

Attrасtive section of content. I just ѕtumbled upon your web site and in аccession cаpital to аssert thаt I gеt іn faсt
enjοyed account уour blog poѕts.
Αnyway I'll be subscribing to your augment and even I achievement you access consistently quickly.

Also visit my blog post :: cab service irving tx

1:11 AM  
Anonymous Anonymous said...

Ηi, I wаnt to subѕcгibe for this webρage to get
most reсent updates, thus where сan і do it
please help out.

Mу webѕite ... dallas seo Client

1:42 PM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home