Wednesday, April 12, 2006

Java SWING Survival Guide: Where are we a year later?

In this article, Matt Stephens gives his opinion about the missed opportunities with SWING and Java applets, and makes some suggestions about what could be done to improve the situation in his Java Swing Survival Guide

Is this a pipe-dream or a road map to success. Are his comments visionary, timely, or too little too late?

I think that SWING should be streets ahead of where it currently is by now. I mean, it's nearly 10 years old and it still feels like it's only just starting to walk!

I agree with a lot of what he has to say, and interestingly there are now some initiatives underway to bring SWING up to date. Forthcoming feature enhancements in Java 6 and both SWINGX and the Spring Rich Client project are just two things that may resolve some of the issues mentioned. But they're both a little way off from being truely usable.

I have had the same thoughts about the missed opportunity of Java Applets to really, really shine in the way that Flash have so successfully done. I think Flash caught the attention of the web designers and developers, and application programmers pretty much took a back seat while the whole web revolution happened.

I think it's a true irony, even a subconscious statement of defeat, that when you go to www.java.com (the consumer face of Java) the first thing that gets your attention is a Flash animation!!

But the demand for richer applications may revitalize Web Start and maybe even Applets if enough concentration on great looking applets and applications is made. However, I fear that the talent to make things look great doesn't exist in Sun's corner. I think the applet may be pretty much down and out for the count in the browser arena.

Acceptance of Java needs to be on a more serious level. I think that may more applications that are currently being done as web apps and being retrofitted with AJAX are suited better to being deployed by Web Start. Perhaps this is where the niche can be filled with better, more usable applications?

Comments welcome >

SWING Links from the CJUG presentation

Here are some links discussed in the "SWING Goodies Not Found in the JDK" presentation:

FlexDock Open source docking framework
https://flexdock.dev.java.net/

TableLayout - alternative to GridBag layout
https://tablelayout.dev.java.net/

Official SWING links on Sun.com
JFC/Swing Home Page
http://java.sun.com/products/jfc/index.jsp
The SWING connection
http://java.sun.com/products/jfc/tsc/
SWING Sightings - Lots of real SWING apps to peruse
http://java.sun.com/products/jfc/tsc/sightings/

SwingX - SWING Extensions project (sub-project of SwingLabs)
https://swingx.dev.java.net/

SwingLabs Open Source project
http://www.swinglabs.org

Spring Rich Client Project - First stable release v0.1.0 just released!
http://spring-rich-c.sourceforge.net/

JGoodies
http://www.jgoodies.com/

JIDE Commercial Docking framework
http://www.jidesoft.com/

Javootoo.com - Repository of SWING enhancements, such as look & feels
http://www.javootoo.com

Napkin Look & Feel
http://napkinlaf.sourceforge.net/

Vector based (Flash-like) SWING Look & Feel:
http://www.oyoaha.com

IconCraft - Programmer's Icon Editor (Limited Shareware)
http://www.iconempire.com/iconcraft/

Romain Guy's Weblogs - Developer on Sun's SWING team:
On java.net:
http://weblogs.java.net/blog/gfx

On jroller.com:
http://www.jroller.com/page/gfx?entry=swingx_painters_demo

Tuesday, April 11, 2006

Check for Palm nearly done


One of my pet projects over the last few months has been to program an electronic version of my card game, Check - The Chess Card Game onto the Palm (and other devices).
I have been using Waba, an excellent micro-VM to do it.
I'm just about there with a Beta which needs testing. If you have a Palm device and want to try it out, bring it along to CJUG on Weds 12th April and I'll beam you a copy to play with.
(You need a colour device with 320x320 or greater resolution.)

Once I'm done on the Palm, I plan to port it to J2ME and run it on my phone.

Wednesday, March 29, 2006

Presenting at CJUG next month

The chairman of the Calgary Java User's Group (www.cjug.org) got wind that I was playing around with an Open Source Docking Framework called FlexDock.

As announced at the Sun Java Developer Day Conference in Calgary yesterday, I'll be presenting it along with some other "SWING Goodies Not Found in the JDK" at CJUG on Wednesday, April 12th.
In his keynote, James Gosling mentioned a movement back toward SWING as the framework gets improvements in terms of performance and code efficiency and frustrated users crave richer clients.

SWING might just be coming back into fashion.

Watch this space... I'll post some supporting info here pretty soon.

Wednesday, February 22, 2006

Good design worth blogging about


Last weekend we went camping. Even though it was cold (-15C), the sun was out and we had a great time for most of it. One of the higlights of the camp was a hike into the Ice Caves. Another was a bowl. A bowl? Yes, from IKEA.
What's great about this bowl is that it is one of the best industrial designs I have come across in recent times. And it's only $3.
The bowl has a long vertical handle which makes it stable when standing on a flat surface, and a hole which can act as a spout or for your spoon to go through, and a flat lid that slides out to make a plate or tray. It's made of durable plastic which is microwave safe. I often have soups at lunchtime which need heating up. After five minutes in the microwave, my Chunky Soup was hot but the handle was perfectly cool.
You can drink from it, have soup or noodles, breakfast or a meal, using the plate lid for pancakes or bread. Perfect for camping.

Well done IKEA.

Another interesting game


Following on from my other post about original games, the Japanese game for PS2 from Namco, Katamari Damashi has to be one of the strangest, most original and ENJOYABLE experiences in gaming. Not since Lemmings has such a interesting gaming concept come along.
Translated it means somthing like "Prince Roller".
The intro and in-between sequences can only be likened to something like a Monty Python animation mixed with strange Japanese pop-culture.
The essence of the storyline (if it can be called that) is that the King of the Cosmos has somehow caused the stars to fall out of the sky and you, as the young Prince, have the job of making stars and constellations to put things right. How do you do this? Roll up earthly items using your gravity ball (the Katamari) until you reach the desired size. But bump into something too big and you will not only lose momentum, but also some of your precious items will be knocked off reducing the size and knocking you back from achieving the goal.
As the game progresses, you will be placed in various scenarios where the objective is harder and the things to pick up are larger and harder to roll up. The game has a strange humour - eventually you'll be rolling up amimate objects such as cats, cows and even people. The finale level is fun as you eventually get to roll up high rise buildings, small islands, and even clouds!
Apparently it sold hundreds of thousands of copies in Japan and there's now a sequel: "We Love Katamari", and I believe another one is in the pipeline for PSP. You have to see and play it to believe it.

A friend told me there is a 2D simplified version of the game on the net at this location: http://katamaridamacy.jp/qa_data/katamari.html

Tuesday, November 29, 2005

Innovative, enjoyable Games

Interesting blog here on java.net

Ha! Interesting they should mention "No One Lives Forever". I just picked that one out of the bargain bin on PS2 for a Christmas Present. Hope that this version is as good as on the PC.

The FPS games that really took my notice of late is the Splinter Cell series, which very effectively uses excellent AI and the new lighting technology of today's GPUs to create an immersive story-driven game experience with an extra dimension - that of true stealth and espionage. The other game I really enjoyed from it's storybook feel, interestingly from the same developers, was Prince of Persia, the Sands of Time. (Such a disappointment that they felt to turn up the gore and somewhat lose the fantastic epic adventure storybook feel in the sequel. This shows where the focus of the industry lies nowadays.)

Games having true invention like this are becoming more and more rare. The newer game types are coming with new kinds of input device, and in some cases inventive use of new technology enabled by the hardware. Truly original game experiences of late have been things like Dance & Karaoke Revolution series which use floor mat and microphone as input devices and games that use a camera (like the EyeToy) to detect physical body movement. I am looking forward to trying the EyeToy out with my family this Christmas.

My list of truly inventive games over the years starts with Elite. The game that realized the one of the most powerful aspects of game design is imagination. The true skill of game creation is to unleash that power within the gaming environment.

Other games showing true innovation to create a truly memorable gaming experience that come to mind are Lemmings, The Incredible Machine (and it's classic comical counterpart The Incredible Toons) and Battlezone 3D by Pandemic.

Friday, November 25, 2005

Howard Jones - Revolution of the Heart


Howard Jones is my favourite music artist. He makes us wait for his new stuff, but when it comes it doesn't disappoint. You can't rush art.

His new CD came out recently and is available from Howard's DTOX webstore,
Revolution of the Heart (Limited Edition)
and from Amazon.ca:
Revolution of the Heart

This album is a back to the roots rich electronic production with thumping beats and filled with Howard's signature catchy uplifting melodies. It doesn't feel formulaic, however. As I have come to expect from Howard, the lyrics are thought-provoking and topical. This is not shallow lovey-dovey manufactured pop.
It's fresh and smart with a lot going on in the production department to keep it interesting on subsequent listenings. It's definitely a grower, and you'll find yourself singing the tunez long after you've left the house.

There is not a bad track on the album, and it's obvious that Howard and his co-producer Robbie Bronniman have put their heart and soul into every aspect.

"Celebrate Our Love" is a strong intro track. I also much like the first single, "Just Look At You Now", the title track "Revolution of the Heart", and especially "Stir It Up", which I think would make a great single if Howard manages to get back in the limelight with this one.
The album doesn't slow down and you are left with the strong driving beat of "For You, See Me" ringing in your ears and a voice inside you saying "That was great - let's do that again", as you almost subconsciously reach for the Play button to restart the experience.

I got hold of the limited edition Australian release which has a bonus CD containing dubs and remixes. Of the new tracks, the John B Drum and Bass mix of "For You See Me" is the only ROTH track that I really prefer to listen to over the album version. It is extremely catchy and danceable and actually enhances the album track. The remixes are meant to be danced to, and are probably great for that, but are a bit repetitive when they are just passively listened to. We have more than just remixes of new tracks. We have some new takes on classics like "Things Can Only Get Better" and "What Is Love". The other highlight of this disc, is the remake of "Like to Get to Know You Well" by The Young Punx called "Slip Away" which they released under the name "Mohito".
This is a great new angle of a classic song in the vein of many other similar tracks which are reviving the dance clubs with a fresh rejuvenation of classic 80's tracks.

The Australian release can be found here:
Revolution of the Heart [Import]

ESRB: [ND-13] Only slightly nerdy

I am nerdier than 56% of all people. Are you nerdier? Click here to find out!

Dare you to find out how much of a nerd you really are!

Thursday, November 03, 2005

Bag that! Eclipse way off base with Visual Editor.

The AWT GridBagLayout has been around for a long time. It takes some getting used to but once mastered is the mother of all layout managers, enabling just about any configuration of components
... and that's the problem...
all too often what you get is not quite what you want.

The quirks of the GridBag are well summarized by Totally GridBag a must-see animated blog by a developer who probably discovered a better way! (...more about that at the end.)

For anyone who's tried, a few helper classes usually are in order to prevent the types of problems that guy was having, as is well described in the 1000-page book "Master the GridBagLayout in just 99 days", which has 10 chapters on the idiosyncrasies of the 101 parameters of the GridBagConstraints class. (The book doesn't exist - I'm still writing it. Or rather, Eclipse is. They have probably added about another 5 chapters with their new Visual Editor.)

So with the GridBag being such a veteran of the Java world, you'd think that they might have actually have got somewhere with Visual GUI Designers by now. So after seeing the new features of the Visual Editor, keenly I download the Eclipse plug-in with high expectations. And at first it's not bad! I manage to develop a pretty neat looking GUI which allows me to add components here and there. My previous knowledge of GridBag helps me out, I'm sure - so I'm not sure how a newbie would fare, but all-in-all, Good stuff. Much better than writing all that tedious UI code, even with helper classes.

UI looks good, time to save & go home.

Next day - Katrina strikes. I open up the Visual Editor once more to add a few buttons and some new fields. So I start plopping a few components onto the canvas. All looks good. Go to save my work and "Oh no!" dialog pops up. "The class you are trying to save has compile errors - Proceed?"

What the heck kind of code has this thing been writing behind my back? So I go into to see my code in tatters. Not only has it hashed things up, it has done so royally. I find references to contraint objects that weren't created, and much, much worse, generated code inserted in the middle of other code, even inserted into comments. So I back out the changes, one undo at a time to see the UI in the visual view disappear right before my eyes. Now that's toally messed. Good job I didn't save the thing half-way through!

So a little more evaluation leads me to discover that:

  1. it's almost impossible to make changes to my UI in its current state (every time I try the code is inserted at the wrong place),
  2. the code it generated even before the compile errors is so messy and convaluted it's not even worth trying to maintain by hand and,
  3. the grid references in the GridBagLayout have gaps.

(I also found issues with how the vanilla GridLayout is handled too, but this blog is too long already.)

Time to find a better way.

Enter the TableLayout manager. It's been around for a long time, almost as long as the infamous GridBagLayout. Maybe everyone else knows this already and I'm slow on the uptake...

A little planning up front is always a good idea. For this layout, you want to have a good idea of how many rows and columns in your grid up front.
Add your row and column dimensions as arrays of doubles. For each dimension, specify absoutes as positive integers, percentages as a decimal between 0 and 1, or get it to respect PREFERRED sizes or FILL available space.

Components are added using a formatted string convention in the constraint argument:
"1,3" - add component to col 1, row 3
"1,3,4,6" - add component to col 1, row 3; spanning cells to col 4 row 6
"1,3,R,T" - add component to col 1, row 3; horizontal align right, valign top
"1,3,4,6,R,T" - all of the above

Here's a snippet:

TableLayout layout = new TableLayout();
layout.setColumn(new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED});
layout.setRow(new double[]{TableLayout.FILL});
layout.setHGap(4);
modulePanel = new JPanel(layout);
modulePanel.add(new JLabel("Action:"), "0,0");
modulePanel.add(new JButton("Click Me"), "1,0");

or if you prefer:

...
double[][] colsRows =
{
{TableLayout.PREFERRED, TableLayout.PREFERRED},
{TableLayout.FILL}
};
TableLayout tableLayout = new TableLayout(colsRows);
modulePanel = new JPanel(tableLayout);
modulePanel.add(new JLabel("Action:"),
new TableLayoutConstraints (
0,0,0,0,TableLayoutConstants.RIGHT, TableLayoutConstants.TOP
)
);
modulePanel.add(new JButton("Click Me"), new TableLayoutConstraints(1,0));
...

This definition string thing feels a little strange. But in practice it's a nice, welcome shorthand.
However, if you want a more conventional, type-safe API then the TableLayoutConstraints object can be utilized instead.

This grid doesn't care if there are vacant cells. It doesn't even care if there is more than one resident in the same cell - it will render them all!
Add some padding to the layout with HGap and VGap, and either add a standard border or create a margin by adding blank rows and columns around the edge.
Did I say 'adding rows and columns'? I certainly did! this puppy allows you to create your component grid and then mess with it dynamically after the fact in code or at runtime! They even have an example of how to create animation in the grid by messing with the settings in real time.

Some observations:

The documentation thinks it's a good idea to add blank columns and rows as borders. I don't have an issue with having the option to do it, but Borders are also a viable option that shouldn't be overlooked.

The TableLayout guys present the layout manager as a one size fits all solution, and see it as an advantage to not have to use nested layout managers. I think that nesting layout managers is a wise technique for complex forms, whatever manager you use. The good news here is that TableLayout is often a better (or at least equivalent) alternative to the more simple layouts like FlowLayout, BoxLayout and GridLayout and even BorderLayout. So my gut feel is that nesting TableLayouts sensibly is good advice. (For example, when you find yourself adding a column for one field and you find that every thing else has to be adjusted to span it.)

This is almost an aside, or maybe a note-to-self: Managing layouts during development is almost always a pain when you want to add a field in the middle of a bunch of other fields. A technique to add the components from a dynamic array or collection would not be a waste of effort in conjunction with this layout manager, IMO.

Baffles me why this hasn't been adopted by Sun so everyone can benefit?

Monday, October 24, 2005

ICEfaces

Had an interesting demo of ICEfaces at the ICEsoft offices the other day. I'm building a next generation web application with JSF - ICEfaces brings us into the world of AJAX and dynamic page rendering with its enabling technology. I'm hoping for more components to show off the dynamic nature of the framework, and may well end up writing some myself.

Unfortunately for ICEsoft, the JSF landscape is rapidly changing with the popularity of MyFaces and Facelets, and with Shale and Clay on the horizon, but they're doing a grand job of keeping up and already have MyFaces support and are madly working on Facelets integration.

The folks at ICEsoft have had some good exposure recently when they presented their technology at JavaOne, and they have some interesting demos on their site, with more to come. I look forward to their presentation at the Calgary Java User Group (CJUG) next month.

Friday, October 21, 2005

All else pales...


Our newest arrival Jessica was just born!

Jessica Rachael Biggs
9th October 2005
7lb 6oz

Friday, October 07, 2005

Swing Sings with Spring (and activeMQ-ing)

Now I’m officially impressed – so much so I have to blog about it. Not long ago we had an important breakthrough at work. We actually put our thinking caps on and decided that (against all corporate neo-conventional wisdom) a web app was not the most appropriate platform architecture for our application. (I know, radical isn't it!)

Phase one had been done as a web app, with some good reason, but the reality is, we have a few specialized users at the same site who need a reliable, interactive monitoring application. There is no need for distributed no-client deployments across the net - on the contrary: a definite need for a richer client that allows control over the GUI container. A web browser controlled by javascript to me just did not fit. (For the record, I think there are a lot more applications that fit this definition that are implemented in a web browser that shouldn’t be, but that’s the subject of another blog.)

So once we’ve convinced the business users that there is a better way (even an alternative way!) the obvious answer to our client is SWING. Hooray! At last I’m writing real apps again!

Swing often talks to the back-end via RMI (unless you’re trying to shoe-horn it into some web app backend. I’ll let you picture that ugly picture in your mind before you realize for yourself what a clunky idea it is! And no, that’s not a dig at JSF. JSF is cool done right. And eventually it will be as soon as Sun takes the JSP out of their proverbial backend.)

So I start looking at how to do RMI the Spring way. Using the Spring RmiServiceExporter I was able to neatly encapsulate the RMI implementation in the Spring configuration. Life is pretty good.

The need for a reliable system architecture on the server-side is definitely on the requirements list. Usually we would look straight at an application server to fulfill these types of requirements, but while we’re being radical about front-ends, why not question the whole gamut?
So we start thinking about a more distributed service-oriented architecture. A new world where services run happily decoupled from each other advertising their wares across the ether. Not caring where they live or who they work for. A free J2EE world full of peace love and understanding.

The more we talk about it the more we like it. What if the app server goes down? All our services go down with it. Why use an app server then? Why not run the services independently, each in their own process space? Now that’s starting to sound interesting!

We’re starting to sing the song of better, lighter, and maybe even faster Java. (Ref: Bruce Tate) I haven’t read his book and wasn’t able to meet the man himself at NO Fluff Just Stuff this weekend, due to the fact that my wife will be giving birth any day now, but I’m sure he’d approve.

But hang on, party’s over: How are these happily independent services going to talk to each other? The distributed service architecture requirement is starting to sound a lot like JMS, and don’t we need an application server for that?

Before diving in, this is a prime opportunity to see what the Spring world has to offer…
A quick Google on Spring and JMS and you can’t help but stumble upon LogicBlaze’s ActiveMQ open-source message broker. A few links later and Craig Walls, author of Spring In Action, comes to the rescue with a very interesting blog on doing JMS the Spring way with the help of ActiveMQ. He dubs the technique Message-Driven POJO’s (MDP’s), modifying the Sun acronym, MDB - Message-Driven Beans (EJBs, that is).

Craig’s first Blog is great, but one thing still remains by his own admission, the need to implement the Message interface. Not to be outdone, it’s not long before he Blogs again about another great library from LogicBlaze – Lingo. This is the missing link as far as Spring is concerned. Now we can complete the decoupling from the JMS implementation.

http://jroller.com/page/habuma?entry=message_driven_pojos_2_the

So how does this all work in practice?
In a word – brilliantly.

Once I got my head around the abstractions, that is! After lots of deep thought about what is and is not necessary to implement, how things should be wired together and even how to reference the beans meaningfully, suddenly I found myself in Spring heaven. All I have to do is start up the ActiveMQ broker, start up my services one by one, and let the messages flow!

I have several services publishing to a JMS topic, all happily doing their own individual things, pumping their messages out into the world.

Why is this great?

i) Well first of all, each service is happily running in its separate process space – it has a VM all to itself. So if the service goes down, everything else stays up. And neither does it have to run on the same physical machine. No does it have to be the only one of it’s kind. I can start up several of the same services on different servers, publishing the same information to the queue and I have automatic fail-over.

ii) There is no application server in sight. But if I decide (or someone else decides!) I need one, I can use it as a container for my services with little trouble. All indications are that ActiveMQ will sit happily within a servlet container or application container. But please tell me why this is a good idea after taking i) into consideration.

iii) Because there is no indication whatsoever in the implementation classes that JMS is the transport.

The proof of this is in the testing. It took me the lesser part of a day to configure a Spring configuration to test all of my services WITHOUT JMS. No mock objects or heavy test containers required. Just plain & simple JUnit. Now that’s impressive!

Spring has Sprung. And it’s beautiful outside.

Q.E.D.

Thursday, August 25, 2005

facelets and MyFaces living together in harmony

So I discovered in the end it was a lack of configuration that was causing the issues in my port from JSF RI with JSPs to MyFaces with facelets.

The facelet was not recognizing the MyFaces extension components because they were not registered, something that's automatic in the JSP environment.
It turns out you need an entry in the web.xml file and a file to define the extra components. Definitely not something you can deduce on your own!

I ended up enhancing this page to give those that follow a better chance of success!

http://wiki.apache.org/myfaces/myfaces%2etaglib%2exml

Now I can get on with the task at hand! ;)

Wednesday, August 24, 2005

Looking for a culprit: facelets or MyFaces?

I guess this is what you get when you start playing with new technology before the paint's dry.
I have a system using JSP & Sun's JSF RI.

So now I decide that I can't live with this combo any more, and so I decide to change to Facelets and Apache MyFaces.

Every thing is going along swimmingly until I actually put a complex JSF component into the mix. This is the Newspaper Table from the MyFaces Tomahawk suite.
Now this was working just fine in a previous setup, but the new config of the system under MyFaces in the facelets view template doesn't recognise (or can't resolve) an instance variable in the component.

What to do? Well can I find anything on this issue? Google turns up virtually nothing.

Is it MyFaces? (I'm sure it's MyFaces creating the error, but this is a MyFaces JSF control. So I try a standard DataTable - no problems there, and the Newspaper Table is supposed to be derived from the DataTable.)
Or facelets? (Maybe facelets isn't initializing the component properly?)
(Or an unhappy combo of the two?)

No chance. Stumped. Time to work around again... :(

Ah... facelets

Well, thanks to a comment on one of my posts, I've now been reminded to blog again.
The No-Fluff Java Symposium is coming around again, and I have what? Four posts to my name?

Since last year, I have worked with JSF somewhat and have had pretty good success with it.
There are some really annoying things about using it with JSPs, especially if you just want to stuff some HTML markup into the mix.
In some cases (usually when inside another JSF parent component - pretty much a given when using Tiles) the HTML gets rendered by the JSP container ahead of the JSF tags - and that's definitely not what I ordered!

Enter facelets, a great new templating system for JSF which completely removes the JSP engine out of the picture. You can define a standard HTML page and plug it into your page template, Tapestry-style (no need for Tiles) and have it rendered perfectly, with no need to restart the web server.

Now that's much better. :)

Wednesday, February 09, 2005

Why Overwrite? A blog about anti-functions.

I know that software development is all about adding features. But have you ever considered that some features are out of date, or just plain stupid?

Take this for example: OVERWRITE text in a text editor. Every text editor has it, not just the old ones. Word, WordPad, Excel. Even IDE's seem to think it's necessary. I don't think I've used one that doesn't think this is an essential feature: Visual Studio, JBuilder, IDEA... the list is painfully long.

So why, you are thinking, does he use a feature he hates so much? Well, the answer is, I never use it intentionally. I think you're probably in the same boat. I am typing away happily when somehow, accidentally I inadvertantly press the INSERT button on the keyboard. With no warning, I'm in the obliterative OVERWRITE mode. Suddenly my text is being consumed with more gumption than Pacman after Ramadan...

So where did this function come from, and why is it so EVIL?
Well, it's a leftover from some of the original word processors which were mimicking the more advanced wave of mechanical typewriters. You know, remember Wordstar and Wordperfect. And even before them, we had command-line interface tools and editors, like VI and EMACS (which some people still cling to like a baby's soother) where the INSERT text feature was a major breakthrough (if you could remember the five-fingered key combination to unlock it).

So when you have a mouse and the ability to select text in a block to delete it, why would you ever want to have an OVERWRITE mode? And even if you don't want to use a mouse, the shift key will do the selection for you. And herein lies the problem. Pressing SHIFT with END or HOME may select what you want to delete (by hitting the DELETE key), but somewhere along the line you are accidentally going to hit INSERT. It's a fact of life.
And before you know it, the text you just slogged over is going to disappear into the ether as you type.

So now what do you do? You have a dilemma. What do I want more: the text I just typed or the text it overwrote? If I UNDO I'm back to where I started, if I don't I have to remember what I typed. Ah, you say. Just select the text just typed, COPY it to the clipboard, select UNDO and then SELECT the location of the new text and PASTE it back in where you wanted it.

I just have one more question: How exactly does this make one more productive?

Just get rid of the ##$#%@@ OVERWRITE anti-function. PLEASE!

Tuesday, November 23, 2004

Current Opinion of JSF - A Face with no features?

Java Server Faces has a lot going for it. However, it also has a lot of catching up to do!

JSF has been on Sun’s public agenda since 2001. A lot of lofty goals were set to produce a better Web Application framework which would become the equivilent of Swing in the browser. Sun also wanted to replace Struts, and the word is that this resulted in some contention with the Apache group. Things went stale with bureaucracy for about a year. Somewhere along the line, Sun pulled the brain behind Struts, Craig McClannahan, onto the JSF project to evangelize for them, along with some of the members of the Swing team. Meanwhile, Microsoft was gaining momentum with their .Net web framework…

So suddenly the JSF team were behind schedule before they had really started, and had to somehow mix .Net Webforms with Struts and Swing and produce it quickly. The mandate from Sun is to make this an official part of the J2EE stack and it must be built on JSPs and servlets. (However, the display technology is interchangeable. JSF apps can be front-ended by J2ME, XSTL, Velocity, Applets and Swing clients, as well as the default HTML.)

So what do we have now? JSF v1.101 - A Face with no features!

With JSF we have a framework for a component-oriented UI system – but with very few UI components! The philosophy – this is a reference implementation for J2EE application server providers to implement, enhance and extend.
JSF has introduced an object model and an event model into the fray. We have formatters and converters. Certainly better than Struts which makes us convert everything on a form into a String on its way out and back into it’s native datatype on the way back in. Without an in-built formatting component, this makes life for many Struts developers pretty miserable.
The system is an extensible reference implementation and Sun is waiting for the implementers (e.g. BEA, IBM, and the Open Source Community) to spice up their life by filling in the gaps.
However, the things that make JSF very compelling when you’re struck in between a rock (Struts) and a hard place (adopting a totally new framework) are:
- I can treat every thing on my web form as an object in a hierarchy
- I don’t have to write HTML TABLES much anymore
- When I click on something I can directly write a handler for it, with much less wiring (as in Struts)
- I can integrate Struts with this and replace bits of an existing app one at a time

The itches are:
- I may well have to write my own web interface components (but we do that anyway and it’s not all bad. At least it’s encapsulated, reusable code)
- There’s another new set of JSP tags to learn
- There is the equivalent of Struts config with a different (but better) syntax (My itches with Struts-config make me sore – so I won’t go there.)

The recommendation from the presenter of the JSF presentation, David Geary, who wrote the book Core JSF for Sun, is to use JSF with Spring and Hibernate to develop the next generation of J2EE apps.

I've got some reading to do...

No Fluff...

Here's my opinion of NFJS held here in Calgary last weekend. Overall pretty good stuff!

2004 “No Fluff Just Stuff”
Western Canada Java Symposium

by
Alan Biggs
Senior Java Developer
Treetop Tech

Summary
The conference was a good mix of presentations by ‘ground-level’ developers and software professionals who really know their material. If there was a theme to the conference, to me it would be “Software Craftsmanship”. As well as having many sessions to hone our skills and introduce us to new working techniques, there were also some refreshing topics to do with the Art of Software Engineering and the challenges of progressing as a professional in the workplace.
There was a welcome absence of Sales Presentations by marketers and sponsors. The content was principally technical in nature.
Most of the presenters have written software development books in their area of expertise. Dave Thomas and David Geary were the most notable of these, having co-authored the acclaimed book “The Pragmatic Programmer”, and Sun’s “Core Java Server Faces” respectively.
A very entertaining part of the conference was the Panel Discussion on Saturday afternoon, where the speakers were asked questions “on any subject whatsoever.” Questions about their biases, what new technologies excite them, their opinion of what’s on the horizon unearthed some surprising answers. A shift towards dotNet is inevitable but Java is not going away – conclusion? We will be managing dotNet front-ends to J2EE back-ends increasingly in the coming years. It will not be a bad move to have both technologies in one’s repertoire. No question was outlawed, and so a question to a panel of techno-geeks asking if they “Have a Life” returned some interesting responses!
The main threads of the conference were Agile methods, including test-first development, refactoring and implementing continuous builds. There was a detailed overview of Sun’s significant, (but already dogged,) new technology “Java Server Faces”. Open source software and honing our software engineering skills were also key topics.
Some of the more interesting topics were some views of some interesting new technologies inside and outside of the Java space, including Ruby, Spring, Tapestry and Seaside (a Smalltalk-based web application framework).

Conclusion
The conference was very enjoyable and represented excellent investment of our time. The topics were all current, but were not just about tools, APIs and technologies. This conference was for those developers who are serious about their profession and making continuous improvement in their field. There was plenty of meat on the menu to keep our brains churning – mixed with a good dose of humor and a chance to step back and evaluate the tasks we perform from day to day – why we do what we do, and to take pride in doing it better.