Title: Automatic Source Code Generation in JPie
1Automatic Source Code Generation in JPie
public BMI() super()
propChangeSupportnew PropertyChangeSupport(this)
// methods public int getHeight()
return height public void
setHeight(int h) int oldValue
this.height height h
propChangeSupport.firePropertyChangeInteger(h))
2-
- What is JPie?
- JPie is a new kind of graphical programming
environment. - Why use JPie?
- Direct Learn software concepts
- Easy Eliminate syntax errors
- Live Edit programs while they run
- Practical Create actual Java programs
3Problem JPie teaches concepts, but not syntax
Time spent learning
Solution Generate source code
4import javax.swing. import java.beans. public
class Timer extends Object // fields
private PropertyChangeSupport propChangeSupport
null private volatile int timeLeft (int)
100.0 // constructors public Timer()
super() propChangeSupportnew
PropertyChangeSupport(this) // methods
public int getTimeLeft() return
timeLeft public void decrement()
setTimeLeft((int) (getTimeLeft()-1.0))
5- Goals
- Readability generated source code should
exhibit good programming practices and style - Correctness a program created from generated
source code should behave identically to its JPie
counterpart
6How to Generate Code
Use JPies internal model to recursively build
source code
DynamicClass
public void update() setBmi((((weight/(Math
.pow(height,2.0)))703.0))) chooseColor()
DynamicField
DynamicMethod
7- Progress
- JPie can automatically generate source code for
most features - Many programs created in JPie can run outside
JPie via generated source code - Current Work
- Completing source code generation for advanced
features and special cases. -
- Implementing mixed-mode editing editable source
code
8Questions? Email me bb7_at_cec.wustl.edu Email
Professor Ken Goldman kjg_at_cse.wustl.edu JPie
web site jpie.cse.wustl.edu