[MUD-Dev] Extensibility

Mike Shaver shaver at mozilla.org
Tue May 7 10:59:34 New Zealand Standard Time 2002


On Sun, May 05, 2002 at 04:42:10PM -0400, Ben Chambers wrote:

> Is it possible to use the ability of Java to dynamically load
> classes to make it easier to add new features to your MUD without
> recompiling?  I was thinking that instead of having code snippet
> archives it would be cool if there was some source of expandable
> Java classes.  You know, if you want this new feature, simply
> download this .class file and load it into the server using the
> graphical front end.  Then simply reboot the server (this might
> not be necessary) and without recompiling or anything you have
> updated your server.

There are a number of mechanisms for avoiding recompilation, and
Java's dynamic class loading infrastructure works pretty well.  Some
sort of registry system to list the classes that need to be pulled
in, and you're off to the races.

Avoiding a restart of the server is harder, and I've found it to
have some fragile edges in my non-MUD component system experience.
The first problem that people run into is that some modules will
expect to be able to run their initialization code before the server
"gets going", and it's sometimes pretty difficult to handle a "live"
injection.

Then you have the other problem, which is unloading.  Adding a new
feature is something you probably do once per feature, but most
add-on modules go through a cycle of updates, and getting the old
one unloaded and the new one loaded can be Rocket Science.
(Especially on older JVMs with sub-optimal classloader behaviour.)

Building this sort of system well isn't easy -- ask the Apache guys,
or Mozilla's XPCOM martyrs -- by any means, but I don't fully
understand how much effort you're willing to invest in it.  I'd
really recommend rebooting the server, though. =)

Mike

_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the MUD-Dev mailing list