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 Andy Malakov <an...@transdecisions.com> on 2004/02/11 01:45:38 UTC

Feature proposal

Hello All,

What do you guys think about allowing user to extend OJB IndirectionHandler (used as InvocationHandler for OJB Proxies created by OJB) ?

Main benefit: Some methods of a persistable object can be dispatched based solely on object Identity available to Proxy handler (without object materialization).

For example: In my system all persistable objects implement interface Persistable that provides basic features for obtaining object identity (similar to OJB Identity). I would like to be able to access to these methods on Proxy objects without target materialization. 


There is only one place where OJB constructs InvocationHandlers for persistable objects - class o.a.ojb.broker.VirtualProxy. Will it be possible to allow user to specify customized instance of IndirectionHandler (must be subclass of IndirectionHandler) in OJB.properties?


If you agree I would be glad to send necessary updates for you approval. 


Many thanks,
Andy

P.S. Please CC me on reply.

Re: [OT] Re: Feature proposal

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi all,

there are many naming conventions for interfaces / implementation:

Interface : Implementation

IXyz : Xyz (used in Eclipse)
Xyz : XyzImpl
XyzIF : Xyz

and i think we've got all of them in ojb ;)
personally i prefer Xyz : XyzImpl or IXyz : Xyz.

jakob

Gus Heck wrote:
> I agree just say what it does, let the java syntax identify the 
> specifics...  I have an otherwise good book that prepends I to all it's 
> interfaces too which is almost ok until you get to a class that begins 
> with I like this...
> 
> IIndirectionHandler makes me an implementation of  ILl.  :)
> 
> This does make me wonder if you have a doc outlining coding conventions 
> in OJB? Seems like something I should consider if I provide any patches 
> or submisions... Things like where you stand on this.foo vs _foo and 
> where you want your braces relative to your if's.. etc.
> 
> -Gus
> 
> Brian McCallister wrote:
> 
>> This has bugged me for a while, what is the love of FooIF for 
>> interface tagging? It reminds me if m_intFoo which makes me want to 
>> curl up under my desk and cry. IndirectionHandler seems like a good 
>> name to me =)
>>
>> -Brian
>>
>> On Feb 11, 2004, at 11:25 AM, Andy Malakov wrote:
>>
>>>> .. Rather than extend I would lean towards providing alternate 
>>>> implementations
>>>
>>>
>>>
>>> Thank you Brian, that would be even better. From what I can see 
>>> clients use all public methods of IndirectionHandler:
>>>
>>> public interface IndirectionHandlerIF extends InvocationHandler {
>>>      boolean alreadyMaterialized ();
>>>      Object getRealSubject ()
>>>      void setRealSubject (Object)
>>>
>>>     void addListener (MaterializationListener listener);
>>>     void removeListener (MaterializationListener listener);
>>> }
>>>
>>> Customized class may implement the above interface and declare 
>>> constructor with the same signature as IndirectionHandler.
>>>
>>>
>>> ----- Original Message -----
>>> From: "Brian McCallister" <mc...@forthillcompany.com>
>>> To: "OJB Developers List" <oj...@db.apache.org>
>>> Sent: Wednesday, February 11, 2004 11:07 AM
>>> Subject: Re: Feature proposal
>>>
>>>
>>>> I am in favor of this in principle -- though want to look at the code
>>>> around the IndirectionHandler etc. Rather than extend I would lean
>>>> towards providing alternate implementations =)
>>>>
>>>> However, not before 1.0
>>>>
>>>> -Brian
>>>>
>>>> On Feb 10, 2004, at 7:45 PM, Andy Malakov wrote:
>>>>
>>>>> Hello All,
>>>>>
>>>>> What do you guys think about allowing user to extend OJB
>>>>> IndirectionHandler (used as InvocationHandler for OJB Proxies created
>>>>> by OJB) ?
>>>>>
>>>>> Main benefit: Some methods of a persistable object can be dispatched
>>>>> based solely on object Identity available to Proxy handler (without
>>>>> object materialization).
>>>>>
>>>>> For example: In my system all persistable objects implement interface
>>>>> Persistable that provides basic features for obtaining object identity
>>>>> (similar to OJB Identity). I would like to be able to access to these
>>>>> methods on Proxy objects without target materialization.
>>>>>
>>>>>
>>>>> There is only one place where OJB constructs InvocationHandlers for
>>>>> persistable objects - class o.a.ojb.broker.VirtualProxy. Will it be
>>>>> possible to allow user to specify customized instance of
>>>>> IndirectionHandler (must be subclass of IndirectionHandler) in
>>>>> OJB.properties?
>>>>>
>>>>>
>>>>> If you agree I would be glad to send necessary updates for you
>>>>> approval.
>>>>>
>>>>>
>>>>> Many thanks,
>>>>> Andy
>>>>>
>>>>> P.S. Please CC me on reply.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

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


Re: [OT] Re: Feature proposal

Posted by Gus Heck <gu...@olin.edu>.
I agree just say what it does, let the java syntax identify the 
specifics...  I have an otherwise good book that prepends I to all it's 
interfaces too which is almost ok until you get to a class that begins 
with I like this...

IIndirectionHandler makes me an implementation of  ILl.  :)

This does make me wonder if you have a doc outlining coding conventions 
in OJB? Seems like something I should consider if I provide any patches 
or submisions... Things like where you stand on this.foo vs _foo and 
where you want your braces relative to your if's.. etc.

-Gus

Brian McCallister wrote:

> This has bugged me for a while, what is the love of FooIF for 
> interface tagging? It reminds me if m_intFoo which makes me want to 
> curl up under my desk and cry. IndirectionHandler seems like a good 
> name to me =)
>
> -Brian
>
> On Feb 11, 2004, at 11:25 AM, Andy Malakov wrote:
>
>>> .. Rather than extend I would lean towards providing alternate 
>>> implementations
>>
>>
>> Thank you Brian, that would be even better. From what I can see 
>> clients use all public methods of IndirectionHandler:
>>
>> public interface IndirectionHandlerIF extends InvocationHandler {
>>      boolean alreadyMaterialized ();
>>      Object getRealSubject ()
>>      void setRealSubject (Object)
>>
>>     void addListener (MaterializationListener listener);
>>     void removeListener (MaterializationListener listener);
>> }
>>
>> Customized class may implement the above interface and declare 
>> constructor with the same signature as IndirectionHandler.
>>
>>
>> ----- Original Message -----
>> From: "Brian McCallister" <mc...@forthillcompany.com>
>> To: "OJB Developers List" <oj...@db.apache.org>
>> Sent: Wednesday, February 11, 2004 11:07 AM
>> Subject: Re: Feature proposal
>>
>>
>>> I am in favor of this in principle -- though want to look at the code
>>> around the IndirectionHandler etc. Rather than extend I would lean
>>> towards providing alternate implementations =)
>>>
>>> However, not before 1.0
>>>
>>> -Brian
>>>
>>> On Feb 10, 2004, at 7:45 PM, Andy Malakov wrote:
>>>
>>>> Hello All,
>>>>
>>>> What do you guys think about allowing user to extend OJB
>>>> IndirectionHandler (used as InvocationHandler for OJB Proxies created
>>>> by OJB) ?
>>>>
>>>> Main benefit: Some methods of a persistable object can be dispatched
>>>> based solely on object Identity available to Proxy handler (without
>>>> object materialization).
>>>>
>>>> For example: In my system all persistable objects implement interface
>>>> Persistable that provides basic features for obtaining object identity
>>>> (similar to OJB Identity). I would like to be able to access to these
>>>> methods on Proxy objects without target materialization.
>>>>
>>>>
>>>> There is only one place where OJB constructs InvocationHandlers for
>>>> persistable objects - class o.a.ojb.broker.VirtualProxy. Will it be
>>>> possible to allow user to specify customized instance of
>>>> IndirectionHandler (must be subclass of IndirectionHandler) in
>>>> OJB.properties?
>>>>
>>>>
>>>> If you agree I would be glad to send necessary updates for you
>>>> approval.
>>>>
>>>>
>>>> Many thanks,
>>>> Andy
>>>>
>>>> P.S. Please CC me on reply.
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>



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


[OT] Re: Feature proposal

Posted by Brian McCallister <mc...@forthillcompany.com>.
This has bugged me for a while, what is the love of FooIF for interface 
tagging? It reminds me if m_intFoo which makes me want to curl up under 
my desk and cry. IndirectionHandler seems like a good name to me =)

-Brian

On Feb 11, 2004, at 11:25 AM, Andy Malakov wrote:

>> .. Rather than extend I would lean towards providing alternate 
>> implementations
>
> Thank you Brian, that would be even better. From what I can see 
> clients use all public methods of IndirectionHandler:
>
> public interface IndirectionHandlerIF extends InvocationHandler {
>      boolean alreadyMaterialized ();
>      Object getRealSubject ()
>      void setRealSubject (Object)
>
>     void addListener (MaterializationListener listener);
>     void removeListener (MaterializationListener listener);
> }
>
> Customized class may implement the above interface and declare 
> constructor with the same signature as IndirectionHandler.
>
>
> ----- Original Message -----
> From: "Brian McCallister" <mc...@forthillcompany.com>
> To: "OJB Developers List" <oj...@db.apache.org>
> Sent: Wednesday, February 11, 2004 11:07 AM
> Subject: Re: Feature proposal
>
>
>> I am in favor of this in principle -- though want to look at the code
>> around the IndirectionHandler etc. Rather than extend I would lean
>> towards providing alternate implementations =)
>>
>> However, not before 1.0
>>
>> -Brian
>>
>> On Feb 10, 2004, at 7:45 PM, Andy Malakov wrote:
>>
>>> Hello All,
>>>
>>> What do you guys think about allowing user to extend OJB
>>> IndirectionHandler (used as InvocationHandler for OJB Proxies created
>>> by OJB) ?
>>>
>>> Main benefit: Some methods of a persistable object can be dispatched
>>> based solely on object Identity available to Proxy handler (without
>>> object materialization).
>>>
>>> For example: In my system all persistable objects implement interface
>>> Persistable that provides basic features for obtaining object 
>>> identity
>>> (similar to OJB Identity). I would like to be able to access to these
>>> methods on Proxy objects without target materialization.
>>>
>>>
>>> There is only one place where OJB constructs InvocationHandlers for
>>> persistable objects - class o.a.ojb.broker.VirtualProxy. Will it be
>>> possible to allow user to specify customized instance of
>>> IndirectionHandler (must be subclass of IndirectionHandler) in
>>> OJB.properties?
>>>
>>>
>>> If you agree I would be glad to send necessary updates for you
>>> approval.
>>>
>>>
>>> Many thanks,
>>> Andy
>>>
>>> P.S. Please CC me on reply.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>



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


Re: Feature proposal

Posted by Thomas Dudziak <to...@first.gmd.de>.
On Wed, 11 Feb 2004, Andy Malakov wrote:

> > .. Rather than extend I would lean towards providing alternate implementations
> 
> Thank you Brian, that would be even better. From what I can see clients use all public methods of IndirectionHandler:
> 
> public interface IndirectionHandlerIF extends InvocationHandler {
>      boolean alreadyMaterialized ();
>      Object getRealSubject ()
>      void setRealSubject (Object)
> 
>     void addListener (MaterializationListener listener);
>     void removeListener (MaterializationListener listener);
> }
> 
> Customized class may implement the above interface and declare constructor with the same signature as IndirectionHandler.

I recently simplified the proxy handling so this shouldn't be too hard to
support (though not in 1.0 ;-). However such an interface will be
absolutely necessary to distinguish OJB proxies from application proxies!

As for the name of the interface, what about IIndirectionHandler ;-) Just
a little sad COM/DCOM joke ...
Earnestly, what about OJBInvocationHandler or something like that ?

Tom


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


Re: Feature proposal

Posted by Andy Malakov <an...@transdecisions.com>.
> .. Rather than extend I would lean towards providing alternate implementations

Thank you Brian, that would be even better. From what I can see clients use all public methods of IndirectionHandler:

public interface IndirectionHandlerIF extends InvocationHandler {
     boolean alreadyMaterialized ();
     Object getRealSubject ()
     void setRealSubject (Object)

    void addListener (MaterializationListener listener);
    void removeListener (MaterializationListener listener);
}

Customized class may implement the above interface and declare constructor with the same signature as IndirectionHandler.


----- Original Message ----- 
From: "Brian McCallister" <mc...@forthillcompany.com>
To: "OJB Developers List" <oj...@db.apache.org>
Sent: Wednesday, February 11, 2004 11:07 AM
Subject: Re: Feature proposal


> I am in favor of this in principle -- though want to look at the code 
> around the IndirectionHandler etc. Rather than extend I would lean 
> towards providing alternate implementations =)
> 
> However, not before 1.0
> 
> -Brian
> 
> On Feb 10, 2004, at 7:45 PM, Andy Malakov wrote:
> 
> > Hello All,
> >
> > What do you guys think about allowing user to extend OJB 
> > IndirectionHandler (used as InvocationHandler for OJB Proxies created 
> > by OJB) ?
> >
> > Main benefit: Some methods of a persistable object can be dispatched 
> > based solely on object Identity available to Proxy handler (without 
> > object materialization).
> >
> > For example: In my system all persistable objects implement interface 
> > Persistable that provides basic features for obtaining object identity 
> > (similar to OJB Identity). I would like to be able to access to these 
> > methods on Proxy objects without target materialization.
> >
> >
> > There is only one place where OJB constructs InvocationHandlers for 
> > persistable objects - class o.a.ojb.broker.VirtualProxy. Will it be 
> > possible to allow user to specify customized instance of 
> > IndirectionHandler (must be subclass of IndirectionHandler) in 
> > OJB.properties?
> >
> >
> > If you agree I would be glad to send necessary updates for you 
> > approval.
> >
> >
> > Many thanks,
> > Andy
> >
> > P.S. Please CC me on reply.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 

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


Re: Feature proposal

Posted by Brian McCallister <mc...@forthillcompany.com>.
I am in favor of this in principle -- though want to look at the code 
around the IndirectionHandler etc. Rather than extend I would lean 
towards providing alternate implementations =)

However, not before 1.0

-Brian

On Feb 10, 2004, at 7:45 PM, Andy Malakov wrote:

> Hello All,
>
> What do you guys think about allowing user to extend OJB 
> IndirectionHandler (used as InvocationHandler for OJB Proxies created 
> by OJB) ?
>
> Main benefit: Some methods of a persistable object can be dispatched 
> based solely on object Identity available to Proxy handler (without 
> object materialization).
>
> For example: In my system all persistable objects implement interface 
> Persistable that provides basic features for obtaining object identity 
> (similar to OJB Identity). I would like to be able to access to these 
> methods on Proxy objects without target materialization.
>
>
> There is only one place where OJB constructs InvocationHandlers for 
> persistable objects - class o.a.ojb.broker.VirtualProxy. Will it be 
> possible to allow user to specify customized instance of 
> IndirectionHandler (must be subclass of IndirectionHandler) in 
> OJB.properties?
>
>
> If you agree I would be glad to send necessary updates for you 
> approval.
>
>
> Many thanks,
> Andy
>
> P.S. Please CC me on reply.



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