A simplified definition of an ORM



This content originally appeared on DEV Community and was authored by Guillaume Mary

“Back to school” is here… (at least in France), but have you ever tried to fit a whole school into an Excel file? 🤔😄

While the question seems strange, this is exactly what an ORM (Object-Relational Mapping) aims to do.

Imagine you’re a principal and you have to enter all the students, their parents, teachers, subjects, classes, etc., and most importantly, all the relationships that link them, into your spreadsheet. It’s quite a puzzle!

If we were to create an application to help our principal, the ORM would be there to help us distribute these concepts (student, parent, teachers…) into the sheets of the Excel file (more specifically, into the tables of the database). It would then allow us to access them to find out if H.Potter has a Math class on Tuesday from 2 p.m. to 3 p.m., or to retrieve professor McGonagall’s students…

The ORM is therefore there to store the elements (student, parent, etc.) and especially their relations, while allowing them to be easily retrieved. It’s an essential building block in applications that saves developers a lot of time… but it remains tricky to master. The puzzle it saves you from often comes at the cost of behaviors that are not very optimal for your application’s specific case, as an ORM must be generic, capable of handling any domain: cooking recipes and their ingredients, cars and customers of a dealership, medical records of hospital patients, etc.

And clearly, this genericity is not easy to develop since the ORM’s algorithms must allow it to be applicable everywhere, with the least amount of effort possible for developers.

This is why you’re not hearing about Stalactite right now! 😛 It’s going through a difficult phase to account for all possible scenarios… so it’s long and complicated! The next version will bring compatibility with Spring-Data, putting it on par with JPA / Hibernate for ease of integration.

So if you want to give me a little encouragement and support me in this endeavor, don’t hesitate to “star” the GitHub repo. It’s an important indicator of its popularity and my morale! 😄

Strength and honor to all volunteer maintainers of open-source projects! 💪👍


This content originally appeared on DEV Community and was authored by Guillaume Mary