Re: Understanding Classes
- From: markspace <nospam@xxxxxxxxxxx>
- Date: Wed, 22 Jul 2009 17:41:13 -0700
alexandre_paterson@xxxxxxxx wrote:
IDEA doesn't just write the methods skeletons, it also generates
all the delegated method calls to the wrapped subject.
That's nice. They'll have to get that feature into NetBeans soon. :)
Actually if I'd known about Project Coin, I might have suggested something for the Java compiler like that. For example:
Mix-ins for Java
Allow the interface of a class to specify an instance variable which implements that interface:
class Karel extends Robot implements Jumping(jump), Colors(color)
{
Jumping jump;
Colors color;
... etc. rest of class ...
}
Here, the Jump interface would be implemented by the jump instance variable. All methods in the Karel class would be implemented by the compiler to just call the same method on the variable jump. And the same for the Colors interface and the color variable.
I'm undecided whether the instance variables which implement an interface should be required to be final (my preference is not) or should be allowed to be an interface type or an abstract type, instead of required to be a concrete type (my feeling is that abstract or interface types are ok).
My 2 nickels.
.
- Follow-Ups:
- Re: Understanding Classes
- From: Donkey Hottie
- Re: Understanding Classes
- References:
- Understanding Classes
- From: brian void
- Re: Understanding Classes
- From: markspace
- Re: Understanding Classes
- From: alexandre_paterson
- Understanding Classes
- Prev by Date: Re: Understanding Classes
- Next by Date: Re: Query regarding XSLT "Root element not set"
- Previous by thread: Re: Understanding Classes
- Next by thread: Re: Understanding Classes
- Index(es):
Relevant Pages
|
Loading