Jun 10 2007

Web 3.0 – This is the Semantic Web

This JavaOne 2007 BOF was about the coming web, deemed the Semantic Web. The way I would describe a semantic enabled site is to talk about microformats. You can use microformats to annotate a given snippet of HTML to describe the data contained in the HTML. For example, a typical site uses HTML to structure the data, CSS to style the page, but if you want to annotate and describe your data you can use a microformat and add additional attributes to the HTML tags. Simply speaking, you can use a microformat in a web page to describe the meaning and relationship of data. For example, blogs that have a blogroll can add XHTML Friends Network (XFN) data to links to describe the relationship to the link, whether they link to friends you met or coworkers. But instead of using HTML, the Semantic Web is based on Resource Description Framework (RDF). And instead of using XFN, you use Friend of a Friend (FOAF) to describe human relationships. RDF is a way to meaningfully describe your data.

Another format like FOAF is the Description of a Project (DOAP). DOAP is used to describe an Open Source projects with a name, description, SVN info, etc. so that this information can be crawled, indexed, scrapped, and later successfully searched. RDF, like XML, is open in such a away that you can define your own ontologies, and there are many existing ones that will be standardized. Competing ontologies will be naturally selected and standardized by the community. Another interesting RDF format is Beatle, bug and enhancement tracking language.

The speaker started the session by describing a timeline of recent modern computing. He narrowed the PC Era to the desktop of the ’80s, the Web 1.0 was the original World Wide Web of the 90’s, he described the Web 2.0 as the Social Web we currently live in, Web 3.0 will be the Data Web or Semantic Web, and Web 4.0 which is slated for 2020 will be the NetOS or Intelligent Web. In terms of search, he stated that we started Web 1.0 with natural language search, we will soon move to semantic search, then associative search, simple reasoning, and finally to intelligent agents in the Web 4.0.

The speaker said that the Semantic Web, and RDF, can be used to search, archive, and retrieve online content in new ways. He said that the open web would be treated like a massive distributed database. The web is made up of data and RDF can define your data into a database that can be located, reference, and related to other data with URLs.

The speaker also touched on the growing number of semantic tools, a large portion of which are written in Java. The speaker spoke of RDF databases and repositories and SPARQL, a SQL-like query language to search RDF repositories.

Technorati Tags: , , , , , ,


Jun 9 2007

Write a 3D Game in Java

The complete name for this JavaOne 2007 technical session was Write a 3D Game in the Java Programming Language in Less than 50 Minutes. This was not a hands on session but instead Erick Hellman spoke on his experience writing a 3D game in Java. In full disclosure Erik informed those present that he never before written a game, has basic knowledge of OpenGL, lacks artistic talent, and suffers from color blindness. He said, “I need a ruler to draw a stick figure,” but he reassured the audience that a ruler wasn’t required because game development is made simple in Java.

Erik presented a basic recipe for game development. The recommended tools of the trade include Blender for 3D modeling, Gimp for image manipulation, JOGL for OpenGL bindings, JInput for game control, Vectmath for Java 3D coordinates, and XMLBeans for loading and persistent the models.

The architecure of the game revolves around the scene graph. The scene graph is the core of modern games and everything builds around it. He also briefly touched on the core mathematical concepts of 3D graphics, which are matrix transformations such as rotate, scale, and translate. For those that didn’t do well in linear algebra, or don’t even know what that is, the speaker say that OpenGL abstracts most of these details and that what a game developer is concerned with is the graphics pipeline.

Erik also mentioned some good 3D model formats. Lightwave, 3D Studio Max is a closed formats but he also recommended Collada and X3D as open format alternatives. The speaker also described a bit the ideas and algorithms used for collision detection. The technique he used is to enclose the character in a virtual, invisbile, bounding box. Elements of the game, such as barriers, need to be outside ot the avatars bounding box. He also listed some common issues when developing a multiplayer game. These issues include latency, pocket loss, and cheating.

In summary, Erik listed the key components for a simple game. He assumed the audience that with a scene graph, model, navigation, and collision detection any one there could in fact write a 3D game in 50 minutes. Talk about rapid game development!

Technorati Tags: , , , ,


Jun 9 2007

Beans Binding

In this aptly named technical session, Shannon Hickey and Hans Muller tag teamed to talked about the current state of JSR 295: Beans Binding. Right off the bat, Shannon said that the Beans Binding implementation is far from final and if any body has any thoughts on how beans binding should be done Shannon suggested they participate in the discussion.

The Beans Binding JSR intends to replace the property change and action listeners which litter Swing applications. In essence as Shannon described Beans Binding “keeps two properties in two objects in sync.” Beans Binding also has support for objects that don’t adhere to the bean pattern, such as collections. Beans Binding also has the ability and added value that it can convert and validate values of as it sync and binds them to the target object.

The end goal of Beans Binding is to make it trivial to bind an application model to a Swing UI component.

Technorati Tags: , , , , ,


Jun 9 2007

Why Spaghetti is Not Tasty

Jasper Potts, Sun, gave an insightful presentation at JavaOne 2007 on Why Spaghetti is Not Tasty: Architecting Full-Scale Swing Apps. Jasper started the technical session by describing the first typical architecture for a Swing application. The typical first architecture is to pass everything to everybody. The second level of abstraction in a Swing architecture is to use a singleton object that functions as the application’s service/resource finder/locator which provides lookup methods for an implementation of a given interface. For large applications, Jasper recommends using a framework and he recommends Spar. Spar is a Swing Rich Client Platform framework written by Jasper and based on his research on best practices. As Jasper described, Spar is aimed for applications with over 50K lines of code.

Jasper also talked about software modularity, of breaking up an application down into manageable chunks. Classes, packages, and libraries provide modularity in Java but Jasper, and many other people here at JavaOne, is talking about allowing for modular plugins for extending a given application. such as Eclipse’s plugins of NetBeans’ modules. There are currently a few specification regarding modularity such as OSGi and JSR 291: Dynamic Component Support for Java SE. Jasper recommended several implementations, in particularly Eclipse Equinox and Knopflerfish. Additional JSRs along these lines also include JSR 277: Java Module System and JSR 294: Improve Modularity Support in Java. These JSRs intend to provide a superpackage modular system at the language level. A module helps to separate public API from its implementation, not every class should be visible to the whole application and the visibility identifier can only do so much.

Jasper also made another recommendation that would clean up your code from inner classes. As described by Jasper, a typical Swing application uses the communication pattern typically used by listener classes, which inevitable produce huge interconnections across the whole application and a ton of inner classes littered in the source code. The solution solution recommended by Jasper is to use a message bus for Swing events. This allows the developer to set message rate limit.

The key advice given from Jasper is to break up an application into modules, limit direct coupling, and employ best practices such as plugins, IoC, and event message bus frameworks for developing your next Swing application.

Technorati Tags: , , , , , , , ,


Jun 8 2007

JavaFX Script

This JavaOne 2007 session was originally titled Form Follows Function (F3), after the code name for what was marketed as JavaFX Script. JavaFX Script (JFX) has been one of the most hyped up technology announcements here at JavaOne. According to the marketing literature from Sun, JavaFX Script is a “highly productive scripting language that enables content developer to leverage blah blah …” What Sun PR means to say is that JavaFX Script is Sun’s too little and perhaps too late response to Microsoft Silverlight and Adobe Flex/Flash.

In a eat your own dog food sort of demo, Chris Oliver presented his presentation slides on a PDF viewer application he created using JFX. The PDF viewer demo had great zoom support and even thumbnails of the PDF documents with reflection. JavaFX Script have me at hello, world.

As Chris described, he started working on what eventually became JFX because he wanted to provide an answer to the following set of questions, Why does it take so long to write GUI applications? How do you avoid the “Ugly Java GUI” stereotype? Why is it easier to write a web application than a Swing application? Why don’t Swing programmers use fancy images, graphics, effects, and animations like the Web 2.0 designers?

JavaFX Script is a new programming language that runs on the Java VM. JFX is an object-oriented language with declarative syntax, data binding, and statically type with type inference. JFX allows for custom painting, transformation, grouping, transparencies, effects, clippings and animation. JFX allows you to read and write images. It seemed to me that SVG can do just about the same thing that JavaFX Script intends to do. JavaFX also reminded me of what the Processing project.

As mentioned SVG, Silverlight, OpenLazlo, and Flex provide similar functionality and effects but they introduce a mix of XML-based markup and some degenerate scripting language. SVG is declarative like JFX but Chris doesn’t like the JavaScript/DOM programming model. Chris stated that he rather use a real programming language and a programming model that software engineers understand. The folks behind JFX intend to provide full language support such as refactoring, code completion, code search, code high lighting in NetBeans. In addition to static type efficient compilation JFX provides compile time error and warnings.

Technorati Tags: , , , , , ,


Jun 5 2007

Technical Overview of GlassFish v2

This was the third and last JavaOne 2007 session that I attended that dealt about the GlassFish Application Server. This was a technical overview of what’s new the latest release of GlassFish. The new features in v2 include clustering support, high availability (five nines or that is 99.999), memory replication, and Java business integration just to name a few.

Just as a community service announcement, if you attend a technical session and the speaker starts off by saying, “I have been heads down on this feature…” you should walk out. Anybody that is head down for a year on some feature will surely bore you to death if you ask him about it, even if just in passing. Well this guy I am talking about went into how GlassFish uses JXTA, peer-to-peer technology, to achieve memory replication.

The latest release of GlassFish also has a server usage profiling tool, new administration console, performance enhancements, lazy loading of providers/containers such as EJB, JMS, and HTTP. It is makes good use of the Grizzly project.

Technorati Tags: , , , ,