Hyphen usage in package names

myfear | Sep 6, 2010 03:07 +0000
As always, the simple things in live make everything complicated. A co-worker came up with this and I would like to answer the question and point you to some additional links.
Do we have a prefered way about our Java package names? Do we use the short:
- de.xxxx.* or the long form
- com.xxxx-xxxx.* ?

The technical answer
Trivial? Not necessarily. The actuall question is hidden. If you simply look at the semantics you would tend to choose the "short form" (the de.xxx). But let's look at the syntactic first.
The true question is: Does the Java Language Specification (jls) allows hyphen (dashes) in package names? A quick look into 7.7 Unique Package Names tells us the following about package names in general
You form a unique package name by first having (or belonging to an organization that has) an Internet domain name, such as sun.com. You then reverse this name, component by component, to obtain, in this example, com.sun, and use this as a prefix for your package names, using a convention developed within your organization to further administer package names.
[...}
If the domain name contains a hyphen, or any other special character not allowed in an identifier (§3.8), convert it into an underscore.
(Source: jls, 3rd edition)
Now you have to look at 3.8 Identifiers to find out about "special characters".
An identifier is an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter.
[...]
The Java letters include uppercase and lowercase ASCII Latin letters A-Z (\u0041-\u005a), and a-z (\u0061-\u007a), and, for historical reasons, the ASCII underscore (_, or \u005f) and dollar sign ($, or \u0024).
You are right, the simple answer is: You are NOT allowed to use the hypen in package names. If you have a unique package name build from a domainname containing a hyphen you have to translate it to the underscore.

For the above example this will look like:
- com.xxxx_xxxx.*

The developer answer
Reading all this stuff, this somehow feels outdated. If you look at the massive amount of registered domain names it is most likely that the hyphen will more and more become a part of our namespace. Even if it technically does not make a big difference if you use a "-" or a "_" there are some more considerations:
- You have to hit an additional key "shift" if you want to access the hyphen.
- It simply does not correspond with the domain name.
- It looks like a typo.
- The _ has to be "translated" to get the real domain name

Related to the concrete question there are some more conciderations:
- The de.xxx obviously is shorter
- The com.xxx sounds more international

The answer to the question is: Use the de.xxxx! It is shorter and correct. If any of the marketing guys is forcing you to pick the second option: resist! It is longer, makes developing harder and simply does not feel right. At last to me.
You have your own thoughts about this. Glad to hear it.

New German Java magazin – Java Aktuell available!

myfear | Sep 3, 2010 04:35 +0000
It's here! The new magazin (Java Aktuell) from the german iJUG (Interessenverbund der Java User Groups e.V.).
The iJUG was foundet right after the Sun/Oracle merger. Some of the most powerfull German Java User Groups (JUG) and the German Oracle Users Group (DOAG) decided to establish the new association of the Java User Groups e.V. (iJUG). The new magazin is the quarterly voice of the iJUG. More (german) information can be found on the iJUG website.

It is my pleasure to contribute a short article (in german) about "Oracle and the Future of Java".

See me, live! DOAG Special Interest Group Java, 09.09.10, Munich

myfear | Sep 2, 2010 03:36 +0000
Short notice: If you like to meet me and the following speakers:
Ralph Soika (IMIXS GmbH), Michael Bräuer (Oracle), Frank Schwarz (buschmais GbR), Kai Wähner (MaibornWolff et al GmbH)and Adam Bien,
you are invited to register at the DOAG SIG Java - Java Enterprise Edition 6 which will happen at 09.09.10 in the Victor's Residenz-Hotel Munich.
This is a german speaking event. Find more details at the DOAG event page.

Mobile GlassFish Admin GUI with HTML 5 and the iPad

myfear | Sep 1, 2010 00:28 +0000
You know, that I am "playing" around with the iPad recently. One part of the game is to look for suitable UI frameworks that assist you building modern "native looking" webapps for the iPad. There are some promissing approaches out there and the one that is most complete and best looking is Sencha Touch. Sencha Touch allows you to develop web apps that look and feel native on WebKit based browsers and touchscreen devices.
I will probably blog about the more technical findings I had working with some of the mentioned frameworks but this post is dedicated to a concrete usecase for mobile UIs. If you have read my iPad for Business? posts (part 1 | part 2) you already know, that the device is hot and nearly every company is designing their personal mobile usecase. But what about product UIs?
Have you seen any of the mature Java application server admin UIs thinking about or doing prototyping on this? Neither did I. But why not? Is this not needed?
Here is how a mobile UI for the latest GlassFish could look like. For now this is only a simple UI prototype without any further functionality, designed to make you want it :) The native gesture driven approach for touch devices would optimize the usability a lot. But beside this basic benefit you could also think about other szenarios. The following represent what I might find usefull.

Admins in datacenters
I could image admins walking around in the datacenter and connecting their mobiles to the server instance they are standing in front of. This could save time for walking to the next terminal or even be good for the health because they do no longer need to carry their heavy notebooks around.

Load test specialists
Load and stress tests typically run for longer times. Very often they have to run outside of the normal office hours. The mobile UI gives a very lightweight access to all relevant domain data that could be of interest to those people.

Developers
And last but not least for the developers. They could grap one of those fancy desktop stands and have their admin UI always on beside their screen. This could speed up development if you do not have to switch windows.


If you have comments, ideas, other cases, let me know. I would love to see a mobile UI version in one of the next GF or even the WLS ;)

Bloggers Meetup @ Oracle OpenWorld 2010 by Alex Gorbachev

myfear | Aug 28, 2010 03:26 +0000
Alex Gorbachev (CTO) at Pythian announced the anual Bloggers Meetup yesterday.
We all know that Oracle community has grown this year so we expect to see folks from all the different technologies including MySQL, Java, Sun hardware folks in addition to the core Oracle database and apps crowd.
(Source: Alex, Pythian)

It will be Wed, 22-Sep-2010, 5:30pm at Lower Dining Room, Jillian’s Billiards @ Metreon, 101 Fourth Street, San Francisco, CA 94103.

More details (maps, streetview) can be found on the event page at pythian.com.

Count me in, Alex! Great opportunity. Was big fun last year. And I will take some pictures this time ;)

Packt launch fifth annual Open Source Awards

myfear | Aug 27, 2010 08:38 +0000
The 2010 Open Source Awards was launched by Packt, inviting people to submit nominations for their favorite Open Source project. Now in its fifth year, the Award has been adapted from the established Open Source CMS Award with the wider aim of encouraging, supporting, recognizing and rewarding all Open Source projects.

WordPress won the 2009 Open Source Content Management System (CMS) Award in what was a very close contest with MODx and SilverStripe. While MODx was the first runner up, SilverStripe, a Most Promising CMS Award winner in 2008, made its way to the second runner up position in its first year in the Open Source CMS Award final.

The 2010 Award will feature a prize fund of $24,000 with several new categories introduced. While the Open Source CMS Award category will continue to recognize the best content management system, Packt is introducing categories for the Most Promising Open Source Project, Open Source E-Commerce Applications, Open Source JavaScript Libraries and Open Source Graphics Software.

CMSes that won the Overall CMS Award in previous years will continue to compete against one another in the Hall of Fame CMS category.

These new categories will ensure that the Open Source Awards is the ultimate platform to recognise excellence within the community while supporting projects both new and old. “We believe that the adaption of the Award and the new categories will provide a new level of accessibility, with the Award recognizing a wider range of Open Source projects; both previous winners while at the same time, encouraging new projects” said Julian Copes, organizer of this year’s Awards.

Packt has opened up nominations for people to submit their favorite Open Source projects for each category at www.packtpub.com/open-source-awards-home . The top five in each category will go through to the final, which begins in the last week of September. For more information on the categories, please visit Packt’s website www.PacktPub.com/blog/packt’s-2010-open-source-awards-announcement