When I first started using jOOQ I didn't know what approach I was going to 
take, pojo's, records, interfaces, etc.  So I just turned on all the 
options while I was fooling around with jOOQ.  This got particularly 
confusing.  Assume your table is "Account," the following classes are 
generated

Table -> Account
Interface -> IAccount
Pojo -> Account
Record -> AccountRecord

Although its not a steep learning curve, there is a bit of learning curve 
grasping the difference between the table, record, and pojo objects and 
when to use each.  So when you do something like fetchInto( and then auto 
complete, do I select Account, Account, or AccountRecord, They will all 
work.  Additionally the packages are very similar, so table is 
tables.Account, but pojo is tables.pojo.Account, so its really simple on 
first glance to pick the wrong one.

So this sounds silly, but I found it much easier to just rename the table 
class to AccountTable using the ModelStrategy.  Now when I auto-complete I 
get Account, AccountTable, or AccountRecord and it seems more obvious.  
Additionally when I read my code and I see Account.class, I know without 
looking at the imports that that is a pojo and not a table.

So I'm not saying anything needs to change here, I'm just sharing my 
experience that I found the default naming strategy to be somewhat 
confusing.  I think any ideal naming strategy would be

Without Interfaces
Table -> AccountTable
Pojo -> Account
Record -> AccountRecord

With interfaces
Table -> AccountTable
Pojo -> AccountImpl
Interface -> Account
Record -> AccountRecord

The "With Interfaces" strategy is what I actually use, but I don't generate 
pojos as I didn't find them particularly useful for my use case.

Darren

-- 
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/groups/opt_out.

Reply via email to