brainless-studios / alchemist

Other
2 stars 1 forks source link

Consistency between code and serialized data #4

Open methusalah opened 8 years ago

methusalah commented 8 years ago

When we move or rename a component in the code by refactoring, The serialized blueprints are to be rewritten manually.

Is there a simple way to avoid that?

meltzow commented 8 years ago

Its possible that all component gets a id, for example with a annotation or by method. if the blueprint-deserializer read this id inital, it gets all components and search the correct id. So It doesnt matter, what the name or the package of the component. Do be faster at the second time, the blueprint-deserializer modify the blueprint and the it to the last correct "location/name" of the component. Next time the desializer is searching at this "location", if not found, it tries to handle the component with his Id (like described above)

methusalah commented 8 years ago

okay so we need to override the defaut deserialisation by FasterXML for blueprints, to make this id mapping, right? because in the basic constructor, FasterXML will need to know which implementation of the EntityComponent to use.