db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <tom...@gmail.com>
Subject Re: ProxyHelper -- should it remain static?
Date Mon, 28 Mar 2005 19:39:29 GMT
> I am in the process of going through right now and listing all these
> 'rogue' places. But for an immediate example, StatementsForClassImpl has
> no apperant connection to configuation information and it uses
> ProxyHelper.isNormalOjbProxy().

This is a standard case of how the refactoring to IoC works.
StatementsForClassImpl is an implementation for the interface
StatementsForClassIF which is primarily used in the
PersistenceConfiguration class (see method getStatementsForClass).
Since it is created via the IoC container, the refactoring is quite
simple - simply have the proxy factory (or your reference/collection
proxy factories) handled by the Container as well, and require it as
an additional argument in the StatementsForClassImpl constructor.
Voila, no need for static call anymore.
 
> Does this mean that BrokerHelper will be refactored as well? It is one
> of the major culprits that uses ProxyHelper statically without any
> application references.

Should be. How, really depends on how the methods that use the
ProxyHelper are itself used, e.g. whether an OJB, PC or PB object can
be given as an additional argument.

Tom

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


Mime
View raw message