I was doing some more coding today and realized that I was implementing *a lot* of unused methods. First, the hack of throwing exceptions when I wasn't using a method in my XMLMap really bugged me, it just wasn't clean. Secondly, I haven't bothered doing anything at all with the getSchema() methods. It makes sense to have it there, but if I'm not use it, why include it just to ignore it.

So I took another step back (any more and I'll be off the cliff) and tried to figure out what I was looking for and stumbled upon the very simple root of what I was doing, an XMLEnabled interface.

public interface XMLEnabled {

        public String getXML() throws XAOException;

        public void setXML(String xml) throws XAOException;


I originally called it XMLBean because of the get/set pair, but there was a zillion conflicts with that, so I named it XMLEnabled and it doesn't seem to conflict with much (though I thought it was used by .Net at first and was twisted).

I haven't gotten much farther than this actually in the redesign, but it looked like such a fundamentally useful interface that I decided to get it out there. What I'm doing from this is extending the XMLEnabled interface with various interfaces that'll take parameters and provide schemas. This way it's all Interfaces, but a bit more mix and match.

Java needs a generic XMLException. I'd like to use that name, but everyone's already used it a dozen different ways. I know it's okay if it's in my package, but in general for something this basic, it'd be nice to have it more generic.

Weee! Refactoring is fun! Good thing I haven't actually done a lot to refactor. ;-)


< Previous         Next >