synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hiranya Jayathilaka <hiranya...@gmail.com>
Subject Re: Make enable Synapse to configure in others ways
Date Fri, 20 Feb 2009 11:24:58 GMT
Hi Charith,
I may have misinterpreted the situation but by going through the
descriptions you have posted, I get the feeling that there is a violation of
OO principles somewhere in the design. I agree with Indika, that this is
something we need to tackle using an API/Interface and not reflection. IMHO
reflection should be used only when we have no other choice and we are
forced to bend the OO programming practices.

I think you should provide a builder interface. This interface will have a
method which builds and returns a Synapse configuration. Users can implement
the interface to initialize the Synapse in application specific ways. As for
passing arguments to the builder, you should have getParameter(String),
setParameter(String, Object) methods in your interface. The builder
implementation should be capable of interpreting these parameters (based on
their names), casting them into suitable types and using them internally.
Your configuration builder class should accept a valid implementation of the
builder interface and invoke the method which creates the Synapse
configuration.

Thanks,
Hiranya



On Fri, Feb 20, 2009 at 3:37 PM, indika kumara <indika.kuma@gmail.com>wrote:

> Interfaces are for providing abstractions. You can pass parameter as
> Map <string, Object> ... key is only meaningful to particular
> implementation…or if there many common attributes, then  those can be
> encapsulated into a data structure, a class – some abstraction and
> keep  a Map<string,Object> (instance variable )to hold any specific
> parameters ….there are  many ways to do these things ...with out using
> reflection.
>
> I just say what I feel when I look at into your code. If you know that
> you can achieve what you want and others too (community) like these...
> I am neutral.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>

Mime
View raw message