From: John A. T. <ja...@ja...> - 2006-07-01 18:45:30
|
Erik Vos wrote: >I understand that serialization propagates automatically, as long as >contained objects are serializable too. But I don't know what happens if the > >containment is circular, of which we have quite some cases. >Is Java smart enough to recognize that? >Easy enough to try out one of these days. > > All of the standard serializable containers deal with circular references. However, if you built your own or especially if you built a tree of objects that may be circular (such as token connectivity), then the container object needs to be smart about serializing its children. Also, the nasty bit of serialization is that you will frequently have data in child objects that you don't want to save, such as a cache. That means you have to write your own serializer routines and properly serialize the right children, and then rebuild the cache when the object is recreated from the serialized stream. In my experience, only the most trivial object hierarchies don't have to explicitly be told about serialization (at least for the composite objects). >Does having a DTD save any coding then? >I'm not aware of that, but perhaps you know better? > > It seems to me the value of a DTD is for interoperability with other programs reading the XML file. In this case, it doesn't seem reasonable to think there will general value in having other programs read a Rails save file. Not to mention that if the serialize route is chosen the output won't be XML anyway. >Exactly. >Saving the undo would not be a goal, but a means to achieve reloading >cheaply. >But reloading this way might not be a pretty sight. > > I would think you would just disable display updates until the log replay completes, or at least those that reference the models being built. >My (still vague and provisional) plan would be to start working on Undo, >trying to include Redo as well. If Redo works, we would have a >potential save/reload mechanism. Would that not work or be too ugly, >then we could try serialization or XML. > >Of course there is a lot more work to do (because of which I find assigning >version number 1.0 at this stage a bit overpromising): > >- Implementation of the Route concept and all features that need it: >tile laying validation, revenue calculation, effect of tokens). > >- Help (still very rudimentary). > >- UI improvements. >I expect most user comments will relate to the UI. >And there are still glitches (the Game Status has started flickering again >in certain cases. I know it is caused by something I did recently, >but I don't remember what that 'something' is.... Old age, I suppose). > >- Client/server operation & Internet playability >(I think the latter is more complex than the former, >because authentication and other safety measures come into view). > > Even if you are playing it locally, the safety measures ought to be considered anyway, so to my mind these are exactly equivalent other than perhaps some lobby or opponent finder function you might want for the full net-enabled version. The thought that some network-accessible program is only going to be used locally and therefore security isn't designed in from the beginning is why we have so many MS security holes. >- Implementing other games. >For me, this would be the most interesting thing to work on, >and I can hardly wait to start implementing all games I have (quite a lot). >But I think that finalizing the base code for 1830 with all the >above extra features is more urgent now. > > I suspect this will turn out to be quite a bit of work, since discussion of features needed in other games was tabled until after 1830 was complete. I believe you will find that many of them will require significant re-factoring of classes to get general functionality for the other games. Of course, the closer they are to 1830 the less work it will be to get them working -- for example, 1889 has different companies with some special private abilities, a different map, 50% to float, and diesels can get a higher off-board area -- other than that it is the same as 1830. -- John A. Tamplin ja...@ja... 770/436-5387 HOME 4116 Manson Ave Smyrna, GA 30082-3723 |