Nice to see I made sense to someone ;)
–
AbstractChaosAug 2 '12 at 15:16

@lorancou what's the benefit of having it serialize it versus actually writing the java yourself? i think that's what i have done in the past because i didn't even know this was an option
–
TMPAug 2 '12 at 15:20

2

Serialization is supposed to be an automated save-"output to file" and load-"read from file" of your class instances. Generally a serialization framework (I'm not a Java programmer) will look at the structure of the class and figure out how to translate it back and forth from the desired file type, in this case XML. So you don't have to write all the code to do read and write on each individual property of the class to and from the XML file.
–
ThrakaAug 2 '12 at 15:48

3

@TMP It allows non-programmers to create their own mobs. It also prevents a recompile for just a few tweaks in some mobs properties. In other world, this is a data-driven design.
–
Laurent CouvidouAug 2 '12 at 15:54

You implement the loading of the XML to the Class instance ensuring meaning in theory it could just as easily be any data format, json, flat file, Database its how you use the data that decides what it means. The example i provided was instantiating a new instance of IPersonality based on the String within the tags