gnumed-devel
[Top][All Lists]
Advanced

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

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


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] problem with UI/logic separation
Date: Mon, 16 Feb 2004 02:54:03 +0100
User-agent: Mutt/1.3.22.1i

>> And how would I learn of the user's decision inside the
>> __init__ ?
> Why inside __init__ ???
Because that's precisely the point.

> The user makes a decision, via dialog perhaps, the dialog posts the event, 
> the 
> event handling module processes it.
Please read the OP.

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346
--- Begin Message --- Subject: problem with UI/logic separation Date: Sun, 15 Feb 2004 23:28:54 +0100 User-agent: Mutt/1.3.22.1i
What's the "best"/accepted way to deal with this: non-GUI code
needs to make GUI functions run but has no good way of simply
returning with an error so that the (GUI level) caller can
take appropriate action ?

Specific situation:

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:

- do away with soft/hard timeouts (undesirable)
- only use hard timeout on __init__ (flawed)
- decompose into __init__ and init_encounter() which can
  return error codes (cumbersome, undesirable)
- provide __init__ with a callback function for asking
  questions at the UI level (doesn't feel 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)

What's your suggestion ?

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

--- End Message ---

reply via email to

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