Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The best ORM (outside of ActiveRecord) I've seen was a proprietary hand-rolled one that solved the impedance mismatch.

It had a canonical XML format that entities were defined in and code generation for data access layers, domain models, view models etc.

It actually worked better than I've seen the abuse I've seen developers put EF through. I found it nicer and simpler than times I've worked with Hibernate.

I'm not going to say it was perfect, but every time I think back on it it makes me want to revisit the idea of leveraging a bit of code generation or metaprogramming to be able to have a canonical definition of an entity transformed into concerns that deal with the given entity at different points in the application.

That part of it just really hit the sweet spot for me.



Have you checked out MyBatis or JOOQ? They sound pretty much like what you're describing.


MyBatis has _some_ similarities, notably the defining entities in xml part. But it diverges after that.

Think about it more like MyBatis meets Spring Data JPA. Define that entity in XML the run a code gen which gives you the CrudRepository class but also generates a controller that exposes an API with pretty good good ability to specify adhoc queries. Plus view models.

I think it worked because it both reasonably well designed and hyper opinionated.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: