Link Details

Link 12197 thumbnail
User 107114 avatar

By daniel
via ruby-vs-java.blogspot.com
Published: Jan 28 2007 / 19:11

I did a lot of work on our data model the past two weeks, a little with Ruby, a little with Java, and back again. I thought I should share some insights regarding the different approaches they take towards modeling your data, and their pros and cons.
  • 18
  • 0
  • 2859
  • 1189

Comments

Add your comment
User 190346 avatar

ilazarte replied ago:

-1 votes Vote down Vote up Reply

Pretty uninformative. I don't remember where it's said to think objects first. Maybe domain model? In the real world you can design data model to your hearts content, and then have the Hibernate plugin autogenerate your mapping files, classes, and even the wrapping daos.

next.

User 107114 avatar

daniel replied ago:

0 votes Vote down Vote up Reply

Oh, I don't know. I'm working on a "real world" project right now where we had to design the entire model object layer to match the database schema, not the other way around. In fact, it really wasn't even an option to simply "generate" the schema from a set of hibernate objects.

Now, to Hibernate's credit, it probably could have been adapted to work with our schema (albiet poorly) whereas ActiveRecord would have been completely out of its league.

User 181930 avatar

jwenting replied ago:

0 votes Vote down Vote up Reply

Yup, that's the real world.
In the real world the database almost always already exists and the application is being built on top of it (or else the database is filled by a process that's written in say C and designed for easy inserts and the Java application reading from it has to make do).

Systems like hibernate can still work, but you're not going to get any generation of your DDL from it.

User 204018 avatar

jongretar replied ago:

0 votes Vote down Vote up Reply

Actually... People in the "real world" seem often to misundarstand "convention over configuration". I have used ActiveRecord to all sorts of "real world" projects like you call them without a problem. AR is HIGHLY configurable but it just has a lot of default settings. You can still use it like every other DBI layer. If you are using other schemas than the default ones just use AR like other db layers and use the table_name, primary_key and all those settings. I have yet to find a situation where I can't use AR.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.