4 ms·
Back in my Java days a long time ago, I too preferred just writing prepared statements and then copying the data to my POJOs. Until I thought about it and decid
by stuff4ben 3y ago
Back in my Java days a long time ago, I too preferred just writing prepared statements and then copying the data to my POJOs. Until I thought about it and decided to use reflection to do the heavy lifting after modifying the code every sprint to deal with new requirements. Then I added the ability for my POJOs to be annotated so I could define the table and columns it belonged to. It didn't hit me until near the end that I had reinvented Hibernate without all of the rest of its features.
- deleted 3y ago[deleted]
- xienze 3y ago> It didn't hit me until near the end that I had reinvented Hibernate without all of the rest of its features. This is pretty much the life cycle of the “ORMs suck” crowd. The hangups are similar to “XML sucks” — conflating a poor ORM framework or XML-based format with the concept of ORMs or XML in general. ORMs are a very useful abstraction, and even if you think you aren’t using an ORM, you probably are — just a bespoke one.
- stuff4ben 3y agoI wasn't in the "ORMs suck" mindset, but rather I just didn't want to take the time to integrate it since it was "just a small little project for a few people". But as word got around, more people got interested in it and wanted their own fields and data added. It was a case where premature optimizing would have been a good idea.