Just had a look at the dependency visitor.

Why do you have to models exposing their internals to the visitor, wouldn't it 
be better to get a
Iterable<DependenycModel> dependenciesForScope(Class<? extends Annotation> 
scope) in the model classes. So the filtering 
could be internal and the usage would be much cleaner. As well as having the 
law of demeter and behaviour and attributes 
together.

WDYT ?

Michael

Rickard Öberg schrieb:
> Niclas Hedhman wrote:
>> On Wed, Jun 11, 2008 at 10:23 PM, Rickard Öberg <[EMAIL PROTECTED]> wrote:
>>
>>> Alright, the cleanup and shuffle-around is done now. The only remaining
>>> part which does not compile currently is the RDF-output of the model.
>> I probably had a hunch, and it was never fully complete.
>>
>> So, I can take charge of this and "start over" in a couple of days,
> 
> Don't worry, I'm rewriting it now using the new ModelVisitor. It's quite 
> pretty, and not that much work (just started though, so might get 
> screwed later). Also, I created a DependencyVisitor as a subclass of 
> ModelVisitor so you can now easily traverse only the dependencies by 
> using that, like so:
> ApplicationModel applicationModel = ...;
> applicationModel.visitModel(new DependencyVisitor(Service.class))
> {
>     public void visitDependency(DependencyModel serviceDependency)
>     {
>       .. do something with the service dependency ..
>     }
> });
> 
> It seems like creating some specialized visitors can make it a whole lot 
> easier to work with the model, now that the traversing is in one place 
> only (the model itself).
> 
> /Rickard
> 
> 
> _______________________________________________
> qi4j-dev mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/qi4j-dev


_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to