[DGD]compile_object() kfun
Erwin Harte
harte at xs4all.nl
Wed Mar 14 05:49:52 CET 2001
On Tue, Mar 13, 2001 at 11:43:49PM -0500, Stephen Schmidt wrote:
> On Tue, 13 Mar 2001, Par Winzell wrote:
> > > Design question: Should the update command call create()...?
> >
> > Hell, no. That'd kill 98% of the reason for upgrades in the first place;
>
> Yah, that occurred to me about 5 minutes after I sent
> the post off. Murphy's Law in action :(
Ah, my good friend, tell him I said hi. :)
> Perhaps as a flag on the update command, update -c or something
> like that to invoke create after the update? Or perhaps a
> separate command that would call create()?
Separate. Call it 'recreate()', 'patch()', 'adapt()', whatever, but
keep it separate, definitely.
The create() function should contain the code to initialize a brand
spanking new fresh object, adding this to its burden is not good.
> > typically for a daemon object the create functions reads something like,
>
> > static void create() {
> > user_objects = ([ ]);
> > }
> >
> > and when you make a small API modification in your sixth year of running
> > a successful commercial game and your 'update' command deliberately zaps
> > your user database, as sort of a side-effect of recompiling the code,
> > you're going to be pretty damn pissed. :-)
>
> But: Surely you would be saving data to a file, and create()
> would reload from the file? Or is the persistence so good
> that saving to file is no longer needed?
The latter. Definitely the latter. Once you've gotten the hang of it
you never want to change back anymore. :)
Erwin.
--
Erwin Harte : `Don't mind Erwin, he gets crabby. :)'
harte at xs4all.nl : -- Par Winzell <zell at skotos.net>
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list