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 "Clute, Andrew" <An...@osn.state.oh.us> on 2005/03/30 04:38:16 UTC

Pattern between PersistenceBroker and PersistenceBrokerInternal

I see there was a new interface introduced named
PersistenceBrokerInternal, that separates some methods to a private
versus public interface. getProxyFactory() is on the internal interface
versus the external one.
 
My question is: in places where I want to access the ProxyFactory
sometimes objects will have references to PersistenceBrokers, and
sometimes they will have references to PersistenceBrokerInternal or
PersistenceBrokerImpl.
 
When the reference is to just PersistenceBroker, the code to get the
ProxyFactory looks like this:
 
pb.getConfiguration().getOjb().getProxyFactory();
 
 
When the reference is to something at least at the
PersistenceBrokerInternal level or lower, the code can be changed to
look like:
 
pb.getProxyFactory();
 
Is the plan to move references to PersistenceBroker that exist inside
the kernel to PersistenceBrokerInternal? Is there a pattern for when an
object holds a reference to the base PersistenceBroker interface versus
the internal one? This doesn't really have a huge impact, except from a
stylistic impact (a single indirection is 'cleaner' than a triple one).
 
Thanks
 
-Andrew
 
 

Re: Pattern between PersistenceBroker and PersistenceBrokerInternal

Posted by Thomas Dudziak <to...@gmail.com>.
AFAIK PBInternal is intended to give access to services that all PB
implementations must provide, but which should not be visible to the
users.
If the proxy factory is not associated to a PB (i.e. one proxy factory
per PB), then IMO it should stay the first way. WDYT ?

Tom

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