You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Venkata Krishnan <fo...@gmail.com> on 2007/08/08 11:42:36 UTC

Extending all Bindings from AbstractBinding

Hi,

I just observed that, not all bindings are extending from
AbstractBinding though all implement the interface Binding.  The
AbstractBinding class provides an implementation for the Binding
interface and in my opinion should be used by all bindings to avoid
duplication of code that implements the BInding interface.

I feel the pinch for this now as I am adding a couple of things for
policies and seems a bit odd to go an copy over the same things across
a dozen classes.

Let me know what people feel about this and I can go and fix all the
bindings for this.

Thanks.

- Venkat

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


Re: Extending all Bindings from AbstractBinding

Posted by Venkata Krishnan <fo...@gmail.com>.
Ant, just what I was wanting to mention - you beat me to it.  I really
think additions may not be a disturbance to the SPIs.  This could be a
start to looking at how much of the extension-helper we could start
moving into the SPIs. But am a bit curious about where this sort of
thing will go into the SPI.  Do we intend another package
org.apache.tuscany.sca.assembly in the spi module ?

Thanks

- Venkat


On 8/8/07, ant elder <an...@gmail.com> wrote:
> The ExtensionHelper module was originally intended as just an interim thing
> while we were sorting out the SPIs anyway, so if we  go ahead with this its
> fine to move those abstract classes into the SPI module. Just adding
> something new to the SPI module seems fine to me as its not going to break
> anything so I'm still +1 on doing this.
>
>    ...ant
>
> On 8/8/07, Simon Laws <si...@googlemail.com> wrote:
> >
> > On 8/8/07, Venkata Krishnan <fo...@gmail.com> wrote:
> > >
> > > Hi,
> > >
> > > I just observed that, not all bindings are extending from
> > > AbstractBinding though all implement the interface Binding.  The
> > > AbstractBinding class provides an implementation for the Binding
> > > interface and in my opinion should be used by all bindings to avoid
> > > duplication of code that implements the BInding interface.
> > >
> > > I feel the pinch for this now as I am adding a couple of things for
> > > policies and seems a bit odd to go an copy over the same things across
> > > a dozen classes.
> > >
> > > Let me know what people feel about this and I can go and fix all the
> > > bindings for this.
> > >
> > > Thanks.
> > >
> > > - Venkat
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> > >
> > >
> > I like the idea but it gives me a problem with the sca binding. Adding it
> > to
> > SCABinding would imply a cyclic dependency as AbstractBinding is
> > implemented
> > in ExtensionHelper (as putting it in the SPI would imply and SPI change I
> > guess) which in turn depends on quite a lot of other stuff. If we could
> > separate out AbstractBinding somehow it would work for me. Maybe needs  to
> > wait until our SPI sweep. +1 to using it where ever it can safely be used.
> >
> > Simon
> >
>

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


Re: Extending all Bindings from AbstractBinding

Posted by ant elder <an...@gmail.com>.
The ExtensionHelper module was originally intended as just an interim thing
while we were sorting out the SPIs anyway, so if we  go ahead with this its
fine to move those abstract classes into the SPI module. Just adding
something new to the SPI module seems fine to me as its not going to break
anything so I'm still +1 on doing this.

   ...ant

On 8/8/07, Simon Laws <si...@googlemail.com> wrote:
>
> On 8/8/07, Venkata Krishnan <fo...@gmail.com> wrote:
> >
> > Hi,
> >
> > I just observed that, not all bindings are extending from
> > AbstractBinding though all implement the interface Binding.  The
> > AbstractBinding class provides an implementation for the Binding
> > interface and in my opinion should be used by all bindings to avoid
> > duplication of code that implements the BInding interface.
> >
> > I feel the pinch for this now as I am adding a couple of things for
> > policies and seems a bit odd to go an copy over the same things across
> > a dozen classes.
> >
> > Let me know what people feel about this and I can go and fix all the
> > bindings for this.
> >
> > Thanks.
> >
> > - Venkat
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> >
> I like the idea but it gives me a problem with the sca binding. Adding it
> to
> SCABinding would imply a cyclic dependency as AbstractBinding is
> implemented
> in ExtensionHelper (as putting it in the SPI would imply and SPI change I
> guess) which in turn depends on quite a lot of other stuff. If we could
> separate out AbstractBinding somehow it would work for me. Maybe needs  to
> wait until our SPI sweep. +1 to using it where ever it can safely be used.
>
> Simon
>

Re: Extending all Bindings from AbstractBinding

Posted by Simon Laws <si...@googlemail.com>.
On 8/8/07, Venkata Krishnan <fo...@gmail.com> wrote:
>
> Hi,
>
> I just observed that, not all bindings are extending from
> AbstractBinding though all implement the interface Binding.  The
> AbstractBinding class provides an implementation for the Binding
> interface and in my opinion should be used by all bindings to avoid
> duplication of code that implements the BInding interface.
>
> I feel the pinch for this now as I am adding a couple of things for
> policies and seems a bit odd to go an copy over the same things across
> a dozen classes.
>
> Let me know what people feel about this and I can go and fix all the
> bindings for this.
>
> Thanks.
>
> - Venkat
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
I like the idea but it gives me a problem with the sca binding. Adding it to
SCABinding would imply a cyclic dependency as AbstractBinding is implemented
in ExtensionHelper (as putting it in the SPI would imply and SPI change I
guess) which in turn depends on quite a lot of other stuff. If we could
separate out AbstractBinding somehow it would work for me. Maybe needs  to
wait until our SPI sweep. +1 to using it where ever it can safely be used.

Simon

Re: Extending all Bindings from AbstractBinding

Posted by Venkata Krishnan <fo...@gmail.com>.
HI Sebastien,

The Binding interface contains methods that are setters / getters for
name, uri and then by extending the intent and policy attach points it
inherits getters for the list of intents and policy sets.  To
implement these methods most of the bindings end up have the same
chunk of code that declares these files and then provides the getters
/ setters around them.  This is what has been abstracted into the
AbstractBinding class.

Thanks.

- Venkat


On 8/8/07, Jean-Sebastien Delfino <js...@apache.org> wrote:
> Venkata Krishnan wrote:
> > Hi,
> >
> > I just observed that, not all bindings are extending from
> > AbstractBinding though all implement the interface Binding.  The
> > AbstractBinding class provides an implementation for the Binding
> > interface and in my opinion should be used by all bindings to avoid
> > duplication of code that implements the BInding interface.
> >
> > I feel the pinch for this now as I am adding a couple of things for
> > policies and seems a bit odd to go an copy over the same things across
> > a dozen classes.
> >
> > Let me know what people feel about this and I can go and fix all the
> > bindings for this.
> >
> > Thanks.
> >
> > - Venkat
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> >
> >
>
> This might sound like a naive question, but if all bindings start to
> extend a common AbstractBinding class then why will we need a Binding
> interface at all? :)
>
> Another way to look at this is that maybe the code that you're copying
> shouldn't be part of the binding in the first place. Could you please
> point to the specific code bits causing the issue to help me understand?
> Thanks.
>
> --
> Jean-Sebastien
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

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


Re: Extending all Bindings from AbstractBinding

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Venkata Krishnan wrote:
> Hi,
>
> I just observed that, not all bindings are extending from
> AbstractBinding though all implement the interface Binding.  The
> AbstractBinding class provides an implementation for the Binding
> interface and in my opinion should be used by all bindings to avoid
> duplication of code that implements the BInding interface.
>
> I feel the pinch for this now as I am adding a couple of things for
> policies and seems a bit odd to go an copy over the same things across
> a dozen classes.
>
> Let me know what people feel about this and I can go and fix all the
> bindings for this.
>
> Thanks.
>
> - Venkat
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
>   

This might sound like a naive question, but if all bindings start to 
extend a common AbstractBinding class then why will we need a Binding 
interface at all? :)

Another way to look at this is that maybe the code that you're copying 
shouldn't be part of the binding in the first place. Could you please 
point to the specific code bits causing the issue to help me understand? 
Thanks.

-- 
Jean-Sebastien


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


Re: Extending all Bindings from AbstractBinding

Posted by ant elder <an...@gmail.com>.
+1 from me. I think there's a number of places we could do this type of
thing and doing so would help with simplifying things and could help with
some of the SPI clean up.

   ...ant

On 8/8/07, Venkata Krishnan <fo...@gmail.com> wrote:
>
> Hi,
>
> I just observed that, not all bindings are extending from
> AbstractBinding though all implement the interface Binding.  The
> AbstractBinding class provides an implementation for the Binding
> interface and in my opinion should be used by all bindings to avoid
> duplication of code that implements the BInding interface.
>
> I feel the pinch for this now as I am adding a couple of things for
> policies and seems a bit odd to go an copy over the same things across
> a dozen classes.
>
> Let me know what people feel about this and I can go and fix all the
> bindings for this.
>
> Thanks.
>
> - Venkat
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>