 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Heiko Tappe Guest
|
Posted: Wed Nov 02, 2005 8:50 pm Post subject: Design question |
|
|
I am looking for some kind of RDBMS replacement for
hierarchcal data storage (like windows registry).
But with a few enhancements.
One main enhancement is the feature of letting some administrator
define the scope for the storage (per what I call "category").
And I am looking for a good database design for this problem.
So assume in my application I would like to load/store the
size/position of my windows. For this I would define a new category
"WIN_SIZEPOS".
For all categories there is a list of possible scope names.
These scopes could be something like "COMPUTERNAME", "USERNAME",
"USERGROUP", "RDBMSLOGIN", "COMPANYNO", and so on.
The values for these scopes are usually set when the application
starts or after you logged in to some database or whenever.
For example if it was only the windows registry I wanted to be
replaced I would only need the scopes "COMPUTERNAME" and "USERNAME".
Because the windows registry is (more or less) locally stored for the
user. But I want more. And I want it to be changeable by an administrator.
Back to the WIN_SIZEPOS example. Maybe the administrator wants this
category to be handled in the scope of "COMPUTERNAME", "USERNAME" and
"COMPANYNO". "COMPANYNO" is just some number the user enters when he
starts the application. The database is devided into different
companies/departments.
Now all load/save actions for the category WIN_SIZEPOS are for
instance in the scope of COMPUTERNAME=PC01, USERNAME=ALI and
COMPANYNO=007
In my source code I would just have something like...
Sometime when the application starts:
setScopeValue('COMPUTERNAME', getComputerName());
setScopeValue('USERNAME', getUserName());
setScopeValue('COMPANYNO', "007");
....
When a windows saves its size/position:
cfg := TConfig.Create('WIN_SIZEPOS');
cfg.openKey('nameOfWindow');
cfg.writeString('size', <someRepresentationForSize>);
cfg.writeString('pos', <someRepresentationForPosition>);
cfg.closeKey();
The application looks for the scopes which have to be used for
WIN_SIZEPOS and then looks for an already existent instance with the
scope values provided at application start. If not it should create
one and then store the keys/values for this category instance.
So summarizing the above I think I need some list of categories (table
CATEGORY) and a list of possible scopes (table SCOPE).
If you look at the categories as being classes and at the scopes as
being a list of possible class properties I now need a representation
for instances of the classes. And I need some efficient way to lookup
some class instance via its class name and its specific values for the
properties of this class.
Could I make myself clear enough?
--Heiko
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|