Using Objects to Initialize Static Fields: Good or Bad

I have a Command interface and a bunch of Commands that implement it (i.e. CmdJoin,CmdQuit). These Commands' settings change at runtime (i.e. required access levels, String identifiers). I don't want to have to store an instance of each Command in a database to save their settings , so instead I'm using the obvious solution: making static fields in these commands for these settings. This way, I can use a Simple Factory to return a Command, change its settings, execute it, and forget it, and still have the settings for that Command apply to all Commands. Yet I want to be able to modify and access fields of different Commands polymorphically. How can I have these commands' settings-related fields be static while modifying and accessing these fields polymorphically?

Here's what I have though of. First of all, interfaces can't have static methods. Secondly, neither can abstract classes. I also can't extend a base class which implements these settings-related fields and their interface, because then the fields would belong to all child classes of this base class, whereas I just want it to belong to a certain child class of the base class (i.e. all instances of CmdJoin or CmdQuit).

I've thought of two solutions.

The first is implementing a concrete interface in an abstract base class (getting rid of the Command interface) and overriding it in child classes, so that I can use the interface of the base class and the fields of the child classes.

The second is having no base class, and just a bunch of Commands implementing the interface with their own static fields. I would initialize these fields by passing arguments to their constructors.

These solutions seem very sloppy though! Are there any better ways?

[1773 byte] By [ktm5124a] at [2007-10-2 13:21:59]
# 1
To clarify, I want all objects of type A to be able to respond to a static method declared in type A yet still remember their implementation of this static method. I provided two solutions that I have thought of, and I find them sloppy, so I'm asking if there's a better way.
ktm5124a at 2007-7-13 10:58:26 > top of Java-index,Other Topics,Patterns & OO Design...
# 2
It's not really clear to me what you're trying to accomplish. However, it sounds like you want something to be both bound to the class and bound to each instance. You can't do that.
jverda at 2007-7-13 10:58:26 > top of Java-index,Other Topics,Patterns & OO Design...