Hi Lukas

Thanks a lot for your answer :)

My use case is explained there 
https://groups.google.com/forum/#!topic/jooq-user/I9iLbMQNN8o => I want to 
have the current domain classes extend the latest version. 

Regarding your worry about internal API leak, well, this is right but 
anyway already the case (for anything not private - and thus at least 
package private). However, to link with your discussion on the next model 
generation approach, maybe the new one could favor composition by extending 
some interface and then, internally, just have a private instance of the 
actual impl and delegate to it. It would be pretty easy to do I guess and 
feels like rather clean as far as I see it.

Back to the initial issue, I don't believe making the class final on top of 
having a private constructor would be any better: I already had to change 
the generated class (to open the constructor) and nothing could stop me 
from doing so with a final class. So personally I would not try to "close" 
too much stuff which can easily be opened up if needed.

On the bigger picture, is there any technical issue with extending the 
FlywayTest class ? It doesn't feel like it (no AOP, proxy or whatnot 
around, no funky cache or internals as far as I see it). If it's the case, 
a short explanation in the generated class would be nice

:)

thanks again for your answer

best

On Monday, January 4, 2016 at 10:00:04 AM UTC+1, Lukas Eder wrote:
>
> Hi Joseph,
>
> jOOQ is generally rather restrictive in what it allows users to override 
> via inheritance, which is never a good idea - specifically in the context 
> of these generated classes, which inevitably leak some internal API from 
> the types they extend. So, in general: It's not a good idea to further 
> extend these classes. Perhaps, we should generate them as "final"...
>
> Anyway, what's your use-case? And why would subtyping help you solve it? 
> I'm sure there's another way!
>
> Cheers,
> Lukas
>
> 2016-01-03 23:26 GMT+01:00 <[email protected] <javascript:>>:
>
>> Hi
>>
>> I'm new to Jooq and while trying it I saw this in the flyway example :
>> public class FlywayTest extends SchemaImpl {
>> (...)
>>
>>     /**
>>      * No further instances allowed
>>      */
>>     protected FlywayTest() {
>>         super("FLYWAY_TEST");
>>     }
>> (...)
>> }
>>
>> Why is that?
>>
>> I'm wishing to subclass this FlywayTest, is this a no go ?
>>
>> Thanks in advance and for Jooq :)
>>
>> best
>> joseph
>>
>> -- 
>> 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] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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