Sorry if this is already solved elsewhere, but I haven't been able to find 
this here or on StackOverflow.

First off, great framework! So happy to find it.

I'm building a small swing GUI, and have found myself writing a lot of stub 
classes that extend Observable for the BlahRecord classes generated by jOOQ 
so I could do MVC "properly".

Things like

public class MyClass extends Observable
{
    private MyClassRecord wasGeneratedByJOOQ;

    public void setSomeField(String newValue)
    {
       if (!newValue.equals(wasGeneratedByJOOQ.getSomeField()))
       {
           setChanged();
           wasGeneratedByJOOQ.setSomeField(newValue);
           notifyObservers(newValue);
       }
    }

    ...etc for each field
}

There seem to be three ways to go about this, but I was wondering if 
someone had already just solved the whole binding issue for swing anyway.

For what it's worth, the three ways I think this could be solved would be


   1. Find the right place in the Record<> class hierarchy to make 
   something extend Observable and change the definition of "setField()" in 
   updatable record (this seems a poor choice, because it's classes all the 
   way up to AbstractStore, which really has no business being Observable)
   2. Generate something like at PoJo at the class generation time, but 
   that just wraps a record-derived class for its implementation, as per the 
   above code (this seems like a reasonable choice, but might be missing 
   something very obvious)
   3. Find out what someone who's already solved this problem would do :)


Any advice would be most appreciated. Even if the advice is "step back, 
there's better ways to solve this MVC thing with JOOQ"

Many thanks,
Joe

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to