C++ Loading config files, with extend/inheritance and full error handling

Started by
9 comments, last by Zipster 8 years, 8 months ago

Also doesn't look like they solve the inheritance/extension issue.

I think you're confusing inheritance and extension, which is type-driven and the equivalent of XSD extension and restriction, with the ability to specify "base" XML data that can be overridden, which is a mechanism that you would need to implement manually, regardless of whether your serialization code is generated or hand-written.

You'd still be able to validate your data using a schema, however you wouldn't be able to do so until after you've resolved all your data overrides, at run-time and in-memory. This means that, should you chose the code generation approach, you'd need to make sure the generated code allows you to perform serialization separately from validation (i.e. allow the objects to exist in an "un-validated" state post-load), so you could inject your resolution process before manually triggering validation. Unfortunately, I'm not sure how the aforementioned tools handle this, and since un-validated data is scary, they probably won't let you do this. But it's worth checking out.

This topic is closed to new replies.

Advertisement