Skip to main content

Happy Together

Posted by editor on March 6, 2008 at 5:48 AM PST


How superpackages will make sense of your Java 7 code

After an understandable delay -- author Elliotte Rusty Harold took a new job and moved across the country -- our Open Road series on the open-source development of Java 7 continues with a new feature article today. After a brief update on the current status of the OpenJDK project, Elliot dives right in with an introduction to a new feature intended for inclusion in JDK 7: Superpackages.

The problem that JSR 294 superpackages address is the fact that Java packages look hierarchical, but aren't. As Elliotte points out, "A class in java.util.zip has no more access to the internals of java.util.HashMap than does a class in org.apache.xerces." And this has turned out to be a significant problem for organizing classes:

Another common problem arises when writing unit tests. Test code often needs to see parts of a class that the general public isn't allowed to access. Sometimes test classes want to directly test non-public methods. Other times they want to inject dependencies. Usually you'd think test code belongs in a separate package. However, many programmers put their tests in the same package as the tested code precisely because they want to be able to access the non-public parts. Alternatively, some programmers make methods public just so they can be tested, even if that pollutes the published API. Neither approach feels especially palatable.

In our Feature Article, The Open Road: SuperPackages, Elliotte shows how JSR 294 will allow you to write a super-package.java file to explicitly indicate how you want to expose classes and even specific methods within your package.


We posted a major announcement from the Java 3D team in the forums section last week, but in case it got missed, we're using the Java Today section to again highlight the fact that the Java 3D team has announced the open source release of the j3d-core and vecmath subprojects on java.net under the GPLv2 license with the CLASSPATH exception. "This applies to all source code in the javax.media.j3d and javax.vecmath packages. You may notice that the web page and various README files now refer to the "3D Graphics API for the Java Platform" in many places. This is the official name for the open source version of the Java 3D API. Other than the name, there are no differences (and, in fact, we will build the binary version of Java 3D 1.5.2 from the same sources)."

MySQL, the popular open-source database, is now part of Sun's software portfolio. In a new screencast from NetBeans technology evangelist Roman Strobl, get a quick start to developing database driven applications with the NetBeans IDE using the MySQL database server. The demo goes through the steps of connecting to a database from NetBeans, using the MySQL editor to create tables, and exposing the tables in a desktop application and the data as web services.

A new SDN article by Eve Maler and Marina Sum looks at Federated Identity Through the Eyes of the Deployer, describing the problem, and the solutions provided by projects like OpenSSO. "Would you be interested in outsourcing a part of your identity management infrastructure--the authentication that begins user login sessions and even some user attribute data--to an external source? Conversely, would you be interested in exposing an interface to your user accounts for use by the applications that depend on that authentication and data? That's what federated identity is about: distributing identity information and tasks across security domains so that the parties involved can focus on the jobs they do best."


In today's Weblogs. Felipe Leme looks at
Spring, ICEFaces, and the dreaded thread-bound request issue.
"In this blog, I provide a quick solution for a nasty issue that arises when you use ICEFaces server-push technology combined with Spring/JSF integration."

Bhakti Mehta offers the tutorial blog
Developing Webservices from wsdl using Netbeans.
"The following blog shows how you can easily create a Webservices project in Netbeans from an existing wsdl."


kumarjayanti
tops today's Forums section with some GlassFish configuration help, in
Re: Configure keystore at runtime.
"When using WSIT on GlassFish (the DefaultCallbackHandler on GlassFish is used and it is based on the JSR 196 model), the need to specify the Keystore Location and Keystore Password and Keystore Type is eliminated. The Only thing one ever needs to specify in case of GlassFish is the alias information. So you can use the default JSR 196 CallbackHandler which knows where the keystore and truststore are located or else you can specify your own JSR 196 based CBH."

Chris Fleischmann points out GlassFish's enterprise-readiness in the reply
Re: GlassFish v2UR1 Ready for production use? "YES, I believe it is production ready... Wotif.com (an e-commerce hotel booking site in Australia) for example has over 10,000 concurrent sessions. See : http://blogs.sun.com/stories/ for other such stories. The performance results are also worth mentioning, have you seen the following spec.org postings? The GlassFish community as a whole is VERY active, bugs are fixed very fast, and forums are lively."

Finally, Glenn Holmer has a question about EJB naming in
Re: remote EJB best practices. "I noticed that when I asked NetBeans to generate session beans for my entity classes that he gave a warning about local and remote interfaces having the same names (even though he generated them that way). What's best practice on that? Do I have local and remote interfaces with different names, e.g. create() and createRemote() and have them both delegate to the same method in the implementing class? Is the warning because GlassFish might not know whether to call the local or either the remote interface?"


Current and upcoming Java
Events
:

Registered users can submit event listings for the href="http://www.java.net/events">java.net Events Page using our href="http://today.java.net/cs/user/create/e">events submission form.
All submissions go through an editorial review before being posted to the
site.


Archives and Subscriptions: This blog is delivered weekdays as
the Java
Today RSS feed
. Also, once this page is no longer featured as the
front page of java.net it will be
archived along with other past issues in the href="http://today.java.net/today/archive/">java.net Archive.

How superpackages will make sense of your Java 7 code