The hype is big for Ruby On Rails and I was trying to think what ideas we can bring from RoR to Mentawai.

ActiveRecord seems to be the most commented RoR feature, but after some thinking I came to the following conclusion:

"Why use ActiveRecord when we have Hibernate ???"

The answer may be:

"When we have small and simple projects, Hibernate looks like a bazooka to kill an ant!"

I agree. But for simple and small projects, we can stick with DAO and DBPersistent for simple CRUD (Create/Update/Delete) operations.

Before I gave up and start using Hibernate, I had been using the DBPersistent approach. Check below:

[code]
 public class DBInviteImpl extends DBPersistent implements Invite {
 
         private IntField id = new AutoIncrementField(this, "id", true); // true = PK
  private StringField email = new StringField(this, "email");
  private DateTimeField senddate = new DateTimeField(this, "senddate");
 
  public static Invite getInstance() {
  return new DBInviteImpl();
  }
 
  protected DBInviteImpl() { }
 
         // isso aqui pode virar injection...
  public ConnectionHandler getConnectionHandler() {
  return DefaultConnectionHandler.getInstance();
  }
 
  public String getTableName() { return "invites"; }
 
  public void setId(int id) { this.id.setValue(id); }
  public int getId() { return id.getValue(); }
 
  public void setEmail(String email) { this.email.setValue(email); }
  public String getEmail() { return email.getValue(); }
     
  public void setSendDate(Date senddate) { this.senddate.setValue(senddate); }
  public Date getSendDate() { return senddate.getValue(); }
     
 }
[/code]

[code]

Invite inv = DBInviteImpl.getInstance();
inv.setEmail("adfasf at adsfaf dot com");
inv.update();

// etc...
[/code]

For simple CRUD, this is very easy and, besides the setter and getters, it looks like ActiveRecord.

Therefore I am still not sure whether we should add any support for ORM in mentawai. Hibernate, hand-made frameworks like DBPersistent or DAO should be the way to go.

Agree or Disagree ???