On Mon, Dec 09, 2002 at 01:50:59PM -0600, Nick Sieger wrote: [ snip ]
> That's a valid point. When I examined the three sourceforge-based > java refactoring tools available (JRefactory, Transmogrify and > Freefactor) I liked the way Transmogrify was designed the best (but > maybe I didn't look closely enough at Freefactor yet). I've done a > fair amount of work w/ parser generator tools in the past and thought > it could be easily extended. > > But, if Freefactor is being more actively maintained, then it's > possible that my efforts would be better focused there. I'll keep > that in consideration. I wouldn't say it's being actively maintained, but I'm willing to give any info about it you need and maybe spend some time improving it. As for the JDEE <-> Java interfacing issue, it's quite a difficult one. The approach I took was drawn from the Transmogrify way of doing it - all the logic was on the Java side and there was an interface to get basic information (cursor position, selection) from Emacs. This is probably the simplest approach, but it's not the best since JDEE will have no input into the control flow at all. It basically sends it a file and receives back a new one. I suppose a nicer approach would be to have all the logic in Lisp. One could go as far as having a Java component which walked the AST producing Lisp. This AST could then be refactored and sent back to the Java code to be printed. In freefactor I represented refactorings in terms of individual 'changes', which would then be applied to the AST. The eventual idea was to be able to write refactorings in XML which specified how the changes were composed together. The other advantage of this approach is that it allows undo to be implemented easily. I'm wondering if this idea would work well using Lisp. The Java code could then be a lot dumber, only knowing changes and how to apply them. The Lisp part would actually know how to build particular refactorings from individual changes. It would also be in charge of the control flow (apply this change, then this change, undo the last change). Those are my thoughts on the subject anyway, -- Graham Bennett
