Design Issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joris Dobbelsteen

    #1

    Design Issue

    I'm having a slight design/modeling problem and hopefully someone can
    provide me with some good advice or hints.

    The problem is that I have a sensor that captures the time period of an
    object passing.

    The software has a communication layer capable of correctly filtering frames
    (just like a packet filter). Each frame has a command code and a fixed
    amount of data.
    On top of this layer their must be an abstraction of the sensors functions.
    This is where the problem arises.

    A key problem is to keep the software extendible with minimal future effort.
    Currently there exists only a single sensor, which is capable of capturing
    from a single source.
    A future model would extend this functionality with a secondary channel to
    capture a signal from a very accurate time source, including several other
    properties.

    Probably the most simple way would be to implement each sensor into a
    distinct class. This would be simple, but very bad practice. On the long run
    it does not work.

    My second idea was to provide a fixed interface for a sensor, where each
    sensor has different distinct modules. Each module would provides some
    functionality, where one is used for the captured signal, a second for the
    accurate time source. The hardware should advertise these capabilities and
    the software would copy these. This demand only a modification in order to
    a) provide new functionality
    b) correct problems that arise

    - Joris


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Design Issue

    Joris,

    It sounds like you have a number of things that could potentially come
    from different sources here. I would have a manager interface which would
    expose the different aspects of the input (for example, you have a property
    which exposes the time from the appropriate source, and another that exposes
    the actual data from the source). This way, you can swap out
    implementations easily. You just have to be able to predict where your
    boundaries are in terms of what might be swapped out (provider for time,
    input, other input, etc, etc).

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Joris Dobbelsteen" <REMOVE.UPPERCA SE.joris@jAoris 2k.aTth.cXx> wrote in
    message news:41135d45$0 $80310$a344fe98 @news.wanadoo.n l...[color=blue]
    > I'm having a slight design/modeling problem and hopefully someone can
    > provide me with some good advice or hints.
    >
    > The problem is that I have a sensor that captures the time period of an
    > object passing.
    >
    > The software has a communication layer capable of correctly filtering[/color]
    frames[color=blue]
    > (just like a packet filter). Each frame has a command code and a fixed
    > amount of data.
    > On top of this layer their must be an abstraction of the sensors[/color]
    functions.[color=blue]
    > This is where the problem arises.
    >
    > A key problem is to keep the software extendible with minimal future[/color]
    effort.[color=blue]
    > Currently there exists only a single sensor, which is capable of capturing
    > from a single source.
    > A future model would extend this functionality with a secondary channel to
    > capture a signal from a very accurate time source, including several other
    > properties.
    >
    > Probably the most simple way would be to implement each sensor into a
    > distinct class. This would be simple, but very bad practice. On the long[/color]
    run[color=blue]
    > it does not work.
    >
    > My second idea was to provide a fixed interface for a sensor, where each
    > sensor has different distinct modules. Each module would provides some
    > functionality, where one is used for the captured signal, a second for the
    > accurate time source. The hardware should advertise these capabilities and
    > the software would copy these. This demand only a modification in order to
    > a) provide new functionality
    > b) correct problems that arise
    >
    > - Joris
    >
    >[/color]


    Comment

    Working...