Java SE Language: Eadem Mutata Resurgo* Filed under:
javase7
Part of the reason working in the Java SE group is so interesting is
the diversity of the developers using the technology. As developers,
we're
writing a wide variety of applications in a wide variety of different
domains. Java SE may only be a part of the software stack we're
depending upon. Often we're working with Java SE within a Java servlet,
or EJB
container. Java language changes are of special interest to us in the
Java SE group, because wherever we are as a developer in the software
stack, additional features we add to the language make a different to
us all.
Curling the Chip
There was a story in The
Economist a few years ago about innovation. I hate to paraphrase
such a good article, but that grain of golden sand appears
to have crept to the deep. One of the points was to contrast
product innovation for new products and for established products. A
wholly new product has no customer base. No commitments or
expectations. The successful innovations tend to be big new ideas, or a
disruptive application of an old idea in a totally new setting. Like
the Sony Walkman
was. Innovation for established products is arguably more difficult:
you have customers who already like your product who you want to keep.
There are teams of people building, delivering and selling your product
that would be difficult or expensive to change. So your ability to
innovate is much more constrained. But the article gave the example of
a company making potato chips that were popular, but not popular
enough. Rather than invent some wholly new potato based snack, they put
a curl at the end of each chip. There was minimal disruption to their
production processes. Customers didn't notice anything new till they
opened the bag. There are two happy endings depending on your
perspective. One happy ending is that people loved them because they
could shovel more dip onto them. The other is that people loved
serving them because there was less spillage of dip after the party was
over. Either way, sales jumped dramatically.
Java SE Language Changes
So to some extent, with a successful technology like Java SE, good
things to look for on the horizon are the metaphorical curls in the
chip. Non-disruptive innovations that have widespread consequences.
Given that many Java developers are Java EE developers, its no wonder
that the use of annotations
has been such a big hit.
As Graham's
been explaining, that curl in the chip has scooped up a big
wobbling dollop
of complexity out of the EE deployment descriptors and programming
model.
Here's a selection some of the possibilities I've been thinking about.
Doubtless you recognize some of them.
Property support
This would be a language syntax to support short handing the variable foo, getFoo(), setFoo()
pattern. Definitely a pattern that is routine and dull to keep replicating by hand.
Method References
Writing and wiring event listeners is a frankly a bore. For example,
implementing and wiring a button to call the updateLastName()
method on your AddressBook
object when clicked gets old if you have to do that kind of
thing a lot.Wouldn't you prefer something like button.addDelegate(delegate
updateLastName) and get it over with ?
Block Closures
A block closure is a group of statements defined within the context
of...another group of statements. So block closures are statements
within a statement ! (A
Dream within a Dream. My entry found its theme.). Inner
classes are the poor man's version of this: they are hobbled because
the only thing they can do with local variables is read those that are
final (why
is that ?). Plus some people think they are plain ugly. Block
closures could be an enormously powerful way make code very compact.
But is there a syntax that pairs brevity with readability ?
Partial Classes
Unlike the esoteric predecessor, this is just the ability to deposit
the source code for a class in various different places, like separate
files. The most familiar usages are by tools that auto-generate parts
of a class for you, perhaps a GUI builder tool, leaving you to fill the
rest out in fear of the warning comments bespattered around the source
file. With a partial classes mechanism, the machine generated part
could live safely in one file, and the bit you work on in another.
Simple and tidy.
Finally
So I wonder which of these, or the many other potential language
changes could be the next curl
in the chip for Java SE 7 'Dolphin' ? And in particular, which could be
used by the Java EE platform with
powerful consequences ? And keep to our
principles ?
* So what's with the title this time ? Of course, Eadem Mutata Resurgo means "I shall
arise the same, though changed" which is relevant to the topic.
Plus my brother read my blog and gave me some typically fraternal
feedback
('excruciating' was one word he used :-) ). So the title is also his
college motto. You've got to throw the non-engineers a bone now and
again.
I would welcome each one of those changes to some extent, blocks being the most important. Your choice of words intrigues me though. You're a, say, tortilla chip maker that wants to introduce curls, too. These were "innovations" when Microsoft introduced them to the C# language; J2SE may choose to adopt them.
There is nothing bad in adopting other peoples' good ideas. It would appear in a much better light to acknowledge them, though. Netbeans 5 is a similar candidate. Literally hundreds of Sun blogs raved about how cool "new" features were and how Java development was taken to a new step. Few acknowledged were those features came from.
Posted by
Matthias
on April 15, 2006 at 02:00 AM PDT
#
Let me correct an obvious mistake of mine. Of course blocks and method references are no innovation on MS's side either.
Posted by
Matthias
on April 15, 2006 at 02:47 AM PDT
#
Yes. While an application of such concepts to the Java language would be something new and (I think) something worth talking about, I wouldn't want to present them as in themselves 'new' ideas. But that doesn't take away from the impact of the application of an idea to a new setting: one could argue that most innovations fall into that category.
Which can make attribution difficult :-)
Posted by
Danny Coward
on April 15, 2006 at 11:25 AM PDT
#
Heh. If C# had coloured keywords, it'd take only 5-10 years until Java would have them, too. ;)
Delegates were actually a J++ innovation, not a C# one. They been derided in the past by noone else than Sun themselves:
http://java.sun.com/docs/white/delegates.html
Afair, extending Java with features like delegates has been one of the major reasons why Sun dragged Microsoft to court, so it'd be pretty hillarious to see them get Sun's blessing.
cheers,
dalibor topic
Posted by
Dalibor Topic
on April 15, 2006 at 02:51 PM PDT
#
[Delegates] J++? Who obviously took them from Delphi (which probably took them from somewhere else, like Danny said, attribution can be difficult)
Ans let's not drag up the Sun vs MS case again, the case was clear, it's Sun calling the shots about Java not MS. Period.
Posted by
Tako Schotanus
on April 16, 2006 at 04:58 AM PDT
#
I would welcome each one of those changes to some extent, blocks being the most important. Your choice of words intrigues me though. You're a, say, tortilla chip maker that wants to introduce curls, too. These were "innovations" when Microsoft introduced them to the C# language; J2SE may choose to adopt them.
There is nothing bad in adopting other peoples' good ideas. It would appear in a much better light to acknowledge them, though. Netbeans 5 is a similar candidate. Literally hundreds of Sun blogs raved about how cool "new" features were and how Java development was taken to a new step. Few acknowledged were those features came from.
Posted by Matthias on April 15, 2006 at 02:00 AM PDT #
Posted by Matthias on April 15, 2006 at 02:47 AM PDT #
Posted by Danny Coward on April 15, 2006 at 11:25 AM PDT #
Posted by Dalibor Topic on April 15, 2006 at 02:51 PM PDT #
Posted by Tako Schotanus on April 16, 2006 at 04:58 AM PDT #