You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Thomas Dudziak <to...@first.gmd.de> on 2004/05/28 12:52:53 UTC

Prefixes for OJB's properties ?

I was wondering whether OJB's properties should be prefixed
? E.g. currently we have properties like:

    LockManagerClass=org.apache.ojb.odmg.locking.LockManagerDefaultImpl
    ...
    ImplicitLocking=true

which could (should ?) be written as:

org.apache.ojb.odmg.locking.LockManager.class=org.apache.ojb.odmg.locking.LockManagerDefaultImpl
    ...
    org.apache.ojb.odmg.locking.LockManager.implicitLocking=true

This would IMO two benefits:

- OJB properties can easily coexist with properties for other
libraries/applications (thats the reason why Torque prefixed their
properties)

- Initialization would be easier to implement and more flexible as the
property name defines a path to a bean property (e.g. property
implicitLocking in the currently used lock manager implementation) and so
the Configuration parsing can be made generic and all default values can
be specified in the relevant classes

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: Prefixes for OJB's properties ?

Posted by Thomas Dudziak <to...@first.gmd.de>.
On Fri, 28 May 2004, Joerg Heinicke wrote:

> It might be not popular outside the world of Cocoon, but what about 
> doing this in an XML format? Instead of many long and unreadable lines like
> 
> > org.apache.ojb.odmg.locking.LockManager.class=org.apache.ojb.odmg.locking.LockManagerDefaultImpl
> > org.apache.ojb.odmg.locking.LockManager.implicitLocking=true
> 
> you can have
> 
> <LockManager>
>    <class>org.apache.ojb.odmg.locking.LockManagerDefaultImpl</class>
>    <implicitLocking>true</implicitLocking>
> </LockManager>
> 
> Through a namespace you can also prefix the elements.

XML might be a good idea, but mapping it this way requires to directly
code the supported properties in the configuration just like it is
now (or to have something more complex like letting components configure
themselves from the config DOM). I'd like to have something more generic
yet readable if possible.

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: Prefixes for OJB's properties ?

Posted by Joerg Heinicke <jo...@gmx.de>.
It might be not popular outside the world of Cocoon, but what about 
doing this in an XML format? Instead of many long and unreadable lines like

> org.apache.ojb.odmg.locking.LockManager.class=org.apache.ojb.odmg.locking.LockManagerDefaultImpl
> org.apache.ojb.odmg.locking.LockManager.implicitLocking=true

you can have

<LockManager>
   <class>org.apache.ojb.odmg.locking.LockManagerDefaultImpl</class>
   <implicitLocking>true</implicitLocking>
</LockManager>

Through a namespace you can also prefix the elements.

Joerg

On 28.05.2004 12:52, Thomas Dudziak wrote:

> I was wondering whether OJB's properties should be prefixed
> ? E.g. currently we have properties like:
> 
>     LockManagerClass=org.apache.ojb.odmg.locking.LockManagerDefaultImpl
>     ...
>     ImplicitLocking=true
> 
> which could (should ?) be written as:
> 
> org.apache.ojb.odmg.locking.LockManager.class=org.apache.ojb.odmg.locking.LockManagerDefaultImpl
>     ...
>     org.apache.ojb.odmg.locking.LockManager.implicitLocking=true
> 
> This would IMO two benefits:
> 
> - OJB properties can easily coexist with properties for other
> libraries/applications (thats the reason why Torque prefixed their
> properties)
> 
> - Initialization would be easier to implement and more flexible as the
> property name defines a path to a bean property (e.g. property
> implicitLocking in the currently used lock manager implementation) and so
> the Configuration parsing can be made generic and all default values can
> be specified in the relevant classes
> 
> Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: Prefixes for OJB's properties ?

Posted by Thomas Mahler <th...@web.de>.
makes a lot of sense too:
+1


Thomas Dudziak wrote:
> I was wondering whether OJB's properties should be prefixed
> ? E.g. currently we have properties like:
> 
>     LockManagerClass=org.apache.ojb.odmg.locking.LockManagerDefaultImpl
>     ...
>     ImplicitLocking=true
> 
> which could (should ?) be written as:
> 
> org.apache.ojb.odmg.locking.LockManager.class=org.apache.ojb.odmg.locking.LockManagerDefaultImpl
>     ...
>     org.apache.ojb.odmg.locking.LockManager.implicitLocking=true
> 
> This would IMO two benefits:
> 
> - OJB properties can easily coexist with properties for other
> libraries/applications (thats the reason why Torque prefixed their
> properties)
> 
> - Initialization would be easier to implement and more flexible as the
> property name defines a path to a bean property (e.g. property
> implicitLocking in the currently used lock manager implementation) and so
> the Configuration parsing can be made generic and all default values can
> be specified in the relevant classes
> 
> Tom
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org