Emmanuel Bourg <[EMAIL PROTECTED]> writes:

>Henning P. Schmiedehausen wrote:

>> Nah! We went this road in torque with the id generators and along lies
>> madness! Please don't try to "sweeten" the locator names by
>> introducing human readable names into the XML syntax.

>What's wrong with that ? From a user point of view it's easier to have 
>short names than fully qualified class names. Hibernate uses this 
>approach in its mapping file, I find this quite nice. Of course it's 
>still possible to use the class name instead.

You lock yourself into a very small number of possible field
values. And you confuse your users (IMHO) by allowing two types of
parameters (readable names and class names) in a single attribute.

If you look at the Torque OM templates where the type of ID generator
is determined ("native", "sequence", "idbroker" and so on), you will
see, that you end up with a huge mess.

Where does Hibernate allow short-cuts / human readable names? The only
place that I can remember is the fact that you can omit the packages
for the class <-> table mappings if you supply a default package with
the mapping itself. That would be no problem (then there would just be
a typo in your example because you've written "classpath" instead of
"ClassPathLocator" (the o.a.c.c.locator could be the default package).

>> I'd very much prefer
>> 
>> <properties 
>> locatorClass="org.apache.commons.configuration.locator.ClassPathLocator">
>>   <param name="fileName" value="config.properties" />
>> </properties>
>> 
>> over that. Using attributes locks us into a defined set of fields by the 
>> DTD. 

>Err... but we don't have any DTD for the configuration descriptor ;)

We might get one some day. :-)

Hibernate got that right, BTW:

<ResourceParams name="jdbc/quickstart">
  <parameter>
      <name>factory</name>
      <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
  </parameter>

  <!-- DBCP database connection settings -->
  <parameter>
      <name>url</name>
      <value>jdbc:postgresql://localhost/quickstart</value>
  </parameter>
</ResourceParams>

instead of

<ResourceParams name="jdbc/quickstart" 
factory="org.apache.commons.dbcp.BasicDataSourceFactory" 
url="jdbc:postgresql://localhost/quickstart" />

        Regards
                Henning


-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
[EMAIL PROTECTED]        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

What is more important to you...
   [ ] Product Security
or [ ] Quality of Sales and Marketing Support
              -- actual question from a Microsoft customer survey

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to