Monday, May 30, 2016

Visitor Models and Maintaining Large Systems

After a hundred+ types maintained by hand, in a version that returns a value with a provided context parameter, and a version that is just a void-based visitor.  I decided that it would behoove me to automate the process of my visitor models.

I have a system that handles reflection, code translation, and so on, and the next step for this project is transformation, or taking code and manipulating it based on what the code is.

I plan on having two steps to the transformation:

  1. 'Refactor Impact' analysis
  2. Transforming
Refactor impact analysis is basically just saying 'Tell me what you are planning to do to the code model'.  I figure this way I can group items which have the same level of impact, ones that aren't planning on majorly overhauling the object model could be parallelized.  Such as those which are modifying an expression, statement or so on, or localizing the changes to a given method, versus its siblings as well.

The next step would be the actual manipulation of the model, taking what we know from step 1 and applying the transformations.

Granted, this will be much easier in theory than in practice; however, I plan on using the system I used to automate the visitor models to automate the analysis/transformation.  Mostly because it's just too much work for one single developer to do in their spare time (that and I'm lazy.)

No comments: