Visual programming: reflect changes in code in GUI

73 Views Asked by At

I am working on a visual programming tool based on drag-and-drop components. We are currently able to generate working Python code from our graphical components (each component is a class). The graphical components are connected via arrows and each of them have a settings window with drop-downs, checkboxes, etc for detailed configuration.

Now, we want to do the opposite and let users edit the code and have these changes reflected in the graphical components.

We have been pondering a few different solutions:

  • parsing the code. This seems quite brittle (variable names can change, assignments can happen in conditionals, etc)
  • adding abstract properties to each rendered component
  • passing a configuration object to each rendered component

My intuition as a developer says that the latter two are the most feasible and robust solutions, but I am having difficulties putting my concerns into words that would resonate with the stakeholders.

A related problem on the same topic: we are also looking at the prospect of taking "any" code written from scratch by a user and converting that into graphical components. That is, code that uses the same 3rd party frameworks as we do, but isn't necessarily written with our framework in mind.

Which factors should be taken into consideration when estimating the complexity in such tasks? Are there any success/horror stories on these topics that I could study?

0

There are 0 best solutions below