Tag: activerecord

ActiveRecord Rocks But I Can’t Say the Same About Rails Views

Posted by – September 15, 2008

ActiveRecord has proven to be a easy to learn and productive ORM solution, you can define your application model with few lines of code, the syntax is much more concise than any other ORM solution.

But, in other hand, rails doesn’t have a elegant way to work with views, with a lot of loops and conditional expressions in the middle of code, this kind of approach remembers me the PHP coding 8 years ago, where after several lines your code become very hard to understand an maintain.
More

Share

Creating JSF applications with JRuby and ActiveRecord-JDBC (Part 2)

Posted by – March 16, 2008

My last article about this topic showed how can we start the development of an JSF webapp with JRuby and ActiveRecord-JDBC, we will discuss on this article how can we create the dao, domain class and the view used to show costumer data.

In this example, CostumerDao illustrate how can we perform some data persistence/retrieval using ActiveRecord domain classes, we defined MyCostumer JRuby class to act as a proxy of our domain class:
More

Share

Creating JSF applications with JRuby and ActiveRecord-JDBC (Part 1)

Posted by – March 16, 2008

Is there any way to create JSF applications using scripting languages and its own persistence engines? The answer is: Yes! After some hours trying to integrate JSF + JRuby + ActiveRecord I finally could get a very simple application working, this application contains only one page where the user can add some costumer data, we have jsp as view, spring as IoC container and integration point with JRuby, ActiveRecord-JDBC as ORM.

The page has a managedbean defined as Ruby class, each Ruby bean must implement a Java interface to allow integration with Java/Spring, when the bean is requested by Spring a Java proxy class is instantiated based on its Java interface and then all Ruby code can be consumed properly.

If you wanna try by yourself you must create a webapplication and add the jars described on my previous post (except groovy-1.5.4.jar) plus these jars below on WEB/lib folder:
More

Share