News for hackers. Stuff that matters.
Re:OO is not Computing, Newer is not More modern by UK-AL on Monday April 30, 2012 @09:31AM (#3909138)
What? You don't keep the objects permanently in memory. You call up the faculty object via ORM, perform your action such deleting a student. Then get rid of the facaulity object(Going out scope in the method). Next to you call up the faculty object via orm everything's updated.

"Then I want to be able to filter students according to different conditions. And I end up writing nested loops for every possible condition and join I need. I refactor. I generalize. After a few months or years I've implemented nonstandard relational database."

Only a moron would write loops to search using an ORM. You implement a generic search method on the object, which executes the relevant SQL statement(Via HQL or LINQ) and returns the result. ORMS do this stuff automatically, no need to write loops to search...

I mean how badly have you been abusing ORMS?

You've been using ORMS wrong. ORMS provide the whole range relational features. They just map the results of the SQL statement into objects.

Relational Databases are good keeping data integrity correct, not so good at modelling computations. So you use the best tool for the job, relational database for storing data. Then extract that data from the database, and then use whatever (functional, OO, logic languages) to perform operations on that data.

Relational is not a way to perform computations on data, other than searching and using the various relational search features. Try implementing a machine learning algo on data using solely SQL...

Re:OO is not Computing, Newer is not More modern by ajuc on Monday April 30, 2012 @09:48AM (#3909205)
Maybe I wasn't clear. I do know how I'm supposed to use ORM. I work with hibernate and EJB3 for a few years already, and no, our system doesn't work the way I've described above :)

I described how I've been taught OO. First without using databases, and with wrong abstractions (nouns instead of relations, when the system was all about relations). I think it's the default experience, because I've seen many such examples of bad OO design.

Then we've been taught databases, but using ORMs, like it was the only possible way, because objects are required for the system to be modern. And I don't like that too, because IMHO (OO + ORM + relational DB) doesn't add any value over (procedural programming with relational DB), but adds complexity, and is less transparent.

Re:OO is not Computing, Newer is not More modern by UK-AL on Monday April 30, 2012 @10:02AM (#3909267)
It's a personal choice, I think OO makes modelling large systems easier. At that point you can use an ORM.

If you prefer procedural code, then obviously ORMs are no use to you...

I mean love various programming paradigms, I like Haskell, but it can make things difficult. For example programming a basic game in haskell, is far from simple. You normally have to introduce reactive programming to make it sane.

I find OO makes large systems easier.

In my opinion the amount of boilerplate required for JDBC makes ORM a must in java...