R
ru
We use a custom java data object to exchange data between different
modules. This was developed with several getters and setters and all
modues with a reference to such an object could use the setters to change
the content.
Now, we need to provide some modules read only access to that data object.
I was trying to use Interfaces to do this, e.g.
IOntoBaseSubsetReadOnly declares only the getters from OntoBaseSubset.
Thus, when I pass on a reference from a normal OntoBaseSubset instance as
a reference to an IOntoBaseSubsetReadOnly this can only be used to read
from the instance, not write to it.
One of the OntoBaseSubset getters return a LexonSet, for which also a
read only interface, ILexonSetReadOnly exists.
Now, the problem :
the getter method in OntoBaseSubset is defined as :
public LexonSet getLexonSet(){...}
the getter method in IOntoBAseSubsetReadOnly is defined as :
public ILexonSetReadOnly getLexonSet();
During compilation an error is thrown, saying that the return type of
OntBaseSubset.getLexonSet() is incompatible with ILexonSetReadOnly.
While the return type of OntoBaseSubset.getLexon() actually implements
ILexonSetReadOnly!
Does anybody have an idea how I can help this problem. Or an idea bout
another strategy for providing read only access to some instances without
any recoding?
regards,
Ruben
--
---------------------------------------------------
| Ruben Verlinden STARLab V.U.B. |
| E-mail: (e-mail address removed) phone: +32 (0)2 629 37 50 |
| GnuGP ID 032901CE ICQ: 108146714 |
| Key fingerprint = 71DC 0F5A 20C0 B76D 52B3 1ECF 8B8E 79BA 0329 01CE |
| |
| ---------------------------------------------------- |
| Back when I was a boy, it was 40 miles to everywhere, uphill both |
| ways and it was always snowing. |
| |
----------------------------------------------------
modules. This was developed with several getters and setters and all
modues with a reference to such an object could use the setters to change
the content.
Now, we need to provide some modules read only access to that data object.
I was trying to use Interfaces to do this, e.g.
IOntoBaseSubsetReadOnly declares only the getters from OntoBaseSubset.
Thus, when I pass on a reference from a normal OntoBaseSubset instance as
a reference to an IOntoBaseSubsetReadOnly this can only be used to read
from the instance, not write to it.
One of the OntoBaseSubset getters return a LexonSet, for which also a
read only interface, ILexonSetReadOnly exists.
Now, the problem :
the getter method in OntoBaseSubset is defined as :
public LexonSet getLexonSet(){...}
the getter method in IOntoBAseSubsetReadOnly is defined as :
public ILexonSetReadOnly getLexonSet();
During compilation an error is thrown, saying that the return type of
OntBaseSubset.getLexonSet() is incompatible with ILexonSetReadOnly.
While the return type of OntoBaseSubset.getLexon() actually implements
ILexonSetReadOnly!
Does anybody have an idea how I can help this problem. Or an idea bout
another strategy for providing read only access to some instances without
any recoding?
regards,
Ruben
--
---------------------------------------------------
| Ruben Verlinden STARLab V.U.B. |
| E-mail: (e-mail address removed) phone: +32 (0)2 629 37 50 |
| GnuGP ID 032901CE ICQ: 108146714 |
| Key fingerprint = 71DC 0F5A 20C0 B76D 52B3 1ECF 8B8E 79BA 0329 01CE |
| |
| ---------------------------------------------------- |
| Back when I was a boy, it was 40 miles to everywhere, uphill both |
| ways and it was always snowing. |
| |
----------------------------------------------------