cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: SQLTransformer
Date Mon, 05 Sep 2005 07:49:59 GMT
Antonio Gallardo wrote:
> I will suggest OJB instead - http://db.apache.org/ojb/.
On the contrary I strongly recommend Hibernate :)

> I was working on a hibernate the last weeks and I need to say that I 
> prefer OJB. Here 2 samples:
> 
> 1-When using a java List for a collection inside a bean, in Hibernate 
> the table need an additional field to manage the order of the table 
> rows! What is that?
That is the persistent order of your collection. A list needs to know 
what is the sequence of it's child beans. How do you do it in OJB?

> 2-I don't want in my database more fields than what I need, so let 
> replace the Java List witth a Java Set --> then I meet a new problem: 
> cforms binding use jxpath and jxpath don't work with Sets. jxpath throws 
> an Unsupported Operation Exception! Boom!
strange:

<fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
             xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
             xmlns:ci="http://apache.org/cocoon/include/1.0"
             path="/" >
     <fb:repeater id="questionDefinitions" parent-path="." 
row-path="questionDefinitions" direction="load">
         <fb:identity>
             <fb:value id="id" path="id"/>
         </fb:identity>
         <fb:on-bind>
             <fb:value id="questionName" path="name"/>
             <fb:value id="questionCategory" path="category/name"/>
         </fb:on-bind>
     </fb:repeater>
</fb:context>

In this case I have bound SurveyDefinition.questionDefinitions 
collection and it works.

> I wonder how people using hibernate deal with this situations. The 1st 
> shows me a poor database desing and the second a restriction to use 
> cforms at all! 
I still do not get why this is a poor database design. In hibernate you 
can use:

1. unordered set
2. a treeset ordered with Comparable contract
3. a List which has a persistent order of your choice.

Only the third choice for obvious reasons needs an indexing column.

> I have been developing applications with Cocoon and OJB for 2 years now. 
> IMO O/R mapping offer far more features than SQLTransformer and . I hear 
> people telling there is too much work to create and O/R mapping. IMO 
> this is FUD. In fact a O/R mapping need less work or at least the same 
> amount of work or less in more complex applications. here I explained 
> how easy is to work with this an OR mapping:
> 
> http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107569798213119
I am using 100% hibernate for my solutions. There is one small but for 
others who whould like to use any O/R mapping tool - they have to know 
java well.

For simple cases SQLTransformer or ESQL are very good tools. Users do 
not have to know java at all yet they can manage to create a dynamic site.

This is the same case with Ruby on Rails. It is advertised as super easy 
  and fast web framework. Is it an appropriate tool to create a system 
with 100+ entities? I would be scared to try. Still for small sites it's 
a blast.

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Mime
View raw message