|
|
Page 1 of 13 articles
|
|
Java 7 - Property objects
Property syntax for Java 7 is the current discussion de jour. But I've been pointing out that we can go beyond get/set methods to create refactorable, compile checked property objects too.
|
Properties in Java? Hoorah!
Properties in Java? Awesome! As with any new language feature, there has been a lot of debate over whether this is an improvement to the language, or a detriment. And of course, every language-designer-wannabe (myself included!) is pounding the pulpit, declaring the One True Way to Property bliss. Well, sit back and enjoy as I pound the pulpit. Because seriously, I really do have the right solution! I promise!
|
Java Closures Missing the Point
I wish that just once, Java would lean more to its supposed SmallTalk roots than it does toward its C/C++ roots. If you didn‘t know, Java closures are specified here. My friends, a closure is not a type and it should never be treated that way. Ok, in Ruby a closure is implicitly converted to a Proc type so that it can be invoked properly in the implementing code. The person using the closure enabled method should not have to specify the type of closure they are dealing with. That is a bass ackwards C++ generics thought process and it makes a mess!
|
Property Support in Java, the Java Way™
Danny Coward , the JavaSE Platform Lead, has a PDF on his blog containing the slides from a talk he gave in Prague, late 2006. It doesn't give much away about the forthcoming proposal on the new property support but it does mention a new property keyword and an arrow operator. I've been told that Sun are in the midst of discussing this internally and I know that they will be happy to hear what you think should be added, and what you think should not be added. When the proposal from Sun is made public you know how hard it is to change and commenting early is our chance to really affect the outcome.
|
Closures for Java
Modern programming languages provide a mixture of primitives for composing programs. C#, Javascript, Ruby, Scala, and Smalltalk (to name just a few) have direct language support for function types and inline function-valued expression, called closures. A proposal for closures is working its way through the C++ standards committees as well. Function types provide a natural way to express some kinds of abstraction that are currently quite awkward to express in Java. For programming in the small, closures allow one to abstract an algorithm over a piece of code; that is, they allow one to more easily extract the common parts of two almost-identical pieces of code. For programming in the large, closures support APIs that express an algorithm abstracted over some computational aspect of the algorithm. We propose to add function types and closures to Java. We anticipate that the additional expressiveness of the language will simplify the use of existing APIs and enable new kinds of APIs that are currently too awkward to express using the best current idiom: interfaces and anonymous classes.
|
Closures In Java - 2
There's been some talk recently about adding closures to the Java language.
I've spent quite a bit of time writing Ruby code recently, and it's amazing how useful closures and code blocks can be. They're one of those things - once you know how to use them, you start noticing all kinds of places in your code that could be solved using closures. It's like when you learn a definition of a new word and suddenly you start hearing it in conversations everywhere.
|
Java Closures
Here's a nice item being proposed for Java 1.7: closures in Java. On behalf of all those people who actually do create entire classes just to be able to use map and other functional styles in Java, may I say, please, please, please put this in Java. (This seems a good place to link to Joel Spolsky's wonderful programming fable "Can Your Programming Language Do This").
|
Better Closures
As I mentioned earlier, a closure per se has a special nature which it does not share with other kinds of functions. A closure is produced from snippet of code, written in the midst of a larger block of code, in such a way that the meaning of names within the snippet are consistent with the enclosing block.
|
closure : Java Glossary
Closures are something like C callbacks, a pointer to a function that you can pass as a parameter. In addition to the method, some context around that method is snapshotted to go along with it in the closure. Java does not support closures.
|
How is Java (6.0 Mustang and Beyond) Going to be Different
Details about upcoming Java 6.0 a.k.a Mustang and even 7.0 Dolphin are slowly emerging. It seems that Sun has reacted to the demands of the open source community and it has changed the way how the future Java releases are going to be developed. Plus there are interesting things coming.
It seems that Mustang (6.0) will be feature release, and that Dolphin (7.0)
should be a step up release like the 5.0 was.
|
Tiger and Beyond, the Future of the Java Platform
With the launch of Java 2 Platform, Standard Edition 5.0, code- named "Tiger," we explored the innovations in J2SE 5.0 with Graham Hamilton, Sun Fellow in the Java Platform Team at Sun Microsystems. In Part Two of the interview, we asked him to provide a broader perspective on Tiger, Java 2 Platform, Standard Edition 6.0, Java 2 Platform, Standard Edition 7.0, and the long-term future of the Java platform.
|
|
Next>> |