>  Anyway, what I actually need is access to attributes defined in the
> server's concrete class. These attributes define some server specific
> behavior, and are a very natural solution to the problem at hand (I use
> the attributes to describe syncrhonization between different instances
> of the same class - Liskov can relax).
>

Cant you extend your interface with a method that can provide that
same information you store into the attributes?

see this simple example

[Flags]
enum ClassBehavior
{
A = 1,
B = 2,
C = 4
}

interface Interface
{
ClassBehavior Behavior { get; }
...
}

//[BehaviorAAttribute] not needed any more
//[BehaviorBAttribute] not needed any more
class Concrete : Interface
{
ClassBehavior Behavior { get { return ClassBehavior.A | ClassBehavior.B; } }
...
}

This way you tighten more the behavior with the interface, than with
the attributes, which are loosely coupled information.

When your attributes have more information than the attribute itself,
it may not work for you ...

HTH
// Ryan

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to