Boost logo

Boost :

Subject: Re: [boost] [review] Dataflow Library
From: Michael Caisse (boost_at_[hidden])
Date: 2008-09-08 02:38:34


Stjepan Rajko wrote:
>
> Nice! Out of curiosity, (if you can share) what XML syntax did you
> use? With one of the dataflow systems I worked on I ended up using
> something like this:
>
> <component name="A" type="some_source_type" parameter1="value1"
> parameter2="value2" />
>
> <component type="some_sink_type" some_other_parameter="other_value">
> <input name="A"/>
> </component>
>
> At some point I hope to provide an example that uses XML configuration
> files to initialize a network, but built on top of the Dataflow
> Generic Support Layer so that it can be used with any framework with
> an implemented support layer (in the same way the GUI example does).
> There are some nice possibilities using Boost.Fusion with reading the
> parameters from the XML file and providing them type-safely to the
> constructor of the component.
>
>

I have two frameworks that I use. The one that most closely matches
the above description looks like this:

<!-- The framework will create an object of someType using a factory. -->
<!-- The factory can instantiate objects based on loadable modules. -->
<component name="myName" type="someType" >
  <dataMap>
    <input name="data_name_1" internalName="my_inside_parameter_name1" expire="100" />
    <input name="data_name_2" internalName="my_inside_parameter_name2" expire="100" />
  </dataMap>

  <!-- additional component configuration goes here -->
</component>

<component name="yourName" type="anotherType" >
  <dataMap>
    <input name="foo" />
  <dataMap>
</component>

The internalName and expire parameters are optional. internalName allows data inputs
to have a name that the component would know. The expire came about because the validity
of inputs to a component (in the work I perform at least) is often based on the relative
time between inputs. As a simple example... Calculating dew point requires temperature
and relative humidity (RH). When the dew point component has both valid temperature and
RH it can then execute. However, utilizing temperature from 10-minutes ago and a current
RH value may not be appropriate for the application. This pattern of validity occurred
so often for me that I just built handling the constraint into the framework.

The XML description could be improved on I am sure. It has worked well for what I've
needed over the years.

Best Regards -

Michael

-- 
----------------------------------
Michael Caisse
Object Modeling Designs
www.objectmodelingdesigns.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk