ojb-dev@db.apache.org
[Top] [All Lists]

Re: svn commit: r538346 - in /db/ojb/branches/OJB_1_0_RELEASE/src/java/o

Subject: Re: svn commit: r538346 - in /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker: PersistenceChecker.java core/PersistenceCheckerOptImpl.java core/PersistenceCheckerSolidImpl.java util/ShortcutMapper.java
From: Armin Waibel
Date: Fri, 06 Jul 2007 11:10:04 +0200
Hi Martin,

Martin KalÃn wrote:
>
> Hi Armin and everyone else,
>  snippets from SVN #538346:
>
> arminw@xxxxxxxxxx wrote:
>> URL: http://svn.apache.org/viewvc?view=rev&rev=538346
>> Log:
>> initial check in
>>
>> Added:
>> db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/ShortcutMapper.java
>>
>> +    static
>> +    {
>> +        Mapping mapping = new Mapping(ObjectCache.class)
>> +                .add("jcs", ObjectCacheJCSImpl.class);
>
> This adds a new run-time dependency for OJB (the JCS JAR) which was
> previously only present if explicitly selecting the JCS cache.
>
> Would it be possible to change to use class names as String objects
> stored in the shortcut mapping table, and then look them up on demand
> instead (with the OJB standard classForName wrappers)?
>
> I could work on a patch for this if you think it seems like an OK
> behviour. (The change would be transparent to users having the
> shortcut "jcs" in their repository files.)

I agree with you and sorry I don't think about this before writing the ShortcutMapper class.
Additional new run-time dependencies are:
PersistentFieldDynaBeanImpl --> org.apache.commons.beanutils.DynaBean
PersistentFieldAutoProxyImpl, PersistentFieldCGLibImpl --> CGLib

You can find a patched version of ShortcutMapper class in SVN. Only a few lines of code change. Now inner class Mapping always resolve the Class via ClassHelper.

Do you think it this can cause class loader hassle - e.g. the mapped Class instance (initialized at first call of ShortcutMapper) is different from the resolved one (user set other class-loader in ClassHelper and then resolve the shortcut name)?

regards,
Armin

>
> I think it's nice to have the number of OJB runtime deps small and
> add 3rd party JARs only when required (DBCP is another one that I
> think should be reworked like this, ie only needed at RT when
> explicitly selecting DBCP pooling).
>
> Any thoughts?
>
> Regards,
>  Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@xxxxxxxxxxxxx
> For additional commands, e-mail: ojb-dev-help@xxxxxxxxxxxxx
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@xxxxxxxxxxxxx
For additional commands, e-mail: ojb-dev-help@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>