abstract sclass DynCalculatedList extends DynModule { transient JList list; JComponent visualize() { ret list = jlist(calc()); } void unvisualize() { list = null; } void update() { lock lock; if (list != null) fillListWithStrings(list, calc()); } // Note: You should cache results in the calc function // if they are expensive to make abstract L calc(); }