db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mahler <thomas.mah...@home.ins.de>
Subject [OJB] Issue #OJB134 - user defined proxy objects
Date Tue, 25 Feb 2003 20:44:28 GMT
You can view the issue detail at the following URL:
<http://scarab.werken.com/scarab/issues/id/OJB134>

Type :        Feature
Issue Id :    OJB134
Reported by: Thomas Mahler
             thma - (thomas.mahler@home.ins.de)

Details:

Summary: user defined proxy objects
Description: Hi Maarten,

AFAIK this is not possible today.
But I think it's a feature request that could be beneficial for several users. I also believe
that is not that difficult to implement.

It won't make it into 1.0, but we can place it on the post 1.0 roadmap.

For the time being you could try to use instance call-backs and use the onLoad callback to
fill reference and collections attributes with your proxy objects.

cheers,
Thomas

Maarten Coene wrote:
Hi,

I have a couple of questions about the proxies.

1. I want to use dynamic proxies, but these proxies may not use the PersistenceBroker for
querying the database. Instead, they must get the real object through an API I defined myself.
The idea is to return object from my object model to clients, but these clients cannot access
the database directly, they must use a specific component. This means that if I return proxies,
these proxies must also use that component.

More concrete: the dynamic proxy wil do something like this to retrieve the object:

if (realObject == null) {
    realObject = broker.getObjectByIdentity(id);
}

But I want this to be:

if (realObject == null) {
     realObject = myComponent.getObject(id);
}

Is it possible to do this with dynamic proxies? I know I can define my own proxy for each
class from the object model, but using dynamic proxies would save me a lot of work.



2. If the above problem is not possible with dynamic proxies, is it possible to define my
own proxy-class for proxy for a reference? It looks to me that the reference-descriptor element
only allows the use of dynamic proxies for this purpose?

I want to do something like this:

<reference-descriptor
         name="productGroup"
         class-ref="org.apache.ojb.broker.ProductGroup"
         proxy="true"
         proxy-class="com.MyProxy" > 
Status: New
Resolution: Later
Priority: Medium
Vote: Medium


Mime
View raw message