Ok that title is just bad, but I can't figure out a better one.
I have a architecture that uses a Readonly IQueryable Repository with just
one Method: IQueryable<T> GetAll()
To implement logging, caching lazy loading and some filtering I use
decorators to that IQueryable Repository so the end user gets a pipeline
similar to this:

CachedRepository<T> -> PriorityFilter<T> -> LoggingDecorator<T> -> Proxy<T>
-> SqlRepository<T>.

If I'd to implement this using a convention based approach, how could I
ensure that some ordering is still used?
Mainly I need to have the CachedRepository be at the top of the list while
the SqlRepository and the Proxy be at the lower end of the list.

I guess it would be possible to put the ordering of the decorators into the
XML configuration while registering the components by convention. But how
could I define the ordering once for all pipes (there are 4 different
classes of T right now) through XML?

My current solution is kind of ok. I use one a generic method that registers
the pipeline in the container, I'm just curious on how one would approach
this with AllTypes.

On this matter there is one more thing:
Since most of my decorators are Generic I tried to register them using
container.Register(typeof(CachedRepository<>)...
The generic registration works, but it fails to be picked up automatically
by components if there are other classes that explicitly implement
IRepository<T>.

greetings Daniel

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to