Cool thing about DBs is there are a lot of ways to do things.
Normalization and religious arguments aside, the first thing you need to
do is to NOT think of a DB as a glorified file.

The idea of writing them "in order" does not apply. You have tables that
contain your objects, in an arbitrary order.  The DB is not designed to be
used in a procedural or an iterative fashion. You need to leverage the
power of the relations.

One possible way to do this is to have your table of objects. And then
have a table called Contents. The Contents table would store the object id
of a container (object_container_id) and the object id of the inner object
(inner_object_id). Since a container is an object, it could appear in
either of those columns. Tables used in this way are often referred to as
"mapping tables" as they just show how two objects relate, but don't story
any data themselves.

Now I'm not saying this is the way to do it, as I honestly haven't taken
the time to plan out how I would convert my mud to run against a DB, but
this is one way that could potentially work out.

Hopefully the other people on the list who have actually converted their
muds to use a DB (Richard IIRC) can lend some of their insight as well.

> Ok, someone explain how I should do this maybe....
>
> converting pfiles and whatnot over to database....here's my problem...
>
> in a pfile, objects inside a container are read like so and wrote like
> so...
> container
> object with nest
> container
> object with nest
> object object
>  asdkfhsdfkl
>
>
> yeah, well how do I do this with a table?
> am I gonna be able to write them in order...and read them back just as
> easily....or is there a big thing that I have to go through, what do
> you guys think?
>
> any other simple little tips and tricks used for pfile conversion are
> welcomed as well...
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>

Reply via email to