The Wires are the Thing

After dealing with two new module types and incorporating them into the mix, I’m starting to think I need to rethink my module interaction model.  Right now modules communicate directly with those modules they have connections with.  To make the Integer module talk to the Add module, because they each handle data differently, I had to had separate code for each possibility.  This will quickly get huge, and slow and unwieldy. So, I either need to normalize the data being sent somehow, making for a more universal data transfer, or, make the wires the keepers of the kingdom. Right now they’re just pretty lines.  They don’t do anything besides exist.  When they are constructed, they are used to populate a list of ‘moms’ and ‘kids’ for the modules being connected, but other than that, nothing.  I could make them the converters/translators/gate keepers and handle all the unpleasantness.  Something to think about.

Posted in AS3

4 Replies to “The Wires are the Thing”

  1. 1. If you have not already done so, please place a link from NeatTools.org to these pages.

    2. How do you plan to handle polymorphic data typing? Automatic conversion? What are the conversion rules? etc.

    3. It sounds like you need an abstract model for a wire. I would think you’d want to keep it simple. I wouldn’t think that you’d want to make wires have any processing ability of their own, although that’s an interesting notion.

    Wires have two ends. They connect a data source to a data sink. Wires adopt the data type of the data source (which could be another wire). Properties include a start point and and end point, each point an X and Y location (could be relative or absolute; relative coordinates could make scaling the diagram easier, maybe).

    Another aspect to consider might be whether there could be a notion of “depth” in a program. Think of layers of graphical code like pages. Now
    wires coordinates would need an x,y, and z descriptor.

  2. On further reflection, I sort of glossed over the requirement that a wire object requires a connection to a source object and a sink object, and that that has to be integrated into the wire properties.

  3. Last link on the dev page:)

    In the NeatTools event broadcast model, the link object is involved in the transmission of data between modules somehow. I think the data type is figured there, but not sure. For now, all my data is integer type. I’ll jump off that bridge when I get to it.

Leave a Reply

Your email address will not be published. Required fields are marked *