Exposed moving forward
Exposed started out a few years back at JetBrains, as a lightweight ORM/DAO written in Kotlin. It has since been used internally on a number of critical products at JetBrains, and despite being classified as a Team project on GitHub, it has garnered a large number of external users. While the main person on the […]
The post Exposed moving forward first appeared on <a rel="nofollow"...
👍 1
K 12
🎉 6
e
Endre Deak
08/04/2023, 1:36 PM
Is it too early to ask how the boilerplate reduction would work? Do you have an idea and some examples to illustrate?
a
Andrew O'Hara
08/04/2023, 2:59 PM
For boilerplate reduction, my wishlist would be:
• reduce duplication required to map tables to entity classes
• provide mapping for entities or rows to plain data classes; in many testable architectures, the service layer should have zero awareness of transactions
I have no idea how feasible any of this would be without a major rewrite; but at what point would Exposed no longer be Exposed? 🤷
e
edrd
08/07/2023, 3:08 PM
⤴️ One way to do that is by generating code with tools such as KSP. It doesn’t add runtime overhead and allows developers to see what’s going on by looking at the generated code, so there is no magic.
cc @hhariri
h
hhariri
08/07/2023, 3:17 PM
These are things we’re currently discussing. @e5l may want to share more at this point.
❤️ 2
e
e5l
08/07/2023, 3:18 PM
We’re looking into making a compiler plugin now. I’ll share a prototype when it’s ready for feedback 🙂
❤️ 1
K 1
e
Endre Deak
08/07/2023, 8:32 PM
Are you guys considering making it customizable? Would be awesome if we could just easily hook into the process and do some magic there!
e
e5l
08/09/2023, 8:43 AM
For sure! If you have any ideas what should be included, feel free to share
e
Endre Deak
08/09/2023, 3:01 PM
Well, I'm not sure about the real implementation, but I'd assume generating code would require multiple different internal representations of the same model, such as:
Copy code
parsed SQL AST --> transformed into some other AST --> transformed into some other AST --> render Kotlin code (or maybe Java if that's the plan)
Ideally, at each transformation step there is a lifecycle hook that could be override / implemented by users.