On Sep 10, 2009, at 11:11 AM, Galder Zamarreno wrote:
Hi Vladimir,
I had a look at the implementation and I'm not sure I understand the
need for the reflection visit calls in
AbstractConfigurationBeanVisitor.
Using reflection makes harder to follow code and it's slower than
typed
calls and I'm not sure of the reason to use it here.
yes, I would also go for a
strongly typed visitor for the same reasons.
Also, I don't see the need for a standard
ConfigurationValidatingVisitor
that does such validation. Instead, the way I see it working is
SingletonStoreConfig having some kind of callback method being called,
i.e. the traversalCompleted() call and within it, SingletonStoreConfig
can, using the ComponentRegistry, retrieve the Transport component and
see if it's set or not. Or alternatively, SingletonStoreConfig could
use
the passed InfinispanConfiguration to do its validation.
I would go for the later
approach, to do the validation in the start
method, to keep the logic where the data is.
The only situation in which I would use an visitor, is if this
validation requires some additional dependencies which are not natural
- e.g. a dependency on Transport.
In this situation I would not like to make SingletonStore(Config) be
aware/depend on Transport class (this is not a natural dependency),
but I would rather 'externalize' the logic within some code.
This can be either within a visitor, or within some validator classes
that can have access to the ComponentRegistry, and which are called
right before starting the cache.
To sum up, I think each AbstractNamedCacheConfigurationBean
implementation should, if it requires to, have the ability to validate
the configuration via some kind of callback. Such callback should
probably is possibliy traversalCompleted() itself.
WDYT?
On 09/09/2009 08:21 PM, Vladimir Blagojevic wrote:
> Hi,
>
> Galder and I talked about this offline. Time to involve you guys!
>
> I just completed visitor pattern for our configuration objects.
> Visitor
> is passed from root of configuration - InfinispanConfiguration
> object.
> InfinispanConfiguration class has a new method:
>
> public void accept(ConfigurationBeanVisitor v)
>
> How do we want to integrate this visitor into existing structure?
>
> 1) We add a new factory method to InfinispanConfiguration with
> additional ConfigurationBeanVisitor parameter
>
> 2) We leave everything as is and if there is a need to pass some
> visitor
> we pass it to InfinispanConfiguration instance directly (from
> DefaultCacheManager)
>
> DefaultCacheManager will pass ValidationVisitor to
> InfinispanConfiguration that will verify configuration semantically.
>
> Regards,
> Vladimir
>
> On 09-09-09 10:19 AM, Galder Zamarreno wrote:
>> Good idea :)
>>
>> On 09/09/2009 04:13 PM, Vladimir Blagojevic wrote:
>>> Yeah,
>>>
>>> I was thinking that we can make a visitor for configuration tree
>>> and
>>> then you can do verification of any node and other things as
>>> well. Use
>>> cases will come up in the future for sure.
>>>
>>> Cheers
>>>
>>>
>>>
>>> On 09-09-09 3:29 AM, Galder Zamarreno (JIRA) wrote:
>>>> [
>>>>
https://jira.jboss.org/jira/browse/ISPN-145?page=com.atlassian.jira.plugi...
>>>> #action_12484894
>>>>
>>>> ]
>>>>
>>>> Galder Zamarreno commented on ISPN-145:
>>>> ---------------------------------------
>>>>
>>>> Not sure I understand what you mean by generic though. You mean
>>>> any
>>>> component to have a validation step of some sort?
>>>>
>>>> Thanks for taking this on :)
>>>>
>>>>> No transport and singleton store enabled should not be allowed
>>>>> --------------------------------------------------------------
>>>>>
>>>>> Key: ISPN-145
>>>>> URL:
https://jira.jboss.org/jira/browse/ISPN-145
>>>>> Project: Infinispan
>>>>> Issue Type: Bug
>>>>> Components: Loaders and Stores
>>>>> Affects Versions: 4.0.0.ALPHA6
>>>>> Reporter: Galder Zamarreno
>>>>> Assignee: Vladimir Blagojevic
>>>>> Priority: Minor
>>>>> Fix For: 4.0.0.CR1
>>>>>
>>>>>
>>>>> Throw configuration exception if singleton store configured
>>>>> without
>>>>> transport having been configured.
>>>>> It makes no sense to have singleton store enabled when there's
no
>>>>> transport.
>>>
>>
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/infinispan-dev
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache
_______________________________________________
infinispan-dev mailing list
infinispan-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev