gnumed-devel
[Top][All Lists]
Advanced

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

[Gnumed-devel] simplified GUI <-> database interaction


From: Horst Herb
Subject: [Gnumed-devel] simplified GUI <-> database interaction
Date: Sun, 13 Oct 2002 21:29:17 +1000
User-agent: KMail/1.4.7

After analyzing our design over the weekend I would like to suggest the 
following much simplified design:

1.) Each panel derives from a "DataPanelMixin"
The mixin provides functions for 
- OnDefault: filling the widgets of the panel with default data
- OnLoad : filling the widgets with data from the backend
- OnSave : depending on whether data was newly entered or modified from loaded 
data, insertion or update on the backend

2.) All these queries communicate almost always directly with the backend: my 
analysis found that caching data really only makes sense for demographic 
details of the cuurrent patient. The other execption are "patient 
independend" list objects like a post code selector, but that is taken care 
of the "OnDefault" option (which would not update this widget when a new 
patient record is opened)
We completely do away with complex data mapping, data abstraction and 
intermediate caching layers otherwise. If we don't, I found that performance 
suffers instead of the intended improvement.

Drawback is that query results have to be mapped manually for each result and 
widget - but that is not as bad as it sounds.

Program logic flow:
1.) On creation, each panel executes it's "OnDefault" function and then  
registers an interest in specific data with gmDispatcher

2.) Either the backend notifies the registrants asynchronously, or another 
widget/panel notifies the registrants on data changes via gmDispatcher

3.) When a "update" message is received, the panel exectues it's OnLoad 
function and sets the correct values in all widgets

4.) Either when the program closes or when the next "OnLoad" is triggered, 
"OnSave" is executed. A "dirty" flag prevents unneccessary backend activity 
if nothing has changed, and a "loaded" flag decides whether it is an update 
or an insertion on the backend side. No more save/edit buttons.

Requirements:
- all panels that may modify data on the backend MUST inherit from 
gmDataPanelMixin
- whenever possible, construct updateable views mapping the design of your 
panels. This will simplify the manual mapping considerably

Horst




reply via email to

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