You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by belaran <be...@gmail.com> on 2005/05/20 14:59:13 UTC

Design Question : Symbol Sources et Interception vs POA

Hi everyone !

First of all i want to apologize for the rather long post...

I'm working on HiveMind and i try to figure out the possibilities of
the framework. I've been playing with most of its features and i get
the point for most of them. However, i've two question :

1) When HiveMind call your SymbolSource it's just call the method
'valueForSymbol(String symbol)' then the user has to code it's own
implementation to return he actual Symbol value. It's quite simple but
i find quite limited in someway:
            a) If you have many symbols ( like dozen), your
implementation will look like this :

if ( )
else if
else if
else...

Of course you can do this differently but this "single point" of
access, you'll always end up with something like this.

             b) If i had to "implement" this system i would have done this :

List valueForSymbol()

However i'm no architect or a renown designer ! So I believe I miss
something : May be you can give use case we're this implementation
comes handy or simply use case that's prove my assumptions false ?

2) Interception provides somes great functionnality and seems to offer
a very good subsitiute to AOP. My question is simply what AOP, which I
don't really know, offers that HiveMind's interception has not...

Thanks a lot,

Belaran

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Design Question : Symbol Sources et Interception vs POA

Posted by Renat Zubairov <re...@gmail.com>.
May be this article will give you an information about AOP vs. Interceptors 
discussion:

http://www.neward.net/ted/weblog/index.jsp?date=20030107



On 20/05/05, belaran <be...@gmail.com> wrote:
> 
> Hi everyone !
> 
> First of all i want to apologize for the rather long post...
> 
> I'm working on HiveMind and i try to figure out the possibilities of
> the framework. I've been playing with most of its features and i get
> the point for most of them. However, i've two question :
> 
> 1) When HiveMind call your SymbolSource it's just call the method
> 'valueForSymbol(String symbol)' then the user has to code it's own
> implementation to return he actual Symbol value. It's quite simple but
> i find quite limited in someway:
> a) If you have many symbols ( like dozen), your
> implementation will look like this :
> 
> if ( )
> else if
> else if
> else...
> 
> Of course you can do this differently but this "single point" of
> access, you'll always end up with something like this.
> 
> b) If i had to "implement" this system i would have done this :
> 
> List valueForSymbol()
> 
> However i'm no architect or a renown designer ! So I believe I miss
> something : May be you can give use case we're this implementation
> comes handy or simply use case that's prove my assumptions false ?
> 
> 2) Interception provides somes great functionnality and seems to offer
> a very good subsitiute to AOP. My question is simply what AOP, which I
> don't really know, offers that HiveMind's interception has not...
> 
> Thanks a lot,
> 
> Belaran
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
> 


-- 
Best regards,
Renat Zubairov

Re: Design Question : Symbol Sources et Interception vs POA

Posted by Knut Wannheden <kn...@gmail.com>.
Belaran,

On 5/20/05, belaran <be...@gmail.com> wrote:
> Hi everyone !
> 
> First of all i want to apologize for the rather long post...
> 
> I'm working on HiveMind and i try to figure out the possibilities of
> the framework. I've been playing with most of its features and i get
> the point for most of them. However, i've two question :
> 
> 1) When HiveMind call your SymbolSource it's just call the method
> 'valueForSymbol(String symbol)' then the user has to code it's own
> implementation to return he actual Symbol value. It's quite simple but
> i find quite limited in someway:
>             a) If you have many symbols ( like dozen), your
> implementation will look like this :
> 
> if ( )
> else if
> else if
> else...
> 
> Of course you can do this differently but this "single point" of
> access, you'll always end up with something like this.
> 

Some symbol sources are actually just "dynamic adapters". Take the
SystemPropertiesSymbolSource implementation for example:

    public String valueForSymbol(String name)
    {
        return System.getProperty(name);
    }

>              b) If i had to "implement" this system i would have done this :
> 
> List valueForSymbol()
> 
> However i'm no architect or a renown designer ! So I believe I miss
> something : May be you can give use case we're this implementation
> comes handy or simply use case that's prove my assumptions false ?
> 

In some cases your list of symbols might not be finite. That would a)
be impractical for the symbol source implementation and b) make it
impossible for HiveMind to find a symbol definition.

Hope this answer makes sense.

> 2) Interception provides somes great functionnality and seems to offer
> a very good subsitiute to AOP. My question is simply what AOP, which I
> don't really know, offers that HiveMind's interception has not...
> 

The HiveMind interceptors aren't really meant to substitute AOP. You
can in fact define HiveMind interceptors in terms of AOP style
interceptors (see hivemind.lib.MethodInterceptorFactory for this). AOP
offers a whole lot more which is not covered by HiveMind. I suggest
you read some AOP articles and see for your self if it would be useful
to you.

Regards,

--knut

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org