Jun 09

Tapestry: Event/Component Driven versus Request Driven

Java, Tech, Web Frameworks 107 Comments »

I have been having fun with Tapestry for the last couple of days. It really is a breath of fresh air compared to some of the Other frameworks.

Although request-based frameworks allow you to get the job done… and there are some good ones out there (WebWork 2 is great)… I am really enjoying a more component/event-driven approach.

A long long time ago, in a galaxy far far away I remember writing a web templating system. One of the major goals was that the HTML “templates” should be WYZYWYG/browser preview friendly. This was very much needed based on the way that we built websites, and how the designers were in the process.

Ever since then I have shed a tear or two when I see lots of evil markup which makes a system non-web designer friendly. JavaServer Faces unfortunately seems to take the cake on this one with its <f:use_faces> …. and just check out a table based on facets!

As soon as you start to work with components, this holy grail becomes hard to find… however I really like that Tapestry tries hard at this goal.

There are definitely cons to this approach. You could argue that having a conditional look like:

<span jwcid=”@Conditional” condition=”ognl:isFun”>foo</span>

isn’t as easy to view as:

#if ( isFun )
bar
#endif

However, being able to have real HTML makes it worthwhile, and after a few minutes you can get it.

Having this HTML approach is just one thing that I like. What I really like is how the I can’t put code in my view, and how the low level servlet stuff is just really hidden nicely. This is great stuff. Thanks Howard.

Jun 08

Instant Source: Nice way to view the HTML in a site

Tech 1 Comment »

Howard pointed me to a tool named Instant Source today.

It is a nice, small, simple tool that lets you really see what is going on with the HTML, CSS, images, and other web particles that you have to deal with.

It is really helpful for developing with the web, and also nice to look at some sites out there :)

Check it out at BlazingTools.com

Jun 08

Listen to Geir: Persisting Problems

EJB, JDO, Java, ORM, Tech No Comments »

I just saw Geir Magnusson Jr. and Jeremy Boynes entry discussing the problem that we have with persistence at this moment of time.

I have personally written about this before here, here, and here.

But back to the blog from Geir and Jeremy. The go through the problem at hand, and notice that we all want the same thing:

Give me a transparent persistence API

It looks like we can agree on that. So then the next question is how do we get to that path.

It seems like a no-brainer to me that we should use JDO 2.0 to get there, but I am of course biased. JDO shouldn’t only be in J2EE, it should be in J2SE in my opinion. You know, sometimes I want to access a data source WITHOUT being in an enterprise environment! I definitely want to do this without having to have an EJB container.

It is great to hear this from some of the Apache guys, and I look forward to us all coming together to work on the same problem. If we got in the same room we would find out that having blue eyes or brown eyes don’t matter. We both see.

Persisting Problems

Jun 08

Microsoft: Playing for the Java developers

Tech 1 Comment »

The C# Programming Language for Java Developers

In the “Just come to the dark side” department:

Microsoft has an article that discusses the differences between C# and Java.

As always, it makes me look forward to JDK 1.5. I also really wish we had delegates, or groovy/ruby closures. They really change the way you work :)

MSDN “Java/.NET Dev Center” is up

In the “We want to play” department:

Microsoft has a new Resources for Java Developers site (which is where the above paper came from).

Ted says is all (after he gloats about being on the site :):

Please, by the way, if you’re a Java guy reading my weblog, don’t take this entry as an exhortation to convert. That’s not really the point of the site, though conspiracy theorists will of course dispute that; the point of the site is that there were damn few resources out there for the Java-backgrounded fledgling .NET programmer to consume, and Microsoft wanted to close that gap. Frankly, I think BEA and/or Sun and/or IBM should do the same: provide a “Resources for .NET Developers” page at the respective developer sites for each company, because programmers are going to be migrating back and forth between these two platforms for at least the rest of this decade. Neither one is going away.

Jun 07

Keeping in sync with Eclipse. What a mare.

IDE, Java, Tech 44 Comments »

Eclipse is a great product, don’t get me wrong. But I have such a tough time keeping things in sync.

It means that:

a) I have multiple versions of Eclipse
b) I keep spending time “trying” to see if the latest plugin works on the latest Eclipse version

Then, add the fact that eclipse plugin X has a dependency on plugin Y and you soon are driven nuts :)

I am really glad that 3.0 is in RC1 and that the API shouldn’t be changing, so hopefully the plugin writers have time to catch up and I can just use 3.0 :)

Until then, I will keep using IDEA unless I need to do AspectJ (in which I use AJDT), Tapestry (Spindle, or the cool Eclipse profiler plugin, …

Jun 07

Learning from agile languages

Tech No Comments »

It was interesting to chat with Anders Hejlsberg about C# at the whiteboard cabana session at TechEd.

He talked about the fact that we should be learning from the (now so-called) agile languages such as Ruby/Python/Groovy…

He thought that there has definitely been a lot to learn and gave a simple example:

Currently, the following is really ugly to do in our languages:

Dictionary x = new Dictionary();

It is so verbose. Anders suggested having the compiler be smart and use defaults. So the former would become:

var x = new Dictionary();

And x would default to be the right thing. Saves a bit on typing, but when you code to interfaces more and more, it doesn’t really help.

E.g. you would still need:

Map m = new HashMap();

He also mentioned changing the configuration/initiation of objects to go from:

Point p = new Point();
p.x = 5;
p.y = 10;

to:

Point p = new Point { x = 5, y = 10 };

I personally prefer params in methods/constructors so you could just do:

Point p = new Point(x = 5, y = 10);

Good news that people are looking at the other languages to clean new information at least!

Jun 03

Managers Disease

Tech No Comments »

I was talking to a friend who works as a developer at a well known company, and they were discussing a requirements meeting that they had with a group of managers.

They were talking about a project management tool, and the only requirements they were given were:

“I want to query anything for any time period for any project”

You have to love it :)

Jun 03

Tim Bray: Learning from users. Here here.

Tech 2 Comments »

Tim Bray has just talked about a conversation with Mark Hapner (Mr. J2EE).

I was talking to Mark Hapner, a smart guy here at Sun who does heavy Java architecture, about WS-Sanity, and he had an angle that

Jun 03

Hacking around to get Web Services working. What a pain.

Tech 45 Comments »

I saw the article on developerWorks: Web Services Programming Tips and Tricks: Use collection types with SOAP and JAX-RPC.

The article discusses how you can get around the problem that “The JAX-RPC specification does not define a mapping for the LinkedList class” (and many other collections).

Then we are lead down the world of a hack, in which we need to use arrays instead of these collections, and how you can use a wrapper to do this.

When we ported the front end of TheServerSide.NET to ASP.NET talking to our business services layer we tried Web Services (as some people wanted us to ;) ).

We ran into this exact problem. We used collections funnily enough, and we had to create a layer in front of our services layer which would just be in charge of converting the collections to arrays….. and back again on the way in.

It gave us a bad taste, and we ended up using Borland Janeva. With Janeva we were able to take our EAR file, feed it to Janeva, and out came C# stubs that we could use directly from our ASP.NET application. That was it. It just worked. I was surprised :)

In our case, we knew that we wouldn’t need more types of front ends (e.g. Perl, LISP, …. ) that would want to talk to us, so it made no sense to have a generic layer such as Web Services.

Jun 02

Sun will open source Solaris

Open Source, Tech No Comments »

Jonathan Schwartz has said:

“I don’t want to say when that will happen,” Schwartz said in a press conference in conjunction with the company’s SunNetwork conference. “But make no mistake: We will open-source Solaris.”

If they did this a few years ago it could have been huge. Time has moved on, and I wonder how much of an impact it will have. Solaris is a good OS, so it can only be a good thing for everyone.

Of course, not only do we not know when it will happen, but we don’t know how. It won’t just be “here is the source code. go wild”. They want to keep Solaris “standard” as well as open source.

Read More:

Sun warms to open source for Solaris

Sun COO Schwartz Promises Open Source Solaris