Hi Lukas, Topic #1: Static vs. contextual Factory methods > =============================================== >
> Things used to be the way you proposed in jOOQ 2.x. I.e. static and > contextual methods were mixed in a single Factory. The problem this > cause was an essential problem for a fluent API. Because in Java, > static and instance methods occupy the same namespace, Query factory > methods were restricted to being contextual. I was wondering if the same method could be both contextual and static, but I am not sure whether there are so many cases that justify it. Since it used to be that way (2.x) you have more practical experience so I can't really argue. So, there is a relevant use-case for duplicating the API for query > construction into a static and a contextual part. I wonder then: could the query creation be fully static (like a capture of the user's declarations) and only its rendering/execution be contextual? Or are there cases where to represent the query you need context? And in that latter case, can't this just be postponed to execution/rendering time? Because maybe you should just have everything in the (current) Factory and create the Executor (whatever the name is) without fluent call, only a QueryPart parameter and 2 methods: Executor executor = new Executor(<context_params>, QueryPart); executor.getSQL() or executor.execute() > Topic #2: "Executor" as a name > ============================== An alternative solution to this problem would be to add a > static "with" keyword to the Factory, with which an "Executor" could > be created (let's keep calling it Executor and rename it later). If my suggestion above has counter arguments, then this could be a possible fallback. But I would prefer to have some feedback on my suggestion before elaborating on that one :) > Topic #3: Factory and Executor as short names in general > ======================================================== > > Even then, you'll probably static-import > org.jooq.impl.Factory.*; > Yes, this is the rule that probably makes your argument more valid. My experience is that everytime I use a "List" and I ctrl+shift+o and Eclipse asks me whether I mean "java.util.List" or the deprecated/outdated/irrelevant "java.awt.List" instead of auto importing irritates me. > - Table (Swing, probably?) > Bad choice, all Swing components start with J, and most libraries that ship Swing components kepts that convention. JTable, JCheckBox, even JWebBrowser ;) Also try in your Eclipse workspace ctrl+T and then "javax.swing.*Factory": none are just "Factory". > We could discuss a rename from Factory to JOOQ or something like that, > of course. But I will need very compelling reasons to re-write the > whole manual and explain to everyone that the Factory has been > beautified :-) > Honestly, if the API only has such naming issues (whether we agree or not), then the goal of having a solid API is reached :) Cheers, -Christopher -- 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.
