Edit and Continue

Home
Introduction
Tips and Techniques
Projects
Libraries
Links

With Functional Developer 2.0 it is possible to do what is commonly called 'Edit and Continue' of a program that you are debugging.

This means you can pause a running program in the debugger, edit method definitions, frames, or any part of the program, and dynamically recompile those changes into the running program. You can then continue the program from where it was paused and it will use the new definitions.

This is useful for interactive development of programs. You don't have a lengthy compile and link process - just a quick compilation of the changed features - and you can continue without having to re-enter any state to get back to where you were.

You can use this feature of Functional Developer when running a program in the debugger by editing the source of the program, selecting the part of the program you edited and choosing Project, Compile Selection from the menu. A very fast compile will occur of just the portion changed and the program will continue running.

Some things to be careful of:

  1. Don't edit and recompile a method that you are currently stepping through in the debugger. Functional Developer appears to get confused in this instance.
  2. Editing a DUIM frame or pane does not affect instances of that frame or pane that are already created. So adding panes to a frame won't cause them to magically appear unless you create a new frame.
  3. Make sure you are doing this with projects compiled as 'Interactive' (otherwise know as 'Loose') compilation mode.

I use this a lot when exploring GUI designs. Because of point 2 above you need to do something special for the main frame of the application. I create a project that starts up a frame with a single button in it. Pressing the button creates the main frame of the application.

When I redefine aspects of the main frame, I close that frame down, and press the button in the initial frame to re-create it. In this way I don't have to keep stopping and recompiling/relinking when changing the main frame.

Often when developing an application I find I spend most of my time developing it inside of a running application and using this dynamic compilation feature.


Copyright © 2000, Chris Double. All Rights Reserved.
All products and brand names are the registered trademarks or trademarks of their respective owners.