On Saturday 01 November 2003 17:14, Alexis Agahi wrote:
> Hi,
>
> As I'm now using hibernate on current biz project, some ideas come to my
> brain about how could have transparent persistence with avalon compenent.
>
> Based on hibernate (JDO?) approach that all object could be mapped in
> database with get/setter method to populate the object field from db (or
> persist state to db), any component could support such feature.
>
> The main problem would be how manage compenent persistance.
> I have a suggestion: via a Persitence interface that could be added in
> component lifecycle.
>
> such as
> public interface Persistence
> {
> public void persitence( PersistenceManager persistenceManager );
> }
>
> PersistenceManager class would manage object persistance/lookup(load) and
> transaction provider.
Although I am pretty keen on getting into a Persistence model for component's
value objects (as the component itself rarely is persistable), I fail to see
the need for a extension of Avalon Framework.
IMHO, the PersistenceManager is just any Avalon component, which is configured
the normal way, and looked up via the ServiceManager by components that
requires it.
I don't see the difference (other than casting) of;
public void service( ServiceManager sm )
{
m_ServiceManager = sm;
}
public void persistence( PersistenceManager pm )
{
m_Persistence = pm;
// snip
}
and
public void service( ServiceManager sm )
{
m_ServiceManager = sm;
m_Persistence = (PersistenceManager) sm.lookup( PersistenceManager.ROLE);
}
Please elaborate what is the benefit?
Niclas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]