[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] problem with UI/logic separation

From: Hilmar Berger
Subject: Re: [Gnumed-devel] problem with UI/logic separation
Date: Mon, 23 Feb 2004 21:15:25 +0100

On Sun, 15 Feb 2004 23:28:54 +0100
Karsten Hilbert <address@hidden> wrote:

> gmClinicalRecord.__init__() tries to make sure there is an
> active/ongoing encounter. If it finds one with an age between
> the soft time-to-live and the hard time-to-live it must ask
> the user whether to consider that one as still active or to
> proceed with creating a new encounter ...
> There are several options:
> - decompose into __init__ and init_encounter() which can
>   return error codes (cumbersome, undesirable)
why undesirable ? IMHO you are trying to do too much magic in init. If you want 
the user to choose the active encounter (or at least be able to do so) this 
should definitely be done outside __init__. 
> - provide __init__ with a callback function for asking
>   questions at the UI level (doesn't feel clean)
It might not feel clean because having user interaction in __init__ can never 
be clean.
> - just fail the __init__ constructor and let the caller handle
>   the error (cumbersome to fail __init__ specific enough to
>   let the caller know what to do)
IMHO it would be much easier to return some error value from 
> What's your suggestion ?
Split in __init__ and call set_active_encounter() from the GUI level. 
The current design does not allow for something else.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]