Re: Working with Transient Objects

From: Elia Morling (eli..amiljen.se)
Date: Wed Jun 30 2004 - 13:18:44 EDT

  • Next message: Andrus Adamchik: "RE: Working with Transient Objects"

    Greetings Todd,
    I will give a new example, as people have trouble seeing my what I'm stuck with. ;)

    I'm creating a game server with lots of Area(s) in it for Player(s) to run around in.
    All Area(s) exist in a World object. There are lots of persistant Area(s) like towns,
    villages and wilderness. However there are also randomly created Area(s) to add
    an extra flair to the game. So each time the game server starts up I want to add a
    random maze. The maze is an Area which in turn has lots of Room(s), Object(s)
    and Being(s).

    The maze has to be added to the World object so that it makes sense with the rest
    of the code. After all I might want to list all my Area(s) using a World.formatListOfAllAreas()
    or I might want to see which World my Area is part of using Area.getWorld(). In
    short the maze should behave exactly like all Area(s) _except_ it's highly temporary.
    Comitting the temporary maze to the database is nonsense as it in turn will result in saving
    lots of ther Room(s), Object(s) and Being(s).

    This is just one example. I might want to throw out random Being(s), Item(s) or
    what each time the game starts.

    I was advised to use the Cayenne DataObjects, but they seem to assume each one
    should be mapped to a row in the database. This might be the case with simpler
    applications like forms and so forth. I can't believe anyone hasn't run into this before.

    Elia

    ----- Original Message -----
    From: "Todd O'Bryan" <toddobrya..ac.com>
    To: "Elia Morling" <eli..amiljen.se>
    Sent: Wednesday, June 30, 2004 6:49 PM
    Subject: Re: Working with Transient Objects

    > Can you send a brief, say 10-line, example of what you want to do.
    > I'm having trouble understanding why you need temporary objects in a
    > DataContext which are not, then, in the database. If we knew what you
    > were using them for, we might be able to better advise you on how to
    > handle them.
    >
    > Todd



    This archive was generated by hypermail 2.0.0 : Wed Jun 30 2004 - 13:18:46 EDT