Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » FreeStars » Design Delimma
Re: Design Dilemma Sat, 10 April 2004 13:38 Go to previous messageGo to previous message
multilis is currently offline multilis

 
Lt. Commander

Messages: 789
Registered: October 2003
Location: Edmonton, Canada
Sorry, my answer to Overworked is sort of a ramble, hard to otherwise explain my way of thinking. I present ideas, others may use or discard as they like.


No matter what... NO WINX ONLY! (imo)

Also for all the joys of stuff similar to MS Access, it is a real pain in the butt when using a complex database to have to work around the bugs of others, especially when they add new bugs with each version.

I believe everything for the server should be in non-machine specific c++ to keep life simple. 'Relational' is just a means of organising data, it is possible to do relational with simple collections (groups of objects) with links to other objects.

I normally layer OO code so that everything is idiot resistant from the outside, not possible to have a simple mistake cause a stray pointer or memory leak if following the system. I also now try to keep every reference to an object to one variable, for example printing a name of a component only requires an ID rather than a TYPE and an ID. These ideas are to protect me from my own stupidness. Smile

Code outside an object/system would not do memory allocations with NEW, etc. Instead you work with either global objects or local (on the stack) ones which are really just references to the true objects (and memory management is all automatic and unseen).

...

There are a number of existing open source c++ memory based databases I have been looking at a bit. For my own needs I am mostly trying to build from scratch (simpler, cleaner).

One trick that can be used is to come up with a simple format for database structure that is thrown through a simple c++ translator program that turns it into c++ language objects including both compile time and run time ways to reference fields, eg both t.Id and t("Id") as well as extra objects for linking/indexing/etc.

Loading all the underlying data then becomes a matter of a simple text file describing the structure followed by an extra "#include" and command in your main program to "mydb.load(zPath);" to load the various xml files.


[Updated on: Sat, 10 April 2004 13:39]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message icon5.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Just how flexible?
Next Topic: Planet Transfer
Goto Forum:
  


Current Time: Sat Jun 01 22:16:36 EDT 2024