Re: [Agendaware-dev-db] Design
Status: Inactive
Brought to you by:
zacklink
|
From: Shane T. <tur...@ya...> - 2001-11-27 20:00:34
|
I have a lot of the ideas set up already that you are speaking of. The current version of code I have setup also performs connection caching so the overhead of establishing connections to the database are not a factor once connected. Also, the version I have dynamically loads the appropriate shared library that contains the database implementation layer. This can all be configured through the configuration file and no recompilation is necessary. All one has to do is go write the specific implementation (by implementing the virtual classes) and then compile a shared library. Next, edit the configuration file and bounce the server. I'll post these soon, so you can start looking at them. The abstract classes I have setup mirror the Java DB classes so it should be pretty intuitive how they work. I'm currently working on the connection handling portion of the server. Let me know what you think. --- Agyani <ag...@my...> wrote: > Proposed Database Design: > > An abstract class containig only pure virtual > methods is used as the base class for all methods > relating to db. The db access class extends this > base class and provides all the necessary > implementation. Data is shared between the server > and the db class by way of structures(struct user > etc), these structures have been defined in a > different header vardef.h (VARiousDEFinitions). The > server will work only with the methods provided by > the Abstract base class, it creats an object > Database db = Postgres(info) (where info is a > structure holding data to estabils a connection to > the db) and now works with the interface methods. > For other db's you only extend the base class and > replace relevalt include file and Database db = > Oracle(info) and recompile.This is what presently is > on and has been to some extent coded(skeleton > ready). > > > Ideas/Comments Required: > > Thinking on the lines of Java refelection api, if we > could come up with some way of dynamicaly > loading/initilazing the Database object in the > server with the relevant db class by just changing > the name of the db in server.conf ? > > Thought: > We could have the class name and file name just the > same and lookup for the relevant class pointed by > the name stored in the server.conf, then create an > object and pass it over to the server. This all > should be done by a different class in between the > server and the db class something like > dbclassloader. > > rahul > __________________________________________________ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 |