dev@jsr311.java.net

Re: Inheritance of Java classes

From: Dhanji R. Prasanna <dhanji_at_gmail.com>
Date: Fri, 18 May 2007 14:55:06 -0700

On 5/18/07, Jerome Louvel <jerome.louvel_at_noelios.com> wrote:
>
>
> For the identification, the annotation @ResourceRef could be inherited
> indeed, but if it is overridden in a subclass, the subclass's annotation
> should have priority.


What if it is overridden without any annotation--is that considered a hiding
override or an error?

Also, it seems natural to inherit the representations. In my example, that
> means that ClientsResource would inherit the representation from
> AccountResource (getAccount), which seems unwanted. I will change the
> AccountResource to not have the @Output anno on its getAccount() method.


I take your point about inheriting resources, though in this case I would
argue it is antipatternistic; if Account is not a generalization of Clients
(Clients are not Accounts), then we're just extending Account to grab its
functionality (like a mixin), which is ugly =( when really we should be
injecting it as a dependency.

But no objection to the method in general =)

Dhanji.