Question

I have encountered a situation, where the discussion on whether or not to use tools for a certain SDK arised.

Goal: Developing an OPCUA provider(compliance required) on top of an IDL that already exists to better support third party development.

Options:

  • Using a modeling tool (GUI) which was supplied with the SDK (and is said to produce compliance tested code). Model is created pretty quickly (Tool is not user friendly but at least there is some tool). This tool however seems to be errorprone if not used with great, great caution. (Lots of traps, eg. errors in camelCase thus compilation impossible but that can be fixed with find+replace, behaves strange if TABS are used within descriptions(if copy pasted from documentation), leaves type definition empty if Datatype used is deleted and so forth - took me a day or two to find all of them and fix the generated code.) Output was 170 .C and .H files - which I wouldn't want to write and link by hand.

Problem: Code is completely re-generated (including errors and overwriting adaptions and fixes of course) whenever model is changed.

  • Using Xtext to generate my own model-description language and compile it to valid, compliant, compilable C-code, creating an option to only generate files that actually changed since the last state was exported.

Problem: Maintenance of both: Generator and generated product is a continuous task, often said to be a nightmare.

  • Generating only the most basic files automatically (with the tool mentioned in A) and doing the rest by hand. Never touching the generated files if not 100% neccessary, so overwriting doesn't do any harm.

Problem: Mentioned in A, still remains but might be an order of magnitude smaller.

I'd really prefere to know, whats going on under the hood, but writing all the code by myself is much more errorprone than having it generated (a few 100k LOC). What I really feel I need is some sort of internal versioning system to merge it all together everytime the model has changed, but without the errors. So a really powerful merging tool, using regEx to exclude certain passages would be great...

Has anyone experienced a similar problem, how did you solve it? How can I make sure a third person can reuse my code safely under these circumstances? Should I just write a "best practice" manual for other developers?

Is there a good way to present my concerns to my boss? Giving up is not an option.

Was it helpful?

Solution

So after long discussions and a lot of evaluation we decided to extract a few files, which we have to alter and inject an adapter into these files. These files will be newly generated each iteration and merged by hand, but as sfar as we recon it'll only be very few lines to merge.

(Adapter refers to the 'Adapter Pattern' )

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top