Hi Ben, Thanks for sharing your thoughts!
2017-03-21 21:11 GMT+01:00 <[email protected]>: > I never found the DAOs and Pojos useful and disabled code generating them. > In the past, I was also concerned that they'd promote an ORM world view, > leading to requests for JPA, rather than embracing SQL. > Well... no, we won't :) I prefer to use DSLContext directly and never heard a complaint (only > praise) from coworkers when they used jOOQ. I sometimes use the record > types, but only for internal logic. Instead I use jsonSchema2Pojo (or in > the past, protobuf) to generate my service types. > Oh, interesting, I wasn't aware of this website / library. One would wish we had a more formal JSON binding API like JAXB with XJC, though... :) Then again, one would wish for a more formal JSON schema specification like XSD. But oh well. That discussion is something entirely else... The fetchInto() mapping is usually enough and when not the custom mapping > is pleasant enough. I've often written custom repositories to extract the > query logic from the services to simplify the code. But when the class is > well factored, like a background job, I'm more inclined to embed the query > rather than bloat a repository with one-off usages. > > I can understand why some would want to use the Pojo codegen and return > the results directly. To me that couples the service schema to the data > schema, which may only match one-to-one early on. By having a service > schema its easier to refactor and be less likely to break the external > contract by mistake. The amount of work to write a schema, e.g. json > schema, is trivial and it is nice to know exactly what the payload looks > like and, optionally, run it through a validator. > > These days I use a hybrid nosql / sql data model in Postgres, resulting in > a high usage of json schema for generation the UI and dynamically > configuring a backend processing pipeline. If I had started with DOAs then > I'd have needed to move away regardless. > I think that last sentence wraps it up very nicely. Unlike a lot of other jOOQ features, this one is an "early prototype" one. Perhaps that's OK if some third-party library did it (e.g. a hypothetical github.com/use-jooq-for-trivial-apps), but not for the core library. Thank you very much for your confirmation! Lukas -- 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.
