The Source for Java Technology Collaboration
User: Password:



Janice J. Heiss's Blog

Community: JavaDesktop Archives


QA with Java Champion, Cay Horstmann

Posted by hiheiss on February 22, 2008 at 06:11 PM | Permalink | Comments (2)

Check out my interview with Java Champion Cay Horstmann on java.sun.com if you want to know:

* Why it never pays to optimize code until after you profile.

* What's wrong with the JavaServer Faces library implementers, and the app server implementers

* Where JSF programmers go wrong.

* The problem with threads.

* The case for closures.

* The biggest mistakes computer science teachers make.

* Why we have too many scripting languages.

He's provocative and fun! Tell me what you think, please.



Java Finalization's Memory-Retention Issues

Posted by hiheiss on September 17, 2007 at 02:46 PM | Permalink | Comments (1)

I recommend taking a look at "How to Handle Java Finalization's Memory-Retention Issues," by Sun's Tony Printezis on java.sun.com.

Finalization allows you to perform postmortem cleanup on objects that the garbage collector has found to be unreachable. It's normally used to reclaim native resources associated with an object. Tony describes how finalization is implemented in a JVM; he identifies problems where memory can be unnecessarily
retained by finalizable objects, and offers solutions, plus advice on when and when not to use finalization.

If the topic intrigues you, check it out.



Open Source --- Then and Now

Posted by hiheiss on July 18, 2007 at 03:34 PM | Permalink | Comments (1)

I'd be curious what you think of this java.sun.com interview I did with Ray Gans titled "Open Source -- Then and Now: A Conversation With Ray Gans of the OpenJDK Community Program". Ray's been about as close to Sun's open source process as anyone over the years and has a long history working with Java compatibility and now manages the OpenJDK and Mobile and Embedded community programs. I found his perspectives interesting with regard to the evolution of open source at Sun, the challenges currently faced, the surprises, and where it is all headed. What do you think?

The Bug Story

Posted by hiheiss on April 18, 2007 at 11:59 AM | Permalink | Comments (0)

Brian Harry, a.k.a. the "bug guy," talks at length about bugs in a java.sun.com article by yours truly, Getting the Bugs Out: A Conversation With Bug Fixer Brian Harry. Harry, winner of a Duke's Choice Award, fixed Java SE 6 bugs numbering into the hundreds. His method: he scanned Sun's openly available bug database for intriguing bugs, primarily in the Swing user interface code, printed them out, and put the bug reports on a stack beside his computer. Then, he fixed them one by one, submitting them through the standard JDK Community contribution process.

The interview gives the details:

* He points out that fixing bugs is a great way to understand
how the code works. To James Gosling's bug rule, “If you don't
see the bug where you're looking, perhaps you're looking in the
wrong place.” Brian adds: "The place where you find bugs may not
be the right place to put a fix in".

* His basic advice: “First, always acquire the test that’s attached
to the bug report... Next, ask yourself if it’s really a bug... Also,
consider writing different solutions... As to writing unit tests, look
at what the patched code interacts with.”

* Swing tip 1: "Try to be comprehensive in testing the patch with different
LAFs (Look and Feels)."

* Swing tip 2: "Make sure that the test case is running on the EDT
(event dispatch thread). If it isn't, you may not have a bug, but
instead just have bad programming."

* "If you’re doing a Java code fix, don't just look at the current version of
the platform. I’ve routinely tested out bug tests on 4, 5, and 6 to investigate
when a problem started and stopped. See if you can find why something started."

IMHO, there's lots more of value. Have a look please and tell me what you think...



Java Platform Migration Map

Posted by hiheiss on November 01, 2006 at 05:02 PM | Permalink | Comments (0)

Here's a recent java.sun.com interview , "Step up the Java Technology Ladder: A Conversation With Sun's Director of Product Marketing for the Java SE Platform, Jean Elliott", that I did with Jean Elliott, Sun's Director of Product Marketing for the Java SE Platform. Jean gives us a tour through the Java SE platform, including Java SE Real-Time and Embedded technologies, and looks ahead a bit. It's a good resource interview for anyone who wants an overview of the platform, with lots of links to blogs and other sources of information, if I do say so myself. :)

Q&A with a client architect for the Swing Toolkit Team at Sun Microsystems

Posted by hiheiss on October 30, 2006 at 10:51 AM | Permalink | Comments (1)

There's a QA on java.sun.com by yours truly, an interview with Scott Violet, client architect for the Swing toolkit team. Please drop by at: Meet Scott Violet, Architect for the Swing Toolkit Team at Sun Microsystems. Scott discusses Java technology on the desktop, new developments in Swing, JSRs 295 and 296, and the NetBeans GUI Builder. He presents code for blurring an image and discusses inspiration for developing content -- which is much more challenging than the coding itself. He also shares an amusing repeat experience: when he wears a tee-shirt with a Java logo, people keep asking him what his favorite coffee is. I guess it's all part of being a Java developer...

Meet Shannon Hickey, Technical Lead for the Swing Toolkit Team at Sun Microsystems

Posted by hiheiss on September 27, 2006 at 05:39 PM | Permalink | Comments (0)

Have a look at my latest "Meet the Engineer" Q&A, Meet Shannon Hickey, Technical Lead for the Swing Toolkit Team at Sun Microsystems with java.net blogger Shannon Hickey, technical lead for the Swing toolkit team at Sun, who currently specializes in Swing drag and drop. After meeting with a customer and realizing that Swing drag and drop was not what it should be, he made it his mission to improve it.

He talks about the compatibility API, anticipated in Java Platform Standard Edition 7, that would free developers from the constraints of backward compatibility, his enthusiasm for Josh Bloch's Effective Java, the process by which he designs APIs, and much more.

New article on java.sun.com on MXBeans

Posted by hiheiss on September 12, 2006 at 03:25 PM | Permalink | Comments (0)

Please take a look at, "MXBeans: Bundling Values Without Special JMX Client Configurations" on java.sun.com. I lent Sun's Eamonn McManus a hand with the writing. (What a terrific guy to work with!) It's about an important new feature of the JMX API in Java Standard Edition 6 (JSE 6), namely, its ability to create MXBeans, a substantial improvement over MBeans, which provide a convenient way to bundle related values without requiring special client configurations to handle the bundles.

Meet the Engineer QA on java.sun.com

Posted by hiheiss on August 25, 2006 at 11:54 AM | Permalink | Comments (0)

Please check out my latest "Meet the Engineer" Q&A, Meet Tom Ball, Senior Staff Engineer at Sun Microsystems with java.net blogger, Tom Ball, who works on Java language tools.

Tom goes way back: he joined the JDK team when the Java language was still called "Oak," created the first debugger API, and helped with the AWT for the 1.0 release.

He currently works on the Jackpot Project, a technology used for searching Java source code and safely and correctly transforming patterns in code, while writing minimal changes back to source. Jackpot’s "engine" is fully accessible, so it’s easy to write your own queries and refactorings.

His tip for writing code: "Write boring code whenever possible. Code that is so obvious it doesn't need comments and which other developers who thrive on cleverness will ignore and dismiss. Write code that only does one thing, but does it really well, so you can write it and forget about it while it quietly works in the background."

Is there anyone who "thrives on cleverness" who's ready to "dismiss" this idea? Is the best code, code that works quietly in the background or is it "clever" code that grabs your attention? Or is this the wrong way of approaching the topic? Any takers?



Meet Josh Marinacci of the Swing Toolkit Team at Sun Microsystems

Posted by hiheiss on August 02, 2006 at 03:07 PM | Permalink | Comments (0)

Please check out the front page of java.sun.com for a
"Meet the Engineer" Q&A, Meet Josh Marinacci of the Swing Toolkit Team at Sun Microsystems, I did with java.net blogger, Josh Marinacci.

Josh has made news recently with the publication of O'Reilly's Swing Hacks: Tips and Tools for Killer GUIs
which he co-authored with Chris Adamson. In the interview, he gives some of his favorite hacks
for Swing such as the Glass Pane component that sits on top application components and was used to
build many of the hacks in his book. He likens it to "a sheet of glass stretched across the top of your JFrames". It's his favorite tool for building cool hacks.

The core of this hack is the paintComponent() method of the component he installed as the glass pane with frame.setGlassPane(myMagComponent) which we've included in the article. (I wanted to include it here but I can't get the code to display correctly so next time folks, and my apologies.)

Check out the interview for more details and of course let me know what you think.



Dancing While Gaming – Multitasking VMs on Real Devices

Posted by hiheiss on May 19, 2006 at 08:35 PM | Permalink | Comments (2)

The JavaOne session, “Dancing While Gaming – Multitasking VMs on Real Devices”, focused on helping developers gain a wider and deeper understanding of the Multitasking VM implementation on real devices based on the interaction between Sun and Samsung who are engaged in a joint collaboration through the work of Jae Hyou Lee of Samsung Electronics and Yaniv Shani of Sun.

MVM deployment is based on the Sun JWC1.1.3 (Java Wireless Client 1.1.3) which comes with multi-tasking capabilities. The MVM deploys most of the MSA (Mobile Service Architecture) JSRs. It has been tested with hundreds of games and applications from leading content providers.

So what is MVM? The Multi-Tasking Virtual Machine is a technology that allows the end-user to execute multiple Java applications simultaneously. MVM enables preferred and rich applications like MP3 playing, Instant Messaging and mail clients. Users of MVM want to run multiple Java applications simultaneously and want to be able to switch applications very rapidly. The typical MVM player might be a teenager who loves to listen to MP3 players, chat with friends over the Net, and play video games simultaneously. Multi-tasking capabilities enable all these activities to be conducted on the same device at the same time.

The Isolation Model

To execute multiple applications, the isolation model was introduced in the VM. Each application runs in its own logical Virtual Machine environment, called an isolate. Within the JVM, each isolate is represented as a task. A task consists of one or more Java threads of execution. All tasks execute in the same single OS task context. All tasks share constant data structure and runtime support functions. Each task encapsulates non-sharable program state MVM.

“In the CLCD space, we would like to address limited operating systems that lack native process modeling support,” said Shani. “This is the main reason why in the CLCD space, the VM implementation conducts both the Java task and Java thread scheduling internally within the VM.”

Implementation Details

Each task has a separate, private copy of the static variables of all the loaded Java classes. Static variables are only global to all threads within a particular task. Each task maintains a private copy of ‘count’. The Class representation is shared. Synchronization has to be task private. Threads in one task cannot block threads in another task. Blocking threads across tasks isn’t allowed.

Resource Management

The low-level part of the VM is responsible for all CPU time and memory resources in order to ensure that all tasks get their “fair” share. Other resources, such as network bandwidth and communication ports are managed by the profile layer.

Resource Management – Scheduling

Tasks and threads are scheduled internally by the JVM. Fair scheduling algorithm is used for task scheduling in order to prevent one task from taking disproportionate CPU time and causing other tasks to stop. The ‘isolate’ class offers a set of APIs to modify the priority levels for each task. In most cases MIDlets that execute in the foreground get to have more CPU cycles compared to others that run in the background.

Resource Management – Memory

The VM requires a large consecutive memory block from the underlying OS. Allocations for all tasks are made from this same global heap region. The VM has a bookkeeping mechanism that accounts for each task’s total heap memory consumption. The VM injects OutOfMemoryError as needed to inform tasks that heap space has become scarce.

The Profile Level

The presentation turned to what must be done at the profile level to transform their implementation into one capable of multi-tasking. They have been using Sun’s latest JWC1.1.3, which comes with multi-tasking capabilities. It allows only a single MIDlet to execute in the foreground at a certain time.

A MIDlet application is said to be in the foreground when:

-- Its displayable controls the display.
-- It handles events from the user input mechanism since they are automatically routed to it.

An application is in the background when:

-- Its displayable does not control the display.
-- It does not handle the user input mechanism.
-- Zero or more MIDlets can execute in the Background
at a time.

The application manager is critical for task switching. They use a resident Java MIDlet for the application manager; it is launched in the background when the device ends its boot phase. When users switch it to the foreground, they see a list of all running applications and can switch between them quickly. The app manager also displays background MIDlet alerts, when one wants to drive the user intention.

They next displayed some demos showing how to switch MIDlets to the background and switching between MIDlet states.

Switching a MIDlet to the Background

A short ‘hot’ key press is used for switching between running apps.
Upon a short ‘hot' key press the foreground MIDlet will be
placed in the background and the main device menu will be
displayed on the screen.

Upon a long ‘Hot’ key press the foreground MIDlet will be
placed in the background and the ‘Application manager’ will
be displayed on the screen. The user can see the list of running apps and can switch to another app.

Upon calling setCurrent(null) the MIDlet will be placed in the
background and the ‘idle’ screen of the device will be
displayed. This enables MIDlets to place themselves in the background.

Interrupting the User

A demo of a user experience focused on ways to interrupt the user when a background MIDlet wants to drive the user’s attention.

-- Background MIDlet calls Display.setCurrent(alert)
-- Background MIDlet tries to access a protected API and a security dialog is prompted.
-- Noteworthy event occurred in the background, e.g., Incoming IM while playing a game.


Managing Resources

The session turned to resource management. In a single-tasking environment, the MIDlet has access to all of the available resources. In a multitasking environment, MIDlets have to compete for available resources

Resource management mechanisms include:

Reservation -- A reservation mechanism sets aside a certain amount of a resource for a MIDlet and keeps it available for that MIDlet and that MIDlet alone

Quota -- A quota mechanism permits a MIDlet to allocate up to a
certain amount of a resource. If the MIDlet attempts to allocate more resources than its quota, the attempt fails, even if resources are actually available on the system.

Revocation -- The system can revoke a resource from a MIDlet and give it to another MIDlet. Resource revocation examples include CPU cycles, display access, and audio playback. Resource revocation doesn’t always have a dramatic effect on
the MIDlet’s execution

The session went on to cover LCD display, and sound issues and offered guidelines for resource policy selection. The key points were:

-- Resource policy definition relies on the underlying platform
capabilities and requirements.

-- A fixed partition policy should be used for fundamental resources that are required by the majority of the applications.

-- An open policy should be used for resources that are used by
specific MIDlets and have limited availability (e.g. Bluetooth, Location).

-- The Display and Sound requires special handling.


Multitasking Safety

Regarding safety, the native JVM task can run native code for any task, hence the code must be made aware of the task on whose behalf it is being called and possibly allocating resources. When the task context is established, the code is considered multitasking safe. Sun’s JWC software is multitasking safe.

The session closed with an exploration of such topics as static and global variables, issues of native code execution, MIDlet guidelines, and basic resource awareness principles.

The take-home message from my perspective is that MVM technology fits nicely with what is happening, for better or worse, not only in youth culture in the US and much of the world, but among older generations. We are living speeded up lives and engage in multi-tasking, out of both necessity and pleasure and we want to be able to do it comfortably and quickly from the same device.

“Dancing while gaming” is here to stay and Sun and Samsung are on to something. More power to them.




Where the Software Met the Road

Posted by hiheiss on May 19, 2006 at 03:53 PM | Permalink | Comments (0)

It's day two of JavaOne '06, and I’m over at the Slot Car Racing Programming Challenge area, where the track is heating up. Developers are standing in line, some for the 20th or 30th time! to see if their latest tweaks will pan out as they hoped. A lot has been happening here. The ABC Morning News guys were here with their cameras. Developers are taken with the chance of being onstage with James Gosling and spending some time with him. Gosling himself has been trying out the slot cars off and on for a few days. Some contestants admit that the slot car race brings them back to their childhood. Developer aren’t exactly closet game junkies.

I approach one, who asked to be referred to as “Turtle,” and ask him if this is harder than he expected.

“It’s very difficult,” says Turtle. (Yes, the name gives away something about his times.) “I have no experience with real-time. There is a lot of tuning, a lot of unknown variables – every car runs a little different. So even if you tweak it right for one car, it may not work for the next. This is about my 15th attempt and I’ve missed two sessions already.” (I’m beginning to understand why he doesn’t want his real name used.) “I’m getting better each time, and finally made it into turn three.”

When I ask him how this is affecting him he says he wants to build a race track in his home. “This is a lot of fun. Once your car runs, the times are posted for your machine and you can figure out how fast your car is going at each sensor point. You could copy and paste this if you wanted, but it would be preferable if they gave you all of your races together so you could analyze all of the numbers.”

Turtle informs me that the man standing next to him is tied for the lead. His name is Peter Whitfield.

“I’m probably the worst Java programmer here – I’m more of a manager than a programmer,” admits Whitfield. “It will be embarrassing if anyone looks at my code. I have no experience with real-time Java, though 20 years ago, I worked with real-time systems. This is a lot of fun and a good opportunity to see how the real-time Java stuff works. It’s easy.” Different strokes for different folks.

Peter -- who is quite generous with his time as he keeps eyeing the monitor above the track listing the names of who's in the lead along with who is currently racing -- completed the race in 25.49 seconds somewhere around his 20th trial and estimates that maybe 10 or 12 people out of 100 have made it to the finish line without crashing. Clearly the hardest thing is just making it around the track. I ask him the secret to his success.

“Keep it simple -- do the absolute minimum necessary to get the result,” Whitfield explains. “There are guys doing some very sophisticated algorithms but I have not actually modified the sample algorithm at all, I’ve just been changing the parameters. Nothing in this application has been hard. I have an engineering background rather than a pure software development background and this is about manipulating voltages to control the speed, and that’s second nature to me. So my background helps. I have only now started changing the way the real-time stuff works. Until now, I’ve only changed the parameters of the way the speed changes as it goes around the track, so a lot if it involves trying to figure out how, if I change the voltage in one place, it affects the speed in another. That’s what people are missing -- they don’t understand how if they go too fast in one part of the track, it will make the car unstable later. The Java side of it is very easy to pick up because we are given a sample program. We have not had to set up the framework for it. Real-time programming is about understanding physical systems; it's not as abstract as writing UI software. So you need to understand the physics of what you are trying to do and the timing.”

I ask if he spends a lot of time visually contemplating the track. “Absolutely – I stare at the track trying to understand where things happen. It’s a spatial thing and physical thing. I can run the same program 10 times and get different results each time. There are 5 different cars that all perform differently. We don’t know which car they will run, so we can’t tune it for a specific car. The challenge is to write software that is in tune with the reality of what you are trying to make happen.”

Peter went on to say: “I learned that I don’t program in Java often enough, so I hope people aren’t looking over my shoulder when I look up Google to figure out how I do multi-dimensional arrays. You need to be aware of where you are putting your thread to sleep and where it will wake up and if you are doing it in more than one place you need to think of the different permutations and where it can all happen.”

And what else is Peter doing at JavaOne?.. “I’ve spent way too much time here. I don’t have a boss so I can sit here and just have fun.”

I talk to a few other contestants waiting their turn. Jonathan O’Keefe, who does database programming, is trying out real-time for the first time. And there is Ulrich from Denmark who does web applications and GUI stuff and business logic, and Michael from Germany who does desktop programming and Carl, an American, from a company called Triego Network Security, who manages security information. None have experience with real-time. The line ebbs and flows at various times, but there's always someone racing, and there are a lot folks sitting in front of the machines set up for them on which they work on their real-time programs.

Only Carl admits to big ambitions. “At first,” says Carl, “I was over-complicating it by treating it like a J2ME product, but if you are very conservative about the objects you allocate, you can treat it as a regular Java program. You have to keep it simple and not allocate anything in the loop or you will run out of memory. I’m going to try to knock someone off the leader board -- I’ve just started with the base program so there is a lot of room for improvement.”

Carl sees uses for real-time Java at his company, Triego. “We do some close to real-time work and try hard to keep our GC under control and use a concurrent generational collector, so the real-time Java technology is very interesting. We could find a lot of use for this technology in the work we do. It’s interesting and the applicability of the predictability of execution time is great.”

As I walk away, I see that Robert Chu is tied with Peter Whitfield’s 25.49 seconds time while Richard Yee is third, at 26.18, and Rivera (I don't catch his first name) is fourth at 28.60. I wonder if any of these folks will be in the top three when James Gosling gives his keynote on Friday morning. Time and times will tell.

Stay tuned. The winners will be announced and compete one final time at the Gosling keynote on Friday. Should be a lotta fun!

Finally, here's a story about the Slot Car Racing Programming Challenge yours truly wrote over on java.sun.com:

The 2006 JavaOne Conference Slot Car Racing Programming Challenge
http://java.sun.com/javaone/sf/slot_car.jsp


And, in the form of shameless self-promotion, here's an interview that I did not far back with Sun Distinguished Engineer, Greg Bollella, on real-time Java:

Programming in Real-Time Specification for Java (RTSJ): A Conversation with Distinguished Engineer Greg Bollella
http://java.sun.com/developer/technicalArticles/Interviews/Bollella_qa2.html



RTSJ and the JavaOne Slot Car Challenge

Posted by hiheiss on April 07, 2006 at 02:04 PM | Permalink | Comments (0)

I recently conducted an interview with Sun's Greg Bollella that debunks some myths about the difficulties of Real-Time Java and touts the coming Slot Car Challenge at JavaOne, which will give developers a chance to write some RTSJ code and see if can guide a slot car around a track with speed and accuracy -- it should be fun. Greg believes that "The Slot Car Challenge at the 2006 JavaOne Conference will prove that anyone can program with RTSJ,” and insists that programming in Real-Time Java is "more like bicycle science than rocket science". Anyone want to ride the bicycle?

Conscientious Software

Posted by hiheiss on March 30, 2006 at 03:35 PM | Permalink | Comments (1)

Conscientious Software: Part One of a Conversation with Sun Microsystems Laboratories' Ron Goldman Here's a rich IMHO interview with Sun's Ron Goldman by yours truly. Ron's a senior staff engineer at Sun Labs who is working with Richard Gabriel to envision a new software model. As we move into a world of massive software interdependence where standalone apps are on the way out, Ron wants to develop ways to make "large systems more robust, stable, and better able to take care of themselves." He wants software to start using cpu cycles "to actively monitor its own activity and environment, to continually perform self-testing, to catch errors and automatically recover from them, to automatically configure itself during installation, to participate in its own development and customization, to pay attention to how humans use it and become easier to use over time, and to protect itself from damage when patches and updates are installed." Are you enticed by his vision?...

Meet Java Developer, Arun Gupta

Posted by hiheiss on March 20, 2006 at 10:18 AM | Permalink | Comments (0)

A "Meet the Engineer" interview I did with Java developer Arun Gupta of Sun might be worth checking out. Arun has useful insights about programming in India and the US, the challenges of developing software, Java APIs for XML Web Services Addressing (JAX-WSA), and efforts to get Sun Microsystems and Microsoft on the same page. He's a smart guy and has a patent related to XML and has several patents pending.

Seeing Shouldn't Be Believing or the World According to Josh Bloch

Posted by hiheiss on March 13, 2006 at 03:18 PM | Permalink | Comments (1)

Please check out the interview

http://java.sun.com/developer/technicalArticles/Interviews/bloch2006_qa.html

I had the pleasure to do
with Google Java architect,
Joshua Bloch, in which he
discusses his latest book,
"Java Puzzlers," written with
Neal Gafter. He models puzzlers
on optical illusions; you look
at a piece of Java code and
see one thing, but then on
closer inspection you realize
your mind has deceived you. The
idea is to trick the mind into
making a mistaken assumption
about code; you see your
mistake and will hopefully
never make it again. With optical
illusions, Bloch claims, understanding
how the illusion works does not change
the illusion. But if you understand
how a "code illusion" works,
you can stop making that mistake,
and spot it in future code that you review.

Bloch claims that most
of the puzzlers were derived
from real experiences of developers
and that the biggest problem for
developers is unwarranted optimism.

Speaking of unwarranted optimism,
it's fascinating that they fell into
their own trap in one of the solutions
to a puzzler that turned out to be broken;
they had to include an errata in their book
correcting it. Bloch argues that no one is immune.

Josh also makes some interesting comments about
language design decisions.

I totally enjoyed interviewing him.
Besides being super smart, he's an
all-around great guy.



Meet the Engineer Q&A on java.sun.com

Posted by hiheiss on March 10, 2006 at 04:54 PM | Permalink | Comments (0)

Please check out this Q&A:

http://java.sun.com/developer/Meet-Eng/ohair/

I did with Kelly O'Hair, senior staff
engineer in JDK (Java Development Kit) Core Serviceability.

He was really fun to interview.

Asked if he ever feels a sense that he's
created something beautiful when
he writes code, O'Hair said,
"Well, more like 'not ugly.'
There's a gray zone between ugly
and beautiful. Simple is beautiful."

Kelly is a java.net blogger so check out his blog
too to get to know him better if you haven't already.



Q&A with Kohsuke Kawaguchi

Posted by hiheiss on February 02, 2006 at 04:14 PM | Permalink | Comments (0)

A new "Meet the Engineer" Q&A I did with a java.net blogger appears on java.sun.com here if you want to check it out:

(http://java.sun.com/developer/Meet-Eng/kawaguchi/)

I interviewed Kohsuke Kawaguchi, who has worked with XML schema languages since 2001, including specification work on RELAX NG
and W3C XML Schema, and implementation work in a number of related Java artifacts, including JAXB (Java Architecture for XML Binding) and JAXP (Java API for XML Processing).

He's a lively and imaginative guy who was an entrepreneur in high school and college in Japan. He has interesting things to say about schema languages, work ethic differences between the US and Japan, the Stapler and JAXB projects, and more.



Putting the Server in Your Pocket

Posted by hiheiss on June 29, 2005 at 11:07 PM | Permalink | Comments (5)

At the June 29, Wednesday morning Platinum session, held from 8:30 to 9:15, Nokia Chief Technology Officer and Senior Vice President Pertti Korhonen provided a vision of the future that promises to take Sun's motto "The network is the computer" to another level, by putting the server in your pocket.

Steve Meloan does a really good job of covering the technical moves Nokia and the industry are making to enable this here:

http://java.sun.com/javaone/sf/sessions/general/nokia_wednesday.j sp

so that allows me to wax philosophical :) in this blog.

It's a remarkable all-too-implicit vision of a world where extraordinary access to information and communicative power are available anytime, any place. Anyone can contact anyone and information about anything is at your fingertips. That is where we are headed. In another year or so mobile Java devices will be in the hands of a billion people, absolutely awesome. The "power of Java everywhere" is no hype; it's fast becoming real. There is no question that in many domains of life, from medicine to meter readers to industry to friendship and love, it's great. But I remember Jon Krakauer's book, Into Thin Air about a disastrous climb of Mt Everest in which many people died. What was almost unbearably poignant was the story of the leader of the climb, an Australian who found himself stranded at the peak in a severe blizzard at which he had the capacity to speak to his wife in Australia by cell phone, but was unable to get down from the summit before freezing to death. Technology could enable this man to talk to his wife as he was dying but it could not overcome the dubious risk-taking judgment that led to disaster.

It's tempting to make this story symbolic of something or other - I don't really know what. Maybe something like the story of the pilot of the plane who doesn't know where he is going but is proud of the fact that he is breaking all speed records. It's all happening so fast, and there is always the law of unintended, unforeseeable consequences.

I found myself wanting Korhonen, and everyone else, to get specific about how this technology can help us. The vision can't just be technological, but one that looks more deeply into the nuances of the implications for human life.

But perhaps that's what the theme of this conference is hinting at with its emphasis on the word, share.

Exposing Java Technology Performance Myths

Posted by hiheiss on June 29, 2005 at 10:48 PM | Permalink | Comments (4)

Here I am at TS-3268, "Java Technology Performance Myths Exposed," with Cliff Click, of Azul Systems. Azul, founded in 2001, advertises itself as pioneering "the industry's first network attached processing solution, designed to unbound compute resources for virtual machine based applications. Without any application level modifications, binary compatibility requirements or operating system dependencies, this fundamentally new approach eliminates the need to capacity plan at the application level and dramatically lowers the cost and complexity associated with the traditional delivery of computing resources."

Click enumerated six performance myths. What follows are the basics.

Myth One: The notion that you can add the "final" key word and your code will run faster. The assumption is that by adding the "final" key word I allow the JVM to inline and do the right thing. Not true. "Final" won't make your code run faster.

Myth Two: Try/catch blocks are free or they're very expensive. Google gives both bits of advice - that it was free or kills performance. Both are wrong. It is both very cheap and very expensive - depending. Advice: Don't put try/catches in very tight array loops. Otherwise it's more or less free.

Myth Three: Use RTTI - Run-Time Type Info. Compared RTTI versus instance-of if-tree versus virtual call. RTTI makes for really ugly code - it is fast though, so only use it if you're desperate for that last bit of performance.

Myth Four: Synchronization is very expensive. The truth is synchronization is not free, but it's no longer so expensive. It's gotten a lot cheaper over the years.

Myth Five: Object pooling works. The idea is that we can reuse objects by pooling them on and off free lists instead of using new and letting the garbage collector pick them up. Once you have more than one thread going off the pool, you need a synchronized free list, which has costs. If the list gets hot and contended, you can get scaling bugs. It gets complicated too fast and is not worth it for small to even moderate sized objects. Use it only for large objects.

Myth Six: The cost of the revisions to Java Platform Standard Edition 5.0 are substantial. Not true. Enums, autoboxing and varargs are mostly free.

Cliff wrapped up his session with a few final observations:

GC is getting cheaper and pretty efficient, and less intrusive. There are still scaling problems with large heaps.

Object pooling will remain viable for largest objects with high costs. Small objects will get even cheaper.

Click closed with one piece of advice: "If you take away only one thing from his talk, it would be that modern JVMs favor common usage patterns and clean code."



Project Looking Glass: An Expanding Universe on Your Desktop

Posted by hiheiss on June 29, 2005 at 10:31 PM | Permalink | Comments (3)

I'm at TS-7992 where Project Looking Glass (LG3D), a Java technology-based open source project that brings a richer user experience to the desktop through 3D windowing and visualization capabilities, is being presented to an audience of, I guesstimate, 800 people. LG3D sprang from the very creative heart and mind of Sun's Hideya Kawahara. Recognizing that desktops had not changed substantially in 20 years, he set out to make them more aesthetically appealing and powerful. Operating on the assumption that the next user interfaces would be 3D, he initiated a side project that would consume at least two hours a day of his spare time, plus most of his weekends and holidays for more than a year before taking hold at Sun. To put it mildly, it has taken hold. It's the most popular "app" on java.net (http://lg3d.dev.java.net) with 26,600 source code downloads, plus 600 members (and counting) since the 2004 JavaOne Conference where it was open sourced.

So what's the latest? Hideya and Paul Byrne, LG3D project owners, demo'ed a range of 3D images, a music player, scenes in which you could alter the backgrounds with a click, "Alice" an award winning 3D media player (http://alice.dev.java.net) that is the first to utilize the 3D capacity of Looking Glass, and more.

CosmoSchedulerD, a three-dimensional application running on LG3D software, created by developers at the Kyushu Institute of Technology in Japan, won a Duke's Choice Award (http://java.sun.com/javaone/sf/dukes_choice_awards.jsp). As a schedule book, it recreates outer space, with your personal solar system built in by arranging the planets according to their dates. The front of the orbit represents the current time, while the size of the planet symbolizes an appointment's importance, which makes it hard to forget an event even a few light years from now. CosmoSchedulerD contains features that ordinary schedule notebooks don't have, such as automatic scheduling, networking, and a workspace manager. Imaginative desktops seem to inspire even more imaginative apps to be built on them.

(I can't escape the feeling that talking about innovations on a gorgeous 3D desktop is like a donkey carrying a load of books. Have to shake it off. By all means go check out "Philco" running LG3D, the mock-up on the cell phone, and LG3D on a 3D LCD display, and all the rest on the pavilion floor!)

Hideya and Paul gave a brief summary of how to create a "deep" 3D environment. It's built on Java 3D with specialized classes that include a component model, animation system and SceneManager interaction. The LG3D 0.7 release has just arrived. There is now WebStart support (http://lg3d-webstart.dev.java.net) for running the "developers" mode of Looking Glass. It operates in application mode so LG3D can run on top of a user's existing desktop. Java 3D 1.4 now enables performance improvements like shader support. It has Open Solaris support.

In the pipeline is tool integration, a visualization library, and "SwingNode" support. There will be greater inclusion of identity and collaboration features and a more task-oriented UI.

To run it: http://lg3d-webstart.deve.java.net

To get it: http//lg3d-core.dev.java.net

To learn more about LG3D: http://java.sun.com/developer/technicalArticles/javaopensource/plg .html

http://java.sun.com/developer/technicalArticles/J2SE/Desktop/look ingglass/



Shale: The Next Struts?

Posted by hiheiss on June 29, 2005 at 09:57 PM | Permalink | Comments (4)

I'm at TS-7393 along with a pretty packed room of, I estimate, 700+ attendees. All the sessions that I've gone to have been well attended with a serious but enthusiastic-looking group of folks it appears who ask smart questions in the Q & A's. The session is titled "Shale: The Next Struts?" with Sabreware's David Geary and Sun's Craig McClanahan. Craig is Strut's inventor and David, Struts template tag library inventor, which was the inspiration for creating Tiles, one of Struts most popular features. Shale is the new kid on the block in the web application frameworks space, with David and Craig being two of the three leading original contributors on Shale. A lot of people want to know: What's the deal with Struts and JavaServer Faces (JSF), and Struts and Shale? A lot of uncertainty surrounds the topic. It is impossible to predict where it is all headed

McClanahan presents the rationale for Shale. Shale is unique among web application frameworks in that it starts by assuming that JSF exists. Recognizing that with a little tweaking you can turn JSF into a completely functional web app framework, he decided to see if something as popular as Struts could be created. So he proposed Shale as the architecture for Struts 2.0 to Struts developers, which did not entirely sit well, given the focus on backwards compatibility and support for existing Struts users. They did accept Shale as a Struts sub-project, so it is officially part of the Struts environment. The idea is to grow a community around Shale that is already used to the idea of using web app frameworks in developing. He is quick to point out that Shale has zero direct relationship with the Struts 1.0 code. Shale is all new code based on the assumption that JSF exists; it skips the step of re- implementing the features that are already there, like validation and request processing.

Features in Shale include web flow, so developers can organize a dialogue that is longer than a request but shorter than a session. There is client-side and server-side validation but with JSF components. Shale is integrated with Spring to enable transparent use of Spring's bean factory to create managed beans. David Geary has been extracting Tiles out of the Struts core, so it is independent of the underlying framework and can be used by any framework more easily. Shale will take advantage of that. Primary subtrees is another way to perform reuse that will function through a specialized library called "Play". McClanahan pointed out that a lot of people dislike Struts because it likes JavaServer Pages (JSP). JSF likes JSP as well, but JSF has components as a Java API, and developers can plug in a different view handler to use something different. With Shale, they've created an environment that looks like Tapestry with a standard HTML file for the markup presentation. It has a test framework to make it easy to test the view controller and other implementations.

He is quick to point out that, although they could use Shale to create another JSF component library, that is not their goal. The components they are creating are only ones that interact directly with the framework's facilities. Anyone's JSF components will work in Shale - why reinvent the wheel? The five tags within Shale are: token tags to catch duplicate submits; a subview for extra value-add services for a dynamically included page as well as the main page; a commonsValidator tag used to integrate the commonsValidator rules; a validator script so developers can point to the Java script so they don't have to load it on every page. and a clay tag used for parameterized subtrees.

JSF as an architecture has extension points that Shale takes advantage of. The Spring integration is a custom variable resolver and looks at the first word in an expression like "customeraddress.city" -- if a customer does not exist will create the bean for you. By default, JSF will look in the managed beans definitions, but the extension checks for a bean factory as well. Similar facilities enable access to the Java Naming and Directory Interface (JNDI) context. The navigation management is encapsulated in a specialized dialog navigation handler. A specialized view handler enables developers to treat a Tile name as a view ID to reduce work

So where is all this headed? McClanahan presents three scenarios. First, it is possible that Struts developers will see that Shale is becoming popular and choose it as Struts 2.0. Second, it could become a separate Apache project - synergy exists with the Apache MyFaces community that is building both an implementation of JSF and some interesting components to go with it. All of the JSF-related things could be encapsulated into a single project. A third possible future is aware of how long it takes to build a Java standard in the Java Community Process (JCP) - almost two years to build JSF 1.0. Shale can be seen as an experiment to see if its facilities make sense in a future JSF release, perhaps in JSF 2.0 time frame. The future is unclear and ultimately in the hands of developers.

An Interview with Craig McClanahan

http://java.sun.com/developer/technicalArticles/Interviews/jsf_mc Clanahan.html

David Geary's Blog

http://jroller.com/page/dgeary

Craig McClanahan's Blog

http://blogs.sun.com/roller/page/craigmcc



Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds