I know you asked for feedback through Artima, but I don't have an account and
I wanted to share something.
I enjoyed the article, however I think there's information missing that is
likely to be useful. I've discussed with a few people the concept of
functionality like this for Java, and inevitably they always ask, what if
there's a conflict?
So, by your example, what would happen if you had the following:
trait A {
def foo() = println("a.foo")
def bar() = println("a.bar")
def baz() = println("a.baz")
}
trait C {
def foo() = println("c.foo")
def bar() = println("c.bar")
def baz() = println("c.baz")
}
class B(@proxy a : A, @proxy c : C) {
def bar() = println("b.bar")
}
val a = new A
val c = new C
val b = new B(a,c)
b.baz() // what happens here?
Please excuse any poor syntax, I hope you get the idea.
So personally, I would hope the Autoproxy plugin to report a compile error at
the line:
class B(@proxy a : A, @proxy c : C)
...and require that a conflicting method would have to be resolved by
explicitly choosing one of the proxies to delegate to.
But there's no mention of the policy for this in the article, which I think
would be helpful, and from my experience is probably something that people
will ask.
HTH,
Graham
> New article on the plugin here:
> http://www.artima.com/weblogs/viewpost.jsp?thread=275135
--
You received this message because you are subscribed to the Google Groups "The
Java Posse" 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/javaposse?hl=en.