Hi Darren, I agree that there might be some confusion around these names, which belong to new objects added over time. This is certainly worth re-considering in the context of jOOQ 4.0. I have created an issue for this: https://github.com/jOOQ/jOOQ/issues/2996
Regarding your suggestions, I'm not sure if it is wise to have two separate with/without interfaces strategies, from a maintenance, documentation, and compatibility perspective. But then again, the interfaces currently do not add that much value as they aren't widely used by generated output - e.g. they're not used by DAOs. Clearly, there isn't any one-size-fits-all solution here. Another "acceptable" default (not my actual preference) would be to use prefixes for all object types: Table -> TAccount Pojo -> PAccount Record -> RAccount Interface -> IAccount Dao -> DAccount Another one would be to postfix *all* objects consistently Table -> AccountTable Pojo -> AccountPojo Record -> AccountRecord Interface -> AccountInterface Dao -> AccountDao Hard to say, what would be the most sensible default here... 2014-01-29 Darren S <[email protected]>: > 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. > -- 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.
