Tuesday, May 17, 2005

Up against a wall...

After working on persisting rooms and zones, I began to question the current method of Room connections. As of now every room has an array of Bordering rooms. The problem comes about when you have doors. As doors must also be persisted, are they really attribute of an individual room or a link between two rooms. I'm really considering reworking the room design to have a hashmap of borders. Borders will then link Rooms and also store other informations such as isLocked and door descriptions etc. While this sounds like the natural approach, I'm really worried about over complicating the design. Also then I'll have a new class (Borders) to persist. The upshot is being able to open a door between room a and room b and having the door being opened from both rooms rather than opening a's door everytime b's is opened. As I've already loaded near complete zones and rooms, the only issue being is that i can't get my persisted Array class to reinitialize with the proper length. Now if I choose to restructure the room linking...once simple routine of loading zones and then loading rooms and linked rooms... will become loading zones and loading rooms and loading borders. I suppose the latter won't be that difficult. Hibernate so far has been fairly straightforward and I've been able to persist simple ADT's without much reading. I'm a little worried how complicated my persistence strategy will be by the time I'm finishing up the common classes.

1 Comments:

Blogger ben said...

Yeah.. so I ditched Hibernate shortly after that. Goodbye!

7:27 PM  

Post a Comment

<< Home