SDL-News: inheritance: types and instances


Subject: SDL-News: inheritance: types and instances
From: Georg Heinrich (georg.heinrich#tzkom.de)
Date: Fri Aug 13 1999 - 11:00:27 GMT


The originator of this message is responsible for its content.
-----From Georg Heinrich <georg.heinrich#tzkom.de> to sdlnews -----

Hello,

I am currently learning SDL and came across this problem:

In a system, you have several blocks that switch lights.

in: Code
out: combination of lights switched on
             ____________
  Code | |
  ----------| blk2Lights |
            |____________|
               | |
               | |
               L1 L2

The blocks in the system have different numbers of lights to switch.
So I decided to specialize them all from one block type switching only
one light. This would be no problem if I specialize each of them from
this base type. But to get the benefits from object-orientation, I
decided to derive them hierarchically, that means, the block type with
three lights is specialized from the one with two lights.
The blocks contain one process that evaluates the Code and switches the
lights. So in the base type I declare a virtual process type that swit-
ches on light, in the specialized types I add gates for the additional
lights to both the block type and to the redefined process type.
Still no problem.
As soon as I instantiate the blocks, a process is demanded. So I have to
insert an instance of the process type in the block type and connect it
to the gates of the block type.
That's where the following problem occurs:
The process instances are also inherited in the specialized block types.
The first light is connected to the first process in the base type.
In the block type with the two lights I can connect the instance of the
redefined block type only to the additional light. If I connect it also
to the first light I get the error message:
"Existing gate. Use 'adding'." Or something similar.

Is this a week point in my CASE tool, or does SDL not allow this?
What kind of problem is this?
Can it be stated that specialisation in SDL is restricted to a fix
number
of gates?

TIA,

        G. Heinrich

-----End text from Georg Heinrich <georg.heinrich#tzkom.de> to sdlnews -----
Join http://www.sdl-forum.org/Society/members.htm for extra SDL Forum Society benefits
For help, email "majordomo#sdl-forum.org" with the body of your email as:
    help
or (iff this does not answer your question) email: owner-sdlnews#sdl-forum.org



This archive was generated by hypermail 2a23 : Sun Jun 16 2013 - 10:41:40 GMT