oship-dev team mailing list archive
-
oship-dev team
-
Mailing list archive
-
Message #01623
Re: Terminology Service access
Hi,
On Mon, 2010-11-22 at 11:37 -0200, Wagner Francisco wrote:
> So far I'm receiving a Terminology Service instance in the initializer
> of the class, like this:
>
> class DvText(...):
> def __init__(self, value, ..., terminologyService)
>
> I decided to use the initializer because it's easy to change the
> Terminology Service (if necessary) and because it's easy to test, I
> can create a dummy Terminology Service to simulate the behaviour I
> need. But maybe there are better approaches to do this. What do you
> think?
I think that this is a good approach. Considering that we do need
'something' for this version. But there is a good chance that this will
go away in MLHIM/OSHIP 2.x
All in all, it seems to me to be bad practice to rely on an external
service as part of a class invariant anyway. :-)
If I am not wrong, Tim has implemented this terminology service. Look at oeterm in the source directory.
Sergio
Follow ups
References