Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Objectteams » An idea on enabling typehole model in OT/J
An idea on enabling typehole model in OT/J [message #568737] Sun, 21 February 2010 10:23 Go to next message
Eugene Hutorny is currently offline Eugene HutornyFriend
Messages: 110
Registered: January 2010
Senior Member
The idea is to make explicit and available to the users what OT/J uses implicitly.
A closest match to this idea is what Qi4j creators do declare an interface for a class and hope that someone else will provide an implementation for the methods declared in the interface.
In Qi4j they do it without extending the language just by listing the interface in the implements section and declaring the class abstract. This has a drawback that the class may miss methods from some other interfaces which it is intended to implement.
Implementing and declaring an interface are different intents and, thus, a dedicated language feature is preferable, for example keyword declares

interface ILowerable<T t> {
T lower();
}

protected class MyRole declares ILowerable<MyBase> playedBy MyBase {
void bar() {
MyBase theBase = lower();
}
}


The typehole can be filled by the compiler, by a class loader (from a library) or by the user via providing a role that implements the declared interface. The latter would probably require deliberating role classes from the teams, but this is a different topic :)

To avoid possible name clashes, the interfaces used in declares may be required not to overlap.

Regards

Eugene
Re: An idea on enabling typehole model in OT/J [message #568823 is a reply to message #568737] Sun, 21 February 2010 21:31 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Hi Eugene,

I'm reluctant regarding this proposal for two reasons:

1) after version 0.8 every language designer is conservative

2) I don't see any necessity for the proposed change

We could easily agree that "declares" is somewhat nicer
than implements for these situations. OTOH, I have an excuse
for using implements: think of other interfaces like Serializable
or Remote, that also don't oblige the developer to add any
implementation but rather advise the compiler (or rmic) to add
specific infrastructure to the class thus marked.

OT/J is not developed on a green field. We try hard to play by
the rules of Java and these rules certainly suggest using
"implements" much more than adding another keyword
- the most expensive addition one can do to a language.

For feeling motivated for the proposed change I would need to
either see something really bad happening that can be avoided
by the change or something really cool being possible if and
only if we accept the change.

Do you have arguments towards either direction? I don't see
them.

Stephan

PS: Perhaps Qi4J would be more in need of this change than
OT/J is ;) (I understand the drawback in their case).
Re: An idea on enabling typehole model in OT/J [message #568850 is a reply to message #568823] Mon, 22 February 2010 09:08 Go to previous message
Eugene Hutorny is currently offline Eugene HutornyFriend
Messages: 110
Registered: January 2010
Senior Member
Hi Stephan,

Stephan Herrmann wrote on Sun, 21 February 2010 16:31
> ...
>
> For feeling motivated for the proposed change I would need to
> either see something really bad happening that can be avoided
> by the change or something really cool being possible if and
> only if we accept the change.


I'll try to find examples of really cool things possible with this feature :)

Cheers

Eugene
Previous Topic:An idea on enabling typehole model in OT/J
Next Topic:Fragile compilation for circularly referenced classes
Goto Forum:
  


Current Time: Tue Apr 23 07:00:05 GMT 2024

Powered by FUDForum. Page generated in 0.03526 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top