Edit Rename Changes History Upload Download Back to Top

XML Configuration Files

One of the nice little tools in the Open Repository is the XML Config Files package. It was put together by Dave Murphy and Travis Griggs.

Many applications have a need to serialize some kind of configuration information - and people tend to take one of two tacks:

The first choice involves schema migration whenever any of your objects changes shape; the latter involves creating your own framework and then maintaining it - not to mention that most textual formats suffer from some level of fragility.

Enter the XML Configuration package. I have been using this on the BottomFeeder project with Dave Murphy - and it made life a lot simpler once I switched to it. I no longer have to worry about malformed textual elements that screw up my stream parsing; the XML config package just handles that. It's also amazingly easy to use.

Save an object to a file

	| file |
	file := XMLConfigFile filename: aFile.
	file saveObject: self.
 file saveConfiguration

Read the object back in

	| file  |
	file := Tools.XMLConfigFileSupport.XMLConfigFile filename: filename.
	^file loadConfiguration first.

And that's it - no fuss, no muss - easy serialization of objects. Try it out!


Edit Rename Changes History Upload Download Back to Top