2016-10-18 5:01 GMT-03:00 Otto Behrens <o...@finworks.biz>:
> +1 for the visitor. What would be nice is to generate methods in the
> form #visit<Class Name>: for all classes in a given hierarchy (eg
> Magritte's MAVisitor). The default implementation of such a method
> would be to call #visit<My Super Class name>:
> We have been using state machines for a long time and have built
> generators for it (on a previous project, for which I do not have the
> code). I still think that is a useful idea. It is difficult for the
> code generator to maintain changes in the generated code with changes
> in the "spec". Will you then define a DSL for the state machine?
Do you mean internal or embedded DSL? I am open to write an DSL if
facilitates the job, the thing with the Trevor's paper is that he defines 6
implementations of FSM's (and in each implementation he considers several
issues leading to sub-implementations) so I would like a DSL which let me
express different implementations for the same FSM. Plus there are FSM
implementations out there: HotDraw, Connectors, MIDIInputParser, XMIReader,
SState, etc. I think a "correct" DSL would enable to define any of them
The approach I am using now is a parametrized code generator, using
templates (not in the form of T4 templates), so it's a long way.
Maybe Helvetia could help?
> On Tue, Oct 18, 2016 at 9:29 AM, Julien Delplanque <jul...@tamere.eu>
> > Hello,
> > A generator for the visitor design pattern:
> > - Generate methods in visited objects: VisitedObject>>#accept: (with the
> > selector name configurable)
> > - Generate empty methods (or methods with a "self
> subclassResponsability" if
> > an abstract visitor is generated)
> > called in #accept: methods of VisitedObjects in the Visitor i.e
> > Visitor>>#acceptVisitedObject: (with the selector
> > name configurable again).
> > Each time this design pattern has to be used, it is annoying to write by
> > hand all these methods.
> > Regards,
> > Julien
> > On 18/10/16 07:24, Hernán Morales Durand wrote:
> >> Hi guys,
> >> I am writing a code generator, doing a few iterations right now.
> >> I want your opinion, which most useful thing would you like to be
> >> generated
> >> automatically? It could be a pattern, an idiom, another language...
> >> For example my own wish (roadmap) list:
> >> - A "settings framework" settings class generator.
> >> - A state machine generator (based in the excellent paper of Trevor P.
> >> Hopkins)
> >> - A Spec UI generator.
> >> Let me know your thoughts.
> >> Cheers,
> >> Hernán