<Exposed moving forward> Exposed started out a few...
# feed
r
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
Is it too early to ask how the boilerplate reduction would work? Do you have an idea and some examples to illustrate?
a
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
⤴️ 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
These are things we’re currently discussing. @e5l may want to share more at this point.
❤️ 2
e
We’re looking into making a compiler plugin now. I’ll share a prototype when it’s ready for feedback 🙂
❤️ 1
K 1
e
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
For sure! If you have any ideas what should be included, feel free to share
e
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.