>>> Let me ask maybe a better question - how would you do the following >>> programmatically? >> >> I would crete a rewriter for each case, instantiate a RBNamespace, iterate >> over all methods within, and apply the rewriters if necessary, then review >> the changeset, and apply it. > > This is one of the best things which i seen in OB. But even by > watching your screencasts i found it hard to use. > I remember i tried to rewrite some code using it but then i failed and > lost in space (too much windows open, no clear visibility in what > context they might work and > why it fails for me, but works for you etc etc), so i abandoned > attempts to master refactoring-fu using OB.
It is complicated to expose the complete refactoring engine API through an UI and in many cases it is not even easily usable, in fact the original Refactoring Browser only supported a much smaller sub-set. Now what I think is quite simple is: (1) open a scoped browser, (2) trigger a refactoring, and (3) edit the proposed change-list. That fact that the change-list is editable might not be obvious, but in fact any proposed change can be removed (ctrl+x) and outside diff mode you can even edit proposed change. Furthermore there is full multi-level undo-redo support in OB with the refactoring engine loaded, *any* refactoring (as well as any class/method deletion/redefinition/addition in OB) can be undone. > And of course, since most of the times i hunting bugs in core image(s) > of past , OB was not there and these features was not available to me, > as developer > (that's again, another reason to have single image for everyone). It is really easy to load refactoring engine into a core image, perform the refactoring, commit the changes, and load the refactored code into a core image again. This is especially true if Hudson always provides up-to-date images. > I would really like to have it in our _default_ images to empower > developers. I think it is a very bad idea to integrate the refactoring engine into the system, but I guess we don't have to discuss that again. > because you know, for you , as an author (and/or maintainer) of it > things look pretty straightforward, but for people who only get > started they apparently not. No, the refactoring engine is not an easy piece of software. It took me many years to fully understand it before I could start to fix and improve it. Lukas -- Lukas Renggli www.lukas-renggli.ch
