You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Sandro Martini <sa...@gmail.com> on 2009/11/13 00:38:20 UTC

Handle Code Customizations

Hi to all,
some time ago I wrote some utility classes to handle in a transparent
way the (dynamic) loading of Classes, but in a way like ResourceBundke
does. My (real, business) problem was to handle standard code that in
some cases had to be customized (for example only for some Customers,
and any of these with its own version) overriding the standard
behavior.

The logical flow is:
- set the full classname of the base (standard) class to load,
- set the code of the variant (for example the Customer Code),
- set other parameters,
- then calculate the full class name of the variant (depending on the
type of style, like subpackage, prefix, postfix, etc ... by default
postfix like in ResourceBundles, ex. MyBeanName_Customer),
- then try to load the customized version of the class, otherwise the
standard version.


I can do a rewrite of this for Pivot (1.4.1 or 1.5), but some time is
required (it was for a Web Enterprise Application) to drop some part,
and simplify others.

Probably this is not best suited for Pivot core, but what do you think ?
Could help to have a support for this type of common problems.

Bye,
Sandro

Re: Handle Code Customizations

Posted by Greg Brown <gk...@mac.com>.
To me, this sounds pretty domain specific, so it is probably not a good fit for Pivot. However, maybe others will have a different opinion.
G

On Thursday, November 12, 2009, at 06:38PM, "Sandro Martini" <sa...@gmail.com> wrote:
>Hi to all,
>some time ago I wrote some utility classes to handle in a transparent
>way the (dynamic) loading of Classes, but in a way like ResourceBundke
>does. My (real, business) problem was to handle standard code that in
>some cases had to be customized (for example only for some Customers,
>and any of these with its own version) overriding the standard
>behavior.
>
>The logical flow is:
>- set the full classname of the base (standard) class to load,
>- set the code of the variant (for example the Customer Code),
>- set other parameters,
>- then calculate the full class name of the variant (depending on the
>type of style, like subpackage, prefix, postfix, etc ... by default
>postfix like in ResourceBundles, ex. MyBeanName_Customer),
>- then try to load the customized version of the class, otherwise the
>standard version.
>
>
>I can do a rewrite of this for Pivot (1.4.1 or 1.5), but some time is
>required (it was for a Web Enterprise Application) to drop some part,
>and simplify others.
>
>Probably this is not best suited for Pivot core, but what do you think ?
>Could help to have a support for this type of common problems.
>
>Bye,
>Sandro
>
>