Re: complicated emulation problem



Responding to Woodburn...

I am starting a project where we are attempting to emulate a
complicated machine.

The original machine has many modes of operation with settings that
are on/off or variable, some modes and settings affect other parts of
the system, for example if I change a mode and my speed is currently
5000rpm, it may drop to 2000rpm because of the default values for mode
changes.  Setting to 10000rpm = pump y coolant, 5000rps = x coolant
500rpm = no coolant etc.

This sort of thing is ideally suited to parametric polymorphism. See the category for Invariants and Parametric Polymorphism on my blog for a discussion and some examples. This sounds like


          1 specifies    1
[Machine] ---------------- [Mode]
                             A
                             |
                    +--------+-------+
                    |        |       |
                 [Mode1]  [Mode2]  [Mode3]

Here the [Mode] is basically a specification object that holds data that can parameterize the generic behavior of a [Machine]. The particular flavor of [Mode] is assigned dynamically by assigning the relationship.

Note that the [Mode] flavors' data can be defined in external configuration data. That allows one to modify the configuration of a mode without touching the code because the difference are defined in the data attribute values.


The system is also controlled by two 12" touch sensitive VGA screens. The screens are populated with buttons, some toggle, some radio some
latching, non latching that control the machine. The screens have
many pages and levels. They, must of course, observe the rules.

The UI is an entirely separate problem. Put the UI implementation in its own dedicated subsystem or layer and provide an interface to it that the problem solution uses to talk to the user. Solve the problem of modeling the machine and its modes first and them worry about the best UI to provide for the user. The machine control problem solution doesn't care if you talk to the user via GUI, browser, or OCR of smoke signals; the interface to the UI subsystem decouples their implementations so that the UI essentially becomes plug & play.



************* There is nothing wrong with me that could not be cured by a capful of Drano.

H. S. Lahman
hsl@xxxxxxxxxxxxxxxxx
Pathfinder Solutions  -- Put MDA to Work
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
(888)OOA-PATH



.


Quantcast