gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] GnuMed/Archive // patient object


From: Horst Herb
Subject: Re: [Gnumed-devel] GnuMed/Archive // patient object
Date: Tue, 21 Jan 2003 00:01:23 +1100
User-agent: KMail/1.4.3

On Mon, 20 Jan 2003 23:33, Karsten Hilbert wrote:
> global curr_patient

address@hidden never!!!

If we would rely on a gobal variable to figure out which patient is the 
current one, ... how would we prevent safely inconsitency across modules? Not 
possible, IMHO.

This is what the broker objects and the messenging is for.
It would be legal *within* a module to:

- define a variable private to the module
- define a callback function that registers interest in change of current 
patient with the messenger
- this callback function then modifies that variable

However, this approach has one flaw: if the current patient changes *while* 
the routine that makes use of the current patient obtained via variable is 
active, it would remain blissfully ignorant of that fact unless it polls for 
changes of the variable.

Thus, good design should always rely on the messenger as to which patient is 
the current one etc.

Horst




reply via email to

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