Tuesday, December 27, 2005

What's Your Favorite Design Pattern

Once in a job interview, someone asked me "What's your favorite design pattern?". I was first surprised at the question. Usually a design pattern is about solving a problem not about a personal preference. I wondered if it was a trick question of some sorts. I was hesitating with my answer and asked more about the meaning of the question. I just had to really give the pattern I liked the most! I really should not have but I ended up pleasing my interviewer and said "the decorator pattern". At least its name is somehow related to arts.

Then he said his favorite one was "the template pattern". He was really into it because he could use it anywhere. For him it was like the best thing since sliced bread.

Sheesh! just an abstract class. What kind of pattern is that!?! Design Patterns discussions can be really dull.

What's Your Favorite Design Pattern

Once in a job interview, someone asked me "What's your favorite design pattern?". I was first surprised at the question. Usually a design pattern is about solving a problem not about a personal preference. I wondered if it was a trick question of some sorts. I was hesitating with my answer and asked more about the meaning of the question. I just had to really give the pattern I liked the most! I really should not have but I ended up pleasing my interviewer and said "the decorator pattern". At least its name is somehow related to arts.

Then he said his favorite one was "the template pattern". He was really into it because he could use it anywhere. For him it was like the best thing since sliced bread.

Sheesh! just an abstract class. What kind of pattern is that!?! Design Patterns discussions can be really dull.

Professional Portal Development Book Review

I just finished reading Professional Portal Development With Open Source Tools (Wiley).

The Good:


I enjoyed Chapter 1, it gives a good presentation of Portlets for someone who does not know much about it. It is a chapter one can use as a reference to verify some specific details of how Portlets are working. It is a bit similar to JSR 168 specifications, but I found it more detailed and well written.

Beside Chapter 1, there are here and there useful information:
  • A presentation of Model 1 and 2(X) Architectures in relation with Portals. It could have been more detailed.
  • Example use of some Design Patterns in a Portal although the example use is really just one sentence and some Patterns uses are too obvious and not related to Portal (Singleton, Template Method).
  • Web Services for Remote Portlets.

The Bad And Ugly:

I was disappointed by the remaining of the book. While it is good to mention Lucene, Apache James, OJB, Jakarta Slide, as those can be useful in Portal development, the book does not provide any useful information on those products. It would be difficult to put all that in just one book. The author merely gives kind of hello world examples for each technology, which I find quite useless.

A quick presentation of software methodologies is again quite useless, and not what we expect from that kind of book. If I want to learn about software methodologies, I buy a book about it, I don't buy a Portal Development book.

The rest of the book really looks like a list of disconnected subjects, the important ones are not given more attention to the non-relevant ones. Portal Navigation is a problem you will encounter in any Portal development, but you won't find much in the book except a short example. The author also writes with way too many words for the content about CVS, Subversion, JUnit, AntHill, Scarab. And then he goes on about Java Web Start, woohoo! Yes, it almost reads as well as a resume full of keywords.

Summary:

Don't buy this book.
Tags:

Professional Portal Development Book Review

I just finished reading Professional Portal Development With Open Source Tools (Wiley).

The Good:


I enjoyed Chapter 1, it gives a good presentation of Portlets for someone who does not know much about it. It is a chapter one can use as a reference to verify some specific details of how Portlets are working. It is a bit similar to JSR 168 specifications, but I found it more detailed and well written.

Beside Chapter 1, there are here and there useful information:
  • A presentation of Model 1 and 2(X) Architectures in relation with Portals. It could have been more detailed.
  • Example use of some Design Patterns in a Portal although the example use is really just one sentence and some Patterns uses are too obvious and not related to Portal (Singleton, Template Method).
  • Web Services for Remote Portlets.

The Bad And Ugly:

I was disappointed by the remaining of the book. While it is good to mention Lucene, Apache James, OJB, Jakarta Slide, as those can be useful in Portal development, the book does not provide any useful information on those products. It would be difficult to put all that in just one book. The author merely gives kind of hello world examples for each technology, which I find quite useless.

A quick presentation of software methodologies is again quite useless, and not what we expect from that kind of book. If I want to learn about software methodologies, I buy a book about it, I don't buy a Portal Development book.

The rest of the book really looks like a list of disconnected subjects, the important ones are not given more attention to the non-relevant ones. Portal Navigation is a problem you will encounter in any Portal development, but you won't find much in the book except a short example. The author also writes with way too many words for the content about CVS, Subversion, JUnit, AntHill, Scarab. And then he goes on about Java Web Start, woohoo! Yes, it almost reads as well as a resume full of keywords.

Summary:

Don't buy this book.
Tags:

Wednesday, December 07, 2005

IBM Websphere Portal Strategy

I digged a bit deeper in a current project where they use IBM Websphere Portal Server (WPS) with IBM Web Content Management (WCM). I found out that both products collide and disintegrate.

WCM is like a regular content management system, quite flexible and performant on its own. It has a nice way to separate layout concern from content concern. It has a flexible cache. It has a user repository to set different permissions. Its architecture is even so well done (very modular) that you can tailor it to your needs to do things a content management system is not supposed to do. It could do most of what you would do with a Portal system. And that's the problem.

WPS is a Porlet server, now compatible with JSR 168. You can again do the layout of your portlets, you have an administrative interface to handle them and one to handle user permissions. There is a caching system although it's not very clear how that works. Standard administration Portlets seem awfully slow to use any cache. To be integrate WCM content in the Portal Server, they ship a WCM Portlet. While JSR 168 API is recommended by IBM, the WCM Portlet is not a JSR 168 one.

So you have 2 products where you can layout your pages, and have dynamic behaviour in them, locally as components, easily manageable. One can be embedded in the other, but it does not make much sense, because you would then just use a tiny part of its possibilities, and its flexibility will be more a burden (extra abstraction layer) than anything. The integration of the 2 products is very superficial. Although recently they can share a common user repository, the WCM portlet does not do any caching of WCM content, linking between content and portlets is a very cumbersome task. IBM provides tips to build a framework that does just that. All that for not using most of the WCM possibilities and always having difficulties in defining their roles and using them collaboratively.

Now, if you look at how JBoss Portal works, and what features they focused on, you will see a well designed solution whose aim is to build pragmatically a Portal using Portlets. They have a very simple content management system used to administrate HTML snippets. Content is put inside the Portal page using CMS Portlets, the layout is the one you specified in the Portal page. They provide automatic caching of CMS content and easy to use links. Integration with their CMS is already using JSR 170 standard. You can plugin other CMS systems easily.

IBM strategy with their WPS+CMS does not look very good, and their version is currently 5.1, soon 6.

IBM Websphere Portal Strategy

I digged a bit deeper in a current project where they use IBM Websphere Portal Server (WPS) with IBM Web Content Management (WCM). I found out that both products collide and disintegrate.

WCM is like a regular content management system, quite flexible and performant on its own. It has a nice way to separate layout concern from content concern. It has a flexible cache. It has a user repository to set different permissions. Its architecture is even so well done (very modular) that you can tailor it to your needs to do things a content management system is not supposed to do. It could do most of what you would do with a Portal system. And that's the problem.

WPS is a Porlet server, now compatible with JSR 168. You can again do the layout of your portlets, you have an administrative interface to handle them and one to handle user permissions. There is a caching system although it's not very clear how that works. Standard administration Portlets seem awfully slow to use any cache. To be integrate WCM content in the Portal Server, they ship a WCM Portlet. While JSR 168 API is recommended by IBM, the WCM Portlet is not a JSR 168 one.

So you have 2 products where you can layout your pages, and have dynamic behaviour in them, locally as components, easily manageable. One can be embedded in the other, but it does not make much sense, because you would then just use a tiny part of its possibilities, and its flexibility will be more a burden (extra abstraction layer) than anything. The integration of the 2 products is very superficial. Although recently they can share a common user repository, the WCM portlet does not do any caching of WCM content, linking between content and portlets is a very cumbersome task. IBM provides tips to build a framework that does just that. All that for not using most of the WCM possibilities and always having difficulties in defining their roles and using them collaboratively.

Now, if you look at how JBoss Portal works, and what features they focused on, you will see a well designed solution whose aim is to build pragmatically a Portal using Portlets. They have a very simple content management system used to administrate HTML snippets. Content is put inside the Portal page using CMS Portlets, the layout is the one you specified in the Portal page. They provide automatic caching of CMS content and easy to use links. Integration with their CMS is already using JSR 170 standard. You can plugin other CMS systems easily.

IBM strategy with their WPS+CMS does not look very good, and their version is currently 5.1, soon 6.

Tuesday, November 29, 2005

Portlets in an AJAX World

Recently, I have had my first encounter with Portlets although Portlets are not very new. IBM had their own Portlet API before the JSR 168 was final in 2003. Unfortunately both approaches are quite different and IBM does not recommend the use of their own API.

Portlets were a needed concept for a long time. I worked in 2000 on a java portal system and it would have been handy at that time. Portals are everywhere since the internet bubble.

But Portlets do not do that much either. Sites designed with strict and intelligent rules can bypass the portlets need for example by using a combination of custom tags and java beans.

What shocks me a bit more is that while not doing much, it looks a bit old fashioned already. With AJAX you could build very flexible and user-friendly Portlets replacement. This AJAX-let is actually probably what Microsoft has already done on their start.com web site. Now with AJAX, I just wish Javascript would evolve (a lot) or die to be more OO friendly.




Portlets in an AJAX World

Recently, I have had my first encounter with Portlets although Portlets are not very new. IBM had their own Portlet API before the JSR 168 was final in 2003. Unfortunately both approaches are quite different and IBM does not recommend the use of their own API.

Portlets were a needed concept for a long time. I worked in 2000 on a java portal system and it would have been handy at that time. Portals are everywhere since the internet bubble.

But Portlets do not do that much either. Sites designed with strict and intelligent rules can bypass the portlets need for example by using a combination of custom tags and java beans.

What shocks me a bit more is that while not doing much, it looks a bit old fashioned already. With AJAX you could build very flexible and user-friendly Portlets replacement. This AJAX-let is actually probably what Microsoft has already done on their start.com web site. Now with AJAX, I just wish Javascript would evolve (a lot) or die to be more OO friendly.




Thursday, November 17, 2005

Good Software Books

A friend asked me for a list, here is it. I found those books the most interesting ones among those I have read about software in the past year or two:
  • Artificial Intelligence through Prolog, by Neil C. Rowe (Prentice-Hall): if you don't remember much about Prolog, it's a good book. It details how Prolog interpreters work.
  • File Systems Forensic Analysis, by Brian Carrier (Addison Wesley): everything you need to know about disks and file systems, every trick to recover lost data. To go more in depth into file systems theory, you can read the free Practical File System Design with the Be File System from D. Giampaolo, the creator of BeFS.
  • Mind Hacks (O'Reilly): you probably already bought that one. Not about software, but excellent.
  • Practical Issues in Database Management by Fabian Pascal (Addison Wesley): short but concise book on relational database theory. F Pascal is of CJ Date school of thoughts, "null are evil". You don't need to read it if you have read any other similar book (by CJ Date for example).
  • Inside The Java Virtual Machine, by Bill Venners (McGraw-Hill): there are other books on the same subject. While this book has some bad reviews, I found it an easy read, and it explain well enough for me all the inner details of Java. I found "Programming for the Java Virtual Machine" not better, and with some bad example of a Prolog language for the JVM (1 full chapter for this to present a way too simple thing to be of any use).
  • Programming Jabber, by O'Reilly: I have read it 2 years ago, I enjoyed how they made you go through building a Jabber server.
  • Lucene In Action: the only book about Lucene, some of the info is useful to understand how it is designed.
  • Hibernate In Action: if you have to use hibernate, this is the book to read. It presents different ways of using it.
  • some Javascript+DHTML(+CSS) book: useful if you have none. They often have good tricks to solve the usual problems. In the AJAX days, it becomes useful again. I find O'Reilly's "Javascript - The Definitive Guide" good to have an API reference (as ebook), and "Javascript and DHTML Cookbook" has the most useful recipes.
  • Lean Software Development by Poppendieck (Addison Wesley): easy to read, good presentation of software dev management problems and pragmatic solutions. My favorite on the subject. Another good one but very specific is "Requirements Management" (MS Press).
  • UML Distilled by M Fowler: always useful to have if you need to draw UML diagrams.

Good luck!
Tags:

Good Software Books

A friend asked me for a list, here is it. I found those books the most interesting ones among those I have read about software in the past year or two:
  • Artificial Intelligence through Prolog, by Neil C. Rowe (Prentice-Hall): if you don't remember much about Prolog, it's a good book. It details how Prolog interpreters work.
  • File Systems Forensic Analysis, by Brian Carrier (Addison Wesley): everything you need to know about disks and file systems, every trick to recover lost data. To go more in depth into file systems theory, you can read the free Practical File System Design with the Be File System from D. Giampaolo, the creator of BeFS.
  • Mind Hacks (O'Reilly): you probably already bought that one. Not about software, but excellent.
  • Practical Issues in Database Management by Fabian Pascal (Addison Wesley): short but concise book on relational database theory. F Pascal is of CJ Date school of thoughts, "null are evil". You don't need to read it if you have read any other similar book (by CJ Date for example).
  • Inside The Java Virtual Machine, by Bill Venners (McGraw-Hill): there are other books on the same subject. While this book has some bad reviews, I found it an easy read, and it explain well enough for me all the inner details of Java. I found "Programming for the Java Virtual Machine" not better, and with some bad example of a Prolog language for the JVM (1 full chapter for this to present a way too simple thing to be of any use).
  • Programming Jabber, by O'Reilly: I have read it 2 years ago, I enjoyed how they made you go through building a Jabber server.
  • Lucene In Action: the only book about Lucene, some of the info is useful to understand how it is designed.
  • Hibernate In Action: if you have to use hibernate, this is the book to read. It presents different ways of using it.
  • some Javascript+DHTML(+CSS) book: useful if you have none. They often have good tricks to solve the usual problems. In the AJAX days, it becomes useful again. I find O'Reilly's "Javascript - The Definitive Guide" good to have an API reference (as ebook), and "Javascript and DHTML Cookbook" has the most useful recipes.
  • Lean Software Development by Poppendieck (Addison Wesley): easy to read, good presentation of software dev management problems and pragmatic solutions. My favorite on the subject. Another good one but very specific is "Requirements Management" (MS Press).
  • UML Distilled by M Fowler: always useful to have if you need to draw UML diagrams.

Good luck!
Tags:

Wednesday, November 16, 2005

Apple Rumors and X86 first move

I find the mac mini a particularly compelling computer. It is small, noise friendly, relatively cheap. If you want to have a cheap home server (based on Linux or MacOS X), this is quite a good choice as you probably don't want to hear all the fans of bigger computers the whole day. It's also a very good candidate for a media box: you can connect a huge hard drive for mp3s, and watch your DVDs, photos on a nice LCD (and MacOS helps here).

Unfortunately it might not be the best moment to buy it now. There are rumors everywhere that the first Mac Intel will be presented in January. And I am quite confident that this Mac Intel will be the Mac Mini. Here are the reasons:
  • PowerMacs and iMacs use the quite modern G5 processor. It makes sense to update the very old G4 to Intel first.
  • if iBook was updated, it would be much more attractive than the Powerbook.
This leaves us with either powerbook upgrade or mac mini upgrade, but:
  • XBox 360 has almost arrived. While not a direct competitor, it can be used as media center, it is cheap and powerful. Unfortunately it's not customizable enough.
  • Powerbooks got a recent update. They are advertised heavily on apple websites, while the mac mini had just a silent and minor upgrade and is not advertised anymore.

Tags: , , ,


Apple Rumors and X86 first move

I find the mac mini a particularly compelling computer. It is small, noise friendly, relatively cheap. If you want to have a cheap home server (based on Linux or MacOS X), this is quite a good choice as you probably don't want to hear all the fans of bigger computers the whole day. It's also a very good candidate for a media box: you can connect a huge hard drive for mp3s, and watch your DVDs, photos on a nice LCD (and MacOS helps here).

Unfortunately it might not be the best moment to buy it now. There are rumors everywhere that the first Mac Intel will be presented in January. And I am quite confident that this Mac Intel will be the Mac Mini. Here are the reasons:
  • PowerMacs and iMacs use the quite modern G5 processor. It makes sense to update the very old G4 to Intel first.
  • if iBook was updated, it would be much more attractive than the Powerbook.
This leaves us with either powerbook upgrade or mac mini upgrade, but:
  • XBox 360 has almost arrived. While not a direct competitor, it can be used as media center, it is cheap and powerful. Unfortunately it's not customizable enough.
  • Powerbooks got a recent update. They are advertised heavily on apple websites, while the mac mini had just a silent and minor upgrade and is not advertised anymore.

Tags: , , ,


Monday, November 07, 2005

7 Years Later: Still EJBs

In 1998, a student of my school had a project with Sun about EJBs. This was the beginning of EJBs, they were not public, and there was no J2EE. At that time he found it utterly complicated, and had difficulties to understand why they made it so complicated.

In 2000, I worked for a company who had built in-house most components of a today J2EE application server. For example, they had their own unified messaging system, on the JSP side, they were already using custom tags, etc.. Their problem is that they took lots of time to develop in-house, all what later became standard, and almost freely available.

Today, 7 years later, the big talk, new Java products, be it Spring, or JBoss Seam, are still all about the same ideas as in the first J2EE. Spring has the freedom to include whatever technology, but in the end, their scope closely matches J2EE scope. Service Oriented Architecture (SOA), the current buzzword, will come out relatively naturally with J2EE, session EJBs being natural candidate to expose functionalities to the outer world. JBoss (or Geronimo) architecture is fully SOA: a small kernel managing services, that are exposed for other to use.

To learn about EJBs, I still find Enterprise JavaBeans by Richard Monson-Haefel, the best book. The chapter (in the 2nd Edition of the book, not in the 4th unfortunately) where he rolls his own distributed objects system is for me a testimony on how well he wants you to understand what's behind EJBs. And if you want to better understand what's behind RMI, Java Distributed Computing (O'Reilly) has a chapter where the author rolls his own RMI.

To conclude, Sun was really clever in defining J2EE scope and branding several Java technologies as J2EE (despite the awful version naming). While the ideas were very good, the developer's life was forgotten. It was too much a pain in the a** and not flexible enough (especially the ORM side). JBoss gets it right, what people need is a way to use pieces of J2EE, without imposing too much unnecessary hurdle on development.

Tags: , , ,

7 Years Later: Still EJBs

In 1998, a student of my school had a project with Sun about EJBs. This was the beginning of EJBs, they were not public, and there was no J2EE. At that time he found it utterly complicated, and had difficulties to understand why they made it so complicated.

In 2000, I worked for a company who had built in-house most components of a today J2EE application server. For example, they had their own unified messaging system, on the JSP side, they were already using custom tags, etc.. Their problem is that they took lots of time to develop in-house, all what later became standard, and almost freely available.

Today, 7 years later, the big talk, new Java products, be it Spring, or JBoss Seam, are still all about the same ideas as in the first J2EE. Spring has the freedom to include whatever technology, but in the end, their scope closely matches J2EE scope. Service Oriented Architecture (SOA), the current buzzword, will come out relatively naturally with J2EE, session EJBs being natural candidate to expose functionalities to the outer world. JBoss (or Geronimo) architecture is fully SOA: a small kernel managing services, that are exposed for other to use.

To learn about EJBs, I still find Enterprise JavaBeans by Richard Monson-Haefel, the best book. The chapter (in the 2nd Edition of the book, not in the 4th unfortunately) where he rolls his own distributed objects system is for me a testimony on how well he wants you to understand what's behind EJBs. And if you want to better understand what's behind RMI, Java Distributed Computing (O'Reilly) has a chapter where the author rolls his own RMI.

To conclude, Sun was really clever in defining J2EE scope and branding several Java technologies as J2EE (despite the awful version naming). While the ideas were very good, the developer's life was forgotten. It was too much a pain in the a** and not flexible enough (especially the ORM side). JBoss gets it right, what people need is a way to use pieces of J2EE, without imposing too much unnecessary hurdle on development.

Tags: , , ,

Friday, November 04, 2005

Job Hunting: Interview Madness

I have been doing interviews those past weeks. Today I had to present my resume for the N time where N is big. It is very boring. In France, it is common to have 5 interviews for a small company (that says a bit about how people trust each other and makes me envy Germany where the practice is to select very strictly on the resume and be more relax about interviews). But all those interviews give a valuable insight on the current market, and on some companies.

0. The Monster Rage

The first 2 days after I put my resume on Monster France, I got more than 15 calls from consulting companies. The following day, I removed my resume from Monster.


1. Interviewing People

When I started working, I was very bad at interviews, I had a good academic record and thought companies ringing me would have been interested automatically. I supposed most people were dedicated to their work and did not bother doing a show, I was passive. So I often failed the interview process at the HR level.

Now I am doing the show everybody expects and it always works. Only one person asked me an unusual, clever question: "Do you write?" or
"Do you like to write?"

I am often more stressed by technical interviews as I find technical interviews can more easily be very badly done. Even specialists don't agree on a good method, cf the artima article on How to Interview a Programmer. If someone asks you about some intricate details he knows lots about and you don't, or you used to but you don't remember, then that person can have a bad impression of you. In Java, this can be the supposedly trivial ,"what classes do you have to implement for an EJB ?". I have done many EJBs in the past, but that was a long time enough that I need to look up somewhere to find the exact and precise answer. It is much better to ask someone about what he recently did, or about someone's view on general subjects, especially subjects he knows about.


2. Interviewing Companies


As a junior in the business world, I had a very angelic view of companies. I had been lucky enough to do internships around very good people. But nowadays, I am starting to find difficult to pick a good company to work for. I found one question especially useful to find out more about your future mates:
"What do you like in this company?"
and try to get to know the answer of "Why did you go there?"


3. The $$$ in Current Market

There seem to be huge disparities in salaries in France. I found consulting companies were very reticent to offer a market salary. More regular companies can either offer a much lower salary than the market one, a market salary, or a much higher one, for the same job!

Job Hunting: Interview Madness

I have been doing interviews those past weeks. Today I had to present my resume for the N time where N is big. It is very boring. In France, it is common to have 5 interviews for a small company (that says a bit about how people trust each other and makes me envy Germany where the practice is to select very strictly on the resume and be more relax about interviews). But all those interviews give a valuable insight on the current market, and on some companies.

0. The Monster Rage

The first 2 days after I put my resume on Monster France, I got more than 15 calls from consulting companies. The following day, I removed my resume from Monster.


1. Interviewing People

When I started working, I was very bad at interviews, I had a good academic record and thought companies ringing me would have been interested automatically. I supposed most people were dedicated to their work and did not bother doing a show, I was passive. So I often failed the interview process at the HR level.

Now I am doing the show everybody expects and it always works. Only one person asked me an unusual, clever question: "Do you write?" or
"Do you like to write?"

I am often more stressed by technical interviews as I find technical interviews can more easily be very badly done. Even specialists don't agree on a good method, cf the artima article on How to Interview a Programmer. If someone asks you about some intricate details he knows lots about and you don't, or you used to but you don't remember, then that person can have a bad impression of you. In Java, this can be the supposedly trivial ,"what classes do you have to implement for an EJB ?". I have done many EJBs in the past, but that was a long time enough that I need to look up somewhere to find the exact and precise answer. It is much better to ask someone about what he recently did, or about someone's view on general subjects, especially subjects he knows about.


2. Interviewing Companies


As a junior in the business world, I had a very angelic view of companies. I had been lucky enough to do internships around very good people. But nowadays, I am starting to find difficult to pick a good company to work for. I found one question especially useful to find out more about your future mates:
"What do you like in this company?"
and try to get to know the answer of "Why did you go there?"


3. The $$$ in Current Market

There seem to be huge disparities in salaries in France. I found consulting companies were very reticent to offer a market salary. More regular companies can either offer a much lower salary than the market one, a market salary, or a much higher one, for the same job!

Thursday, October 27, 2005

Does Eclipse Rot The Brain?

Slashdot presented a really insightful article on Visual Studio by Charles Petzold called Does Visual Studio Rot the Mind. Interestingly it seems that Eclipse does things better than the future Visual Studio.
  • Autocomplete in Eclipse is really good and does not suffer of the bottom-up problem M. Petzold mentioned, nor from the forced CTRL-Z.
  • There is no Form designer, and in Java it has been the practice to lay out forms programmatically. The Java Layouts have always been scalable, and Java programs very rarely rely on pixels.
  • There is no unnecessary import statements.
His positive feedback on XAML is interesting, especially since he thinks this allows for a better automatic UI.

More importantly, he makes a good point on the exponential increase of method/classes/properties names to use for a regular programmer. This raises a serious question about how viable are the current tools.

Does Eclipse Rot The Brain?

Slashdot presented a really insightful article on Visual Studio by Charles Petzold called Does Visual Studio Rot the Mind. Interestingly it seems that Eclipse does things better than the future Visual Studio.
  • Autocomplete in Eclipse is really good and does not suffer of the bottom-up problem M. Petzold mentioned, nor from the forced CTRL-Z.
  • There is no Form designer, and in Java it has been the practice to lay out forms programmatically. The Java Layouts have always been scalable, and Java programs very rarely rely on pixels.
  • There is no unnecessary import statements.
His positive feedback on XAML is interesting, especially since he thinks this allows for a better automatic UI.

More importantly, he makes a good point on the exponential increase of method/classes/properties names to use for a regular programmer. This raises a serious question about how viable are the current tools.

Tuesday, October 18, 2005

Orkut Statistics and Blog Evolution

I was just having a look at orkut again. As in my last look in the past year, there is not much new or interesting. The technical forums are mostly uninteresting and it almost looks like nothing is going on. Take a look at the orkut java forums, in 1 year, very few messages are good.

Compare that to javablogs.com blogs aggregation, every week there are many interesting posts. The blog model is good because it is targeted at people who want to write. When you blog, you build a history. Forums don't let you do that. You could have a social model on top of blogs, and I am sure this will be one of their next evolution.

I found one good page, the orkut statistics:
  1. Brasil is number one country with almost 75% of the people from there. I wonder why they find it that much better than alternatives. It's strange how something can be successful somewhere and not somewhere else.
  2. US represent only 7.8%.
  3. Iran and Pakistan represent 6%, that is almost the equivalent of the US. I was very surprised by that.
  4. Europe does not exist there.
More than 50¨% of the orkutians are under 25, which probably explains why not much is going on there.

Tags: , ,

Orkut Statistics and Blog Evolution

I was just having a look at orkut again. As in my last look in the past year, there is not much new or interesting. The technical forums are mostly uninteresting and it almost looks like nothing is going on. Take a look at the orkut java forums, in 1 year, very few messages are good.

Compare that to javablogs.com blogs aggregation, every week there are many interesting posts. The blog model is good because it is targeted at people who want to write. When you blog, you build a history. Forums don't let you do that. You could have a social model on top of blogs, and I am sure this will be one of their next evolution.

I found one good page, the orkut statistics:
  1. Brasil is number one country with almost 75% of the people from there. I wonder why they find it that much better than alternatives. It's strange how something can be successful somewhere and not somewhere else.
  2. US represent only 7.8%.
  3. Iran and Pakistan represent 6%, that is almost the equivalent of the US. I was very surprised by that.
  4. Europe does not exist there.
More than 50¨% of the orkutians are under 25, which probably explains why not much is going on there.

Tags: , ,

Monday, October 10, 2005

Spring Books Roundup Updated

I am completing my Spring Books Roundup books with 2 new books:
  • Pro Spring, by Apress: a lengthy book, with some unnecessary information, but good overall. I did not like the Part 1, there is not much content in it. Fortunately, Part 2 is much better, dependency injection is very well described, almost on par, with the Fowler article of reference. Other Spring areas are well covered, in a similar manner as in Wrox book, except Java Server Faces, absent from the book, and nothing on Swing as well.
  • Spring Reference Documentation, from the springframework.org website: I should have started with this one, it is of very good quality, and more up-to-date. There is notably a very good chapter on "Source Level Metadata Support" even if I don't find particularly compelling that they chose yet another abstraction behind Java 5 annotations, partly to support older JDKs. Another plus is a chapter on JMX support, this was lacking in other books.
Interestingly most other books are very similar to the reference documentation, in their presentation and content. The reference documentation is extremely well written. Each time the author carefully explains what are the advantages of the Spring solution, or what does a particular feature solve. Only dependency injection and swing are not treated properly.

To conclude, to best learn Spring I would advise:
  1. Read Fowler article about dependency injection.
  2. Read O'Reilly's A Developer Notebook. It is the most appropriate book, because the presentation is a bit different, focusing on quickly understanding Spring and using it in your project, and it is the only one mentioning Swing Spring features.
  3. Read the reference manual to find out about the details you need for a specific feature.
Tags: , , ,

Spring Books Roundup Updated

I am completing my Spring Books Roundup books with 2 new books:
  • Pro Spring, by Apress: a lengthy book, with some unnecessary information, but good overall. I did not like the Part 1, there is not much content in it. Fortunately, Part 2 is much better, dependency injection is very well described, almost on par, with the Fowler article of reference. Other Spring areas are well covered, in a similar manner as in Wrox book, except Java Server Faces, absent from the book, and nothing on Swing as well.
  • Spring Reference Documentation, from the springframework.org website: I should have started with this one, it is of very good quality, and more up-to-date. There is notably a very good chapter on "Source Level Metadata Support" even if I don't find particularly compelling that they chose yet another abstraction behind Java 5 annotations, partly to support older JDKs. Another plus is a chapter on JMX support, this was lacking in other books.
Interestingly most other books are very similar to the reference documentation, in their presentation and content. The reference documentation is extremely well written. Each time the author carefully explains what are the advantages of the Spring solution, or what does a particular feature solve. Only dependency injection and swing are not treated properly.

To conclude, to best learn Spring I would advise:
  1. Read Fowler article about dependency injection.
  2. Read O'Reilly's A Developer Notebook. It is the most appropriate book, because the presentation is a bit different, focusing on quickly understanding Spring and using it in your project, and it is the only one mentioning Swing Spring features.
  3. Read the reference manual to find out about the details you need for a specific feature.
Tags: , , ,

Spring Books Roundup

Spring is hip these days, so I decided to learn a bit more about it. I had used Avalon a while ago, I was attracted by its design by component and the way it seemed to lay out a proper infrastructure to build a server application. In the end, I was a bit disappointed, it required a bit too much glue code for my taste and did not provide that much in exchange. I don't remember if, at that time, it was advertised as IoC (Inversion Of Control) container. This experience is one of the reasons why I did not jump on the Spring ship.
I have read 3 books, here is what I thought of them, briefly:
  • Spring: A Developer's Notebook, by O'Reilly: I enjoyed reading that book, because it is well written and has a good structure. It explains what is dependency injection by doing it without Spring, with Spring. But for a more complete understanding, I would recommend Fowler article. There is an interesting chapter on Swing with Spring. Minor drawbacks is that it does not talk about Spring Timers and has very little on Remoting. But I would recommend that book.
  • Spring In Action, by Manning: I was disappointed by that one, because there is not much more information than in O'Reilly, it is a bit less practical to use. While it is a bit more detailed than O'Reilly, I did not find the extra information very useful in general. Remoting is better covered here than in O'Reilly, but there is nothing on Swing.
  • Professional Java Development With The Sring Frampework, by Wrox: I liked that one better than Manning, but again information inside is very similar. I find the explanations more complete. Inversion Of Control is well presented (it is even comparing constructor injection with method injection). It gives examples of alternatives to XML configuration. Remoting is covered in greater details than Manning. I would recommend it over Manning anytime, and if it included a Swing chapter, I would recommend it over O'Reilly as well.
You can wonder a bit why there are 3 books on Spring, that similar. I believe there is space for other intelligent presentations of Spring. Subjects are often treated superficially. For example, look at the Fowler article versus the best chapter about IoC, the one from Wrox, and you'll see how much more detailed it could have been. I find it a bit shocking since IoC is the basis of Spring. It would have been good to see a book explaining why Spring chose that particular design over another, for the main features, and presenting alternatives better. I would also have welcomed a book explaining the use of maybe just a few Spring aspects, but in the frame of a big, commercial application. For example after reading those books, it is not immediately clear to me what are Spring benefits when using Swing support versus other solutions. Another critic is that all those books were written around the same time, and are sometimes already obsolete. None of them describes Spring JDK 1.5 support (for transactions or JMX or metadata). The official free Spring reference book seems better in many ways.

Those books showed me Spring could be useful in some projects:
  • if you want remoting.
  • if you want to promote clean code, then you can promote the "Spring way". It is a good one.
  • if you want to use JSF. Spring makes JSF easy and natural to use.
On top of it you get AOP for easy debugging or profiling, which is always useful at some point.

I am not convinced about Spring when it comes to:
  • JDBC or database use: while Spring has a well done framework, Hibernate or iBatis have a very good API that makes Spring abstraction useless.
  • MVC: it is does seem that much better than alternatives, nor much less intrusive (OK you can test it easily). Anyway I am not that big a fan of web MVC after having seen real world .NET projects without strict MVC well maintainable. I find the JSF backing beans at least as good and more flexible. Continuation frameworks are interesting too, but I am worried of their performance impact and scalability.
  • Transactions: I just don't think manual transactions are that bad or ugly or less maintainable. But using Spring for them is not necessarily a bad idea either.
To me, the main alternative to Spring, and a very good one, is JBoss. I will elaborate on that subject later in another post.

Categories: , , ,

Spring Books Roundup

Spring is hip these days, so I decided to learn a bit more about it. I had used Avalon a while ago, I was attracted by its design by component and the way it seemed to lay out a proper infrastructure to build a server application. In the end, I was a bit disappointed, it required a bit too much glue code for my taste and did not provide that much in exchange. I don't remember if, at that time, it was advertised as IoC (Inversion Of Control) container. This experience is one of the reasons why I did not jump on the Spring ship.
I have read 3 books, here is what I thought of them, briefly:
  • Spring: A Developer's Notebook, by O'Reilly: I enjoyed reading that book, because it is well written and has a good structure. It explains what is dependency injection by doing it without Spring, with Spring. But for a more complete understanding, I would recommend Fowler article. There is an interesting chapter on Swing with Spring. Minor drawbacks is that it does not talk about Spring Timers and has very little on Remoting. But I would recommend that book.
  • Spring In Action, by Manning: I was disappointed by that one, because there is not much more information than in O'Reilly, it is a bit less practical to use. While it is a bit more detailed than O'Reilly, I did not find the extra information very useful in general. Remoting is better covered here than in O'Reilly, but there is nothing on Swing.
  • Professional Java Development With The Sring Frampework, by Wrox: I liked that one better than Manning, but again information inside is very similar. I find the explanations more complete. Inversion Of Control is well presented (it is even comparing constructor injection with method injection). It gives examples of alternatives to XML configuration. Remoting is covered in greater details than Manning. I would recommend it over Manning anytime, and if it included a Swing chapter, I would recommend it over O'Reilly as well.
You can wonder a bit why there are 3 books on Spring, that similar. I believe there is space for other intelligent presentations of Spring. Subjects are often treated superficially. For example, look at the Fowler article versus the best chapter about IoC, the one from Wrox, and you'll see how much more detailed it could have been. I find it a bit shocking since IoC is the basis of Spring. It would have been good to see a book explaining why Spring chose that particular design over another, for the main features, and presenting alternatives better. I would also have welcomed a book explaining the use of maybe just a few Spring aspects, but in the frame of a big, commercial application. For example after reading those books, it is not immediately clear to me what are Spring benefits when using Swing support versus other solutions. Another critic is that all those books were written around the same time, and are sometimes already obsolete. None of them describes Spring JDK 1.5 support (for transactions or JMX or metadata). The official free Spring reference book seems better in many ways.

Those books showed me Spring could be useful in some projects:
  • if you want remoting.
  • if you want to promote clean code, then you can promote the "Spring way". It is a good one.
  • if you want to use JSF. Spring makes JSF easy and natural to use.
On top of it you get AOP for easy debugging or profiling, which is always useful at some point.

I am not convinced about Spring when it comes to:
  • JDBC or database use: while Spring has a well done framework, Hibernate or iBatis have a very good API that makes Spring abstraction useless.
  • MVC: it is does seem that much better than alternatives, nor much less intrusive (OK you can test it easily). Anyway I am not that big a fan of web MVC after having seen real world .NET projects without strict MVC well maintainable. I find the JSF backing beans at least as good and more flexible. Continuation frameworks are interesting too, but I am worried of their performance impact and scalability.
  • Transactions: I just don't think manual transactions are that bad or ugly or less maintainable. But using Spring for them is not necessarily a bad idea either.
To me, the main alternative to Spring, and a very good one, is JBoss. I will elaborate on that subject later in another post.

Categories: , , ,

Thursday, September 29, 2005

Interesting Plug-In Framework - DPML Transit

Today, I just found out about DPML Transit, it is a small framework that helps you build plug-ins based software. It seems to work a bit with DPML Magic, their build system based upon Ant. Both are quite interesting, since in big projects, you often end up with a packaging per component (which DPML Magic seems to make very simple) and a versioning of those components. DPML Transit allows then for an efficient way to look up a particular version of one component.

I have not heard of DPML before, they seem to write useful software. Has anybody used those frameworks already?

Tags: , ,

Interesting Plug-In Framework - DPML Transit

Today, I just found out about DPML Transit, it is a small framework that helps you build plug-ins based software. It seems to work a bit with DPML Magic, their build system based upon Ant. Both are quite interesting, since in big projects, you often end up with a packaging per component (which DPML Magic seems to make very simple) and a versioning of those components. DPML Transit allows then for an efficient way to look up a particular version of one component.

I have not heard of DPML before, they seem to write useful software. Has anybody used those frameworks already?

Tags: , ,

Wednesday, September 28, 2005

Java Puzzlers - Can you figure this out?

The book Java Puzzlers is quite good. I don't think anyone can get every puzzle right. This shows again how you can very easily make someone fail interviews if you ask too silly questions. I suppose that if people were asking those questions they would not expect the right answers, but study the candidate reactions.

Here is a sample:

public class DosEquis {
  public static void main(String[] args) {
    char x = 'X';
    int i = 0;
    System.out.print(true ? x : 0);
    System.out.print(false ? i : x);
  }
}


This will output "X88". Obviously this is not good code, which is precisely one of the book objectives: to show how bad some practices can be. But at the same time you learn a bit more about the Java language and its possibilities. In the latter chapters they have more interesting puzzles.

Tags: , ,

Java Puzzlers - Can you figure this out?

The book Java Puzzlers is quite good. I don't think anyone can get every puzzle right. This shows again how you can very easily make someone fail interviews if you ask too silly questions. I suppose that if people were asking those questions they would not expect the right answers, but study the candidate reactions.

Here is a sample:

public class DosEquis {
  public static void main(String[] args) {
    char x = 'X';
    int i = 0;
    System.out.print(true ? x : 0);
    System.out.print(false ? i : x);
  }
}


This will output "X88". Obviously this is not good code, which is precisely one of the book objectives: to show how bad some practices can be. But at the same time you learn a bit more about the Java language and its possibilities. In the latter chapters they have more interesting puzzles.

Tags: , ,

Monday, September 26, 2005

Is Prolog Better Suited Than SQL?

I am currently reading a Prolog book "Artificial Intelligence Through Prolog", I have been doing a bit of Prolog when I was very young and wanted to refresh my memory a bit. It is a very interesting read, especially when I take the viewpoint of our current application where no ACID compliance is required.

It seems to me that all the logic we coded to parametrize SQL queries and construct them dynamically could have been avoided if we had chosen Prolog as Prolog expressions would have been very natural to use in our project. With Prolog, there is no need to think about joins, type of joins, SQL syntax. It is at the level just higher. I wonder very much why Prolog did not become more mainstream as it seems to solve some problems in a much nicer, natural way.
Here is a short example to get reviews of things by user or by user and tags or ...:
  1. let's define some facts:
    • is_tag(tag1, user1, thing_id)
    • is_tag(tag2, user1, thing_id)
    • ...
    • review(user1, thing_id, description, extended, date)
    • ...
  2. review for user "user_x"
    • ?review(user_x, THING_ID, DESC, EXT, DATE)
  3. review for user "user_x" with tag "tag_y"
    • ?review(user_x, THING_ID, DESC, EXT, DATE), is_tag(tag_y, user_x, THING_ID)
We could imagine some better ways to lay out information. This is just a first draft.

Now of course, Prolog does not necessary makes sense for us because:
a) We already have it working in SQL
b) SQL is much more used and should therefore be more tunable, stable, etc.

Still the Prolog way of things is interesting and powerful. We could have written a code with a logic near Prolog instead of our custom code.
Tags:

Is Prolog Better Suited Than SQL?

I am currently reading a Prolog book "Artificial Intelligence Through Prolog", I have been doing a bit of Prolog when I was very young and wanted to refresh my memory a bit. It is a very interesting read, especially when I take the viewpoint of our current application where no ACID compliance is required.

It seems to me that all the logic we coded to parametrize SQL queries and construct them dynamically could have been avoided if we had chosen Prolog as Prolog expressions would have been very natural to use in our project. With Prolog, there is no need to think about joins, type of joins, SQL syntax. It is at the level just higher. I wonder very much why Prolog did not become more mainstream as it seems to solve some problems in a much nicer, natural way.
Here is a short example to get reviews of things by user or by user and tags or ...:
  1. let's define some facts:
    • is_tag(tag1, user1, thing_id)
    • is_tag(tag2, user1, thing_id)
    • ...
    • review(user1, thing_id, description, extended, date)
    • ...
  2. review for user "user_x"
    • ?review(user_x, THING_ID, DESC, EXT, DATE)
  3. review for user "user_x" with tag "tag_y"
    • ?review(user_x, THING_ID, DESC, EXT, DATE), is_tag(tag_y, user_x, THING_ID)
We could imagine some better ways to lay out information. This is just a first draft.

Now of course, Prolog does not necessary makes sense for us because:
a) We already have it working in SQL
b) SQL is much more used and should therefore be more tunable, stable, etc.

Still the Prolog way of things is interesting and powerful. We could have written a code with a logic near Prolog instead of our custom code.
Tags:

Wednesday, September 21, 2005

When California Was An Island


This is from an old (1680s) big (2 tons) Coronelli globe, currently displayed in Grand Palais, Paris. Can you spot San Francisco there?

When California Was An Island


This is from an old (1680s) big (2 tons) Coronelli globe, currently displayed in Grand Palais, Paris. Can you spot San Francisco there?

Friday, September 16, 2005

Currying - A Very Interesting Use Of Generics

In bamboo-dht, a distributed java hashtable project, the main developer, Sean C. Rhea, advocates the use of Curries and Thunks (of LISP and ML). He wrote an interesting and valuable document, Async Tutorial, presenting a use of it. I will present the concept here shortly:

public interface Thunk1<T> { void run (T t ) ; }

Thunk1<Integer> intThunk = new Thunk1<Integer>() {
void run (Integer i ) { System.out.println( i ) ; }
}

public static <T> Runnable curry(final Thunk1<T> f ,final T t ) {
return new Runnable () { public void run ( ) { f.run ( t ) ; } } ;
}

Runnable print42 = curry( intThunk , new Integer ( 42 ) ) ;
print42.run ( ) ; //prints 42 to standard output


So it is a very clever way to have a callback in java. Very clever because you can declare your code to take only a run(), and pass any parameter in it by using a curry. It is very simple to use, even if the small framework around it can scare some people.

However neat the idea is, I am not sure it is practically useful. Sean C. Rhea used that because he did not want to use "unnecessary" instance variables. Ok, but the curry is still creating another instance (actually 2 but one could be static), is the overhead of a class instance without variables that much more than one with variables? And there is another way, without the Curry framework:

Runnable print42 = new Runnable({ public void run() {intThunk.run(new Integer(42));}});

print42.run();

This is actually exactly what the Curry framework would do behind the scenes. The Curry framework makes it a bit more elegant, but I am not sure if that's really more readable for most programmers. I would personally advise the traditional way, use instance variables.

Tags: ,

Currying - A Very Interesting Use Of Generics

In bamboo-dht, a distributed java hashtable project, the main developer, Sean C. Rhea, advocates the use of Curries and Thunks (of LISP and ML). He wrote an interesting and valuable document, Async Tutorial, presenting a use of it. I will present the concept here shortly:

public interface Thunk1<T> { void run (T t ) ; }

Thunk1<Integer> intThunk = new Thunk1<Integer>() {
void run (Integer i ) { System.out.println( i ) ; }
}

public static <T> Runnable curry(final Thunk1<T> f ,final T t ) {
return new Runnable () { public void run ( ) { f.run ( t ) ; } } ;
}

Runnable print42 = curry( intThunk , new Integer ( 42 ) ) ;
print42.run ( ) ; //prints 42 to standard output


So it is a very clever way to have a callback in java. Very clever because you can declare your code to take only a run(), and pass any parameter in it by using a curry. It is very simple to use, even if the small framework around it can scare some people.

However neat the idea is, I am not sure it is practically useful. Sean C. Rhea used that because he did not want to use "unnecessary" instance variables. Ok, but the curry is still creating another instance (actually 2 but one could be static), is the overhead of a class instance without variables that much more than one with variables? And there is another way, without the Curry framework:

Runnable print42 = new Runnable({ public void run() {intThunk.run(new Integer(42));}});

print42.run();

This is actually exactly what the Curry framework would do behind the scenes. The Curry framework makes it a bit more elegant, but I am not sure if that's really more readable for most programmers. I would personally advise the traditional way, use instance variables.

Tags: ,

Tuesday, September 13, 2005

On J2EE Portability Accross Application Servers

Brian Alexander Lee wrote:
"dismal interview where I asked about the candidate's experience with porting a J2EE application from WebLogic to WebSphere (which was listed on his resume). The candidate said that it was very easy and he just deployed his application with no problems or changes necessary, he had no changes made for the application to run properly. This was one of many bad signs for the candidate."

I disagree. I would even use his example to show that the portability game is more about configuration and packaging rather than about anything else so that many developers would in-deed not see a big deal into porting an application to a new application server.

You can make a port to Websphere or Weblogic quite transparent if you externalize the JNDI strings (for example in properties file), which is anyway what you should do. Repeating a same string everywhere in your code is bad practice in Java.
The most problematic is usually the packaging, weblogic and websphere, for example used to manage the jar dependencies a different way (websphere being very strict, weblogic a bit more practicle). And actually JNDI settings, DataSources and Security should boil down to packaging problems, which is why, I think, your candidate did not know of any problem unless he worked on the packaging of the app.

Recruitment is no easy task. I did not find yet a magic formula for it, except maybe, try the person for a month. Personality is more important than knowing technical details. I am not sure if one can see if a person is serious, rigorous, and reasonably fast in an interview.

On J2EE Portability Accross Application Servers

Brian Alexander Lee wrote:
"dismal interview where I asked about the candidate's experience with porting a J2EE application from WebLogic to WebSphere (which was listed on his resume). The candidate said that it was very easy and he just deployed his application with no problems or changes necessary, he had no changes made for the application to run properly. This was one of many bad signs for the candidate."

I disagree. I would even use his example to show that the portability game is more about configuration and packaging rather than about anything else so that many developers would in-deed not see a big deal into porting an application to a new application server.

You can make a port to Websphere or Weblogic quite transparent if you externalize the JNDI strings (for example in properties file), which is anyway what you should do. Repeating a same string everywhere in your code is bad practice in Java.
The most problematic is usually the packaging, weblogic and websphere, for example used to manage the jar dependencies a different way (websphere being very strict, weblogic a bit more practicle). And actually JNDI settings, DataSources and Security should boil down to packaging problems, which is why, I think, your candidate did not know of any problem unless he worked on the packaging of the app.

Recruitment is no easy task. I did not find yet a magic formula for it, except maybe, try the person for a month. Personality is more important than knowing technical details. I am not sure if one can see if a person is serious, rigorous, and reasonably fast in an interview.

Monday, September 12, 2005

JavaBlogs Weekly Top 10 and Java HTML parsing

I took some time to continue my little JavaBlogs analysis, I now have a page summarizing the top 10 most read blog entries in the last week. The page is generated every 24h (this is why there is no 'best progression' as of today).

I also fixed some bugs related to HTML in RSS2. I understand a bit better why a RSS 1.0 co-author decided to remove the possibility of HTML descriptions for RSS 3.0. It often does not make sense to keep all that information about styles, fonts, etc. from different sources. What I do is rewrite the HTML, allowing only b,i,a,p,br tags, with the style information stripped. I found the open-source htmlparser java library quite helpful to achieve that.

Mai 2006 Update
I now post the top10 every week to my blog, I wrote a little piece on how to interact with Blogger API in Java. This avoids me having to maintain an extra site.
HTTP requests handling is done using commons-httpclient library to have more control over how http requests to javablogs.com are performed. commons-httpclient is also useful to post to blogger. About the parsing with htmlparser, I changed the way to do it, I used to only use a simple Lexer, but now I changed to using NodeVisitor as it allows me to parse with finer granularity more easily, even though it is probably slower. I needed that to update href elements to that they are XHTML compliant.

You will find concrete code using htmlparser in a more recent post, just follow the link.

Categories: , ,

JavaBlogs Weekly Top 10 and Java HTML parsing

I took some time to continue my little JavaBlogs analysis, I now have a page summarizing the top 10 most read blog entries in the last week. The page is generated every 24h (this is why there is no 'best progression' as of today).

I also fixed some bugs related to HTML in RSS2. I understand a bit better why a RSS 1.0 co-author decided to remove the possibility of HTML descriptions for RSS 3.0. It often does not make sense to keep all that information about styles, fonts, etc. from different sources. What I do is rewrite the HTML, allowing only b,i,a,p,br tags, with the style information stripped. I found the open-source htmlparser java library quite helpful to achieve that.

Mai 2006 Update
I now post the top10 every week to my blog, I wrote a little piece on how to interact with Blogger API in Java. This avoids me having to maintain an extra site.
HTTP requests handling is done using commons-httpclient library to have more control over how http requests to javablogs.com are performed. commons-httpclient is also useful to post to blogger. About the parsing with htmlparser, I changed the way to do it, I used to only use a simple Lexer, but now I changed to using NodeVisitor as it allows me to parse with finer granularity more easily, even though it is probably slower. I needed that to update href elements to that they are XHTML compliant.

You will find concrete code using htmlparser in a more recent post, just follow the link.

Categories: , ,

Saturday, September 10, 2005

Spam In Blog Comments

I was a victim like many other of spams in comments. It's stupid for people to do that on Blogger.com since the links on comments can not be referenced by search engines (they have some special 'relative'attribute for that) and improve pagerank.

Fortunately Blogger.com provides a word verification step if you want to avoid random spam. However I am a bit disappointed that they force Blogger.com users to do that word verification as well. This time I find it stupid from Blogger.com. They have control on their users, so they could ban spamming users, and for everybody else on Blogger.com, this would be just one less step. I am always a bit annoyed at measures that solve a problem caused by a hand of people by making it more annoying for the majority.

Spam In Blog Comments

I was a victim like many other of spams in comments. It's stupid for people to do that on Blogger.com since the links on comments can not be referenced by search engines (they have some special 'relative'attribute for that) and improve pagerank.

Fortunately Blogger.com provides a word verification step if you want to avoid random spam. However I am a bit disappointed that they force Blogger.com users to do that word verification as well. This time I find it stupid from Blogger.com. They have control on their users, so they could ban spamming users, and for everybody else on Blogger.com, this would be just one less step. I am always a bit annoyed at measures that solve a problem caused by a hand of people by making it more annoying for the majority.

Friday, September 09, 2005

JavaBlogs Daily Analysis

I was wondering what blog entries were the most interesting on Javablogs. I decided to write a small application to do that. It was not much more complex to put it online for others to look at as well. It is currently running on http://gopix.net:8081/javabuzz

It also presents Javablogs a bit differently (I like it better that way).

Please note that it is just the result of a 1 (full) day of work currently. I hopefully will have a bit of time to improve it. For example I'd like to add some graphs about popularity, some weekly stats, and comments in blog entries.


JavaBlogs Daily Analysis

I was wondering what blog entries were the most interesting on Javablogs. I decided to write a small application to do that. It was not much more complex to put it online for others to look at as well. It is currently running on http://gopix.net:8081/javabuzz

It also presents Javablogs a bit differently (I like it better that way).

Please note that it is just the result of a 1 (full) day of work currently. I hopefully will have a bit of time to improve it. For example I'd like to add some graphs about popularity, some weekly stats, and comments in blog entries.


Wednesday, September 07, 2005

Commons-Beanutils Is Slow

The BeanUtil.popupate(bean,map) can be very handy, but if you care about performance, it is quite slow. I ran a micro benchmark on my machine (centrino 1.8ghz, JDK1.5) and found out that BeanUtils is up to 40x slower than a hand coded solution (where I assign each bean field manually). I was a bit surprised to find such a difference. I suppose there is a big penalty for using reflection and another big one for the BeanUtils abstraction (automatic casting, etc.). I did another test without BeanUtils, using if/else statements vs HashMap.get and found out that the if/else string.equals(...) statements can degrade performance by about 10x. The HashMap appears to be very performant, even with just a few elements in.

In conclusion, if you need more performance, consider hand coding or code generation (using aspectj, or annotations for example) rather than BeanUtils. Actually nowadays, using annotations where you used beanutils probably makes much more sense .

Commons-Beanutils Is Slow

The BeanUtil.popupate(bean,map) can be very handy, but if you care about performance, it is quite slow. I ran a micro benchmark on my machine (centrino 1.8ghz, JDK1.5) and found out that BeanUtils is up to 40x slower than a hand coded solution (where I assign each bean field manually). I was a bit surprised to find such a difference. I suppose there is a big penalty for using reflection and another big one for the BeanUtils abstraction (automatic casting, etc.). I did another test without BeanUtils, using if/else statements vs HashMap.get and found out that the if/else string.equals(...) statements can degrade performance by about 10x. The HashMap appears to be very performant, even with just a few elements in.

In conclusion, if you need more performance, consider hand coding or code generation (using aspectj, or annotations for example) rather than BeanUtils. Actually nowadays, using annotations where you used beanutils probably makes much more sense .

Monday, September 05, 2005

Generate your RSS feed in Java

There are some open source projects that can help you in generating or reading RSS feeds in Java. I found only two libraries a bit mature, other code is often embedded in other open source products (jroller for example):
  • Informa: Does various RSS formats and Atom 0.3. Documentation is better than its alternative, but less focused (has some hibernate helper thingy, some lucene helper, etc.).
  • Sandler: There is no working homepage while I am writing this. But the code is of decent quality, supports Atom 0.3 and RSS 1.0. It is easy to use it. However in reality it is not much more than a wrapper around some XML parser specialized in generating an RSS structure or an Atom structure.
  • Ooops, I forgot another important one, Rome. This RSS/Atom framework with a catchy name is very similar to Informa, has good documentation and good looking code. Under the hood it makes use of jdom.
I personally use dom4j since I only need to generate RSS, and RSS, or Atom are just XML. I don't find it particularly verbose to use dom4j for that, and it is very flexible.

If you need to parse feeds, then those libraries might make sense and save you a bit of time. For generating, I think their main interest is to abstract you from the differences in formats. So if you need to handle different formats, a framework will allow you to do it through only one API, which can be a big time-saver.

Categories: , ,

Generate your RSS feed in Java

There are some open source projects that can help you in generating or reading RSS feeds in Java. I found only two libraries a bit mature, other code is often embedded in other open source products (jroller for example):
  • Informa: Does various RSS formats and Atom 0.3. Documentation is better than its alternative, but less focused (has some hibernate helper thingy, some lucene helper, etc.).
  • Sandler: There is no working homepage while I am writing this. But the code is of decent quality, supports Atom 0.3 and RSS 1.0. It is easy to use it. However in reality it is not much more than a wrapper around some XML parser specialized in generating an RSS structure or an Atom structure.
  • Ooops, I forgot another important one, Rome. This RSS/Atom framework with a catchy name is very similar to Informa, has good documentation and good looking code. Under the hood it makes use of jdom.
I personally use dom4j since I only need to generate RSS, and RSS, or Atom are just XML. I don't find it particularly verbose to use dom4j for that, and it is very flexible.

If you need to parse feeds, then those libraries might make sense and save you a bit of time. For generating, I think their main interest is to abstract you from the differences in formats. So if you need to handle different formats, a framework will allow you to do it through only one API, which can be a big time-saver.

Categories: , ,

Thursday, September 01, 2005

The Evil Port 80

I was writing an Atom feed generator for my current project. I chosed to support Atom 1.0 since it looks like it has the capabilities to establish as the next standard. Unfortunately I quickly saw that it was quite hard to test it in the real world (out of the good feedvalidator), as almost nobody seems to accept Atom 1.0 feeds yet, even if it is rapidely changing (there is support for it in Firefox CVS version).

So I decided to support RSS as well, the big question was: which RSS version? After grabbing lots of info on the subject, I opted for 1.0 again (more flexible, more different than Atom). It was actually quick to support RSS, but then when in real world, neither Google Desktop nor My Yahoo was willing to accept my feed. I looked at every bit of my xml, fiddled with Tomcat configuration in any possible way when I saw that no request was coming to my server from Yahoo or Google. And finally I thought, hmm maybe it's the port. I restarted my server on port 80, and yup, it worked!



I wonder why Google Desktop and My Yahoo don't support another port than port 80 for RSS feeds.

tags: Categories: , , ,

The Evil Port 80

I was writing an Atom feed generator for my current project. I chosed to support Atom 1.0 since it looks like it has the capabilities to establish as the next standard. Unfortunately I quickly saw that it was quite hard to test it in the real world (out of the good feedvalidator), as almost nobody seems to accept Atom 1.0 feeds yet, even if it is rapidely changing (there is support for it in Firefox CVS version).

So I decided to support RSS as well, the big question was: which RSS version? After grabbing lots of info on the subject, I opted for 1.0 again (more flexible, more different than Atom). It was actually quick to support RSS, but then when in real world, neither Google Desktop nor My Yahoo was willing to accept my feed. I looked at every bit of my xml, fiddled with Tomcat configuration in any possible way when I saw that no request was coming to my server from Yahoo or Google. And finally I thought, hmm maybe it's the port. I restarted my server on port 80, and yup, it worked!



I wonder why Google Desktop and My Yahoo don't support another port than port 80 for RSS feeds.

tags: Categories: , , ,

Thursday, August 25, 2005

Google Sidebar Hotkey Activation

I like the new Google Desktop with the sidebar. It shares similarities with Konfabulator, recently bought by yahoo. They both allow easy access to some custom little widgets that I would call "active". They are active because they are refreshed periodically with new information (processor usage, news, scratch pad, emails, etc). But while Konfabulator choose to emphasize on visual effects, Google prefers a more standard information presentation. This shows as well in their choice of technologies:
  • Google Sidebar plug-ins are just Windows appz that can take advantage of Google Interfaces. That makes them quite powerful in theory, but programming them is less accessible.
  • Konfabulator plug-ins are Javascript+XML, the Javascript is not just regular client-side javascript, it can use Konfabulator API (containing many effect and rudimentary network access), and COM objects . That makes them very focused on presentation, and the Internet.
In the long run, Google choice makes sense, the forthcoming Avalon will make visual effects very accessible to windows developers.

Now back to the subject, I missed the 'activation on hotkey' feature from Konfabulator for the Google Sidebar. Fortunately, I a have found a powerful little open-source program, Autohotkey, that allowed me to do that very quickly. Here is the script I use (it's a hack since it relies on toolbar size (but not position), but I like the default position and it works (only using floating deskbar, i let you figure out for the non floating version)):
F12::
MouseGetPos, X, Y
if WinExist("ahk_class _GD_Sidebar")
{
WinActivate
BlockInput,On
MouseClick, left, 160, 16
MouseMove, X,Y
BlockInput,Off
return
}
else if WinExist("ahk_class ATL:0044A4C8")
{
WinActivate
BlockInput,On
MouseClick, left, 158, 16
MouseMove, X,Y
BlockInput,Off
return
}


Categories: , , , , ,

Google Sidebar Hotkey Activation

I like the new Google Desktop with the sidebar. It shares similarities with Konfabulator, recently bought by yahoo. They both allow easy access to some custom little widgets that I would call "active". They are active because they are refreshed periodically with new information (processor usage, news, scratch pad, emails, etc). But while Konfabulator choose to emphasize on visual effects, Google prefers a more standard information presentation. This shows as well in their choice of technologies:
  • Google Sidebar plug-ins are just Windows appz that can take advantage of Google Interfaces. That makes them quite powerful in theory, but programming them is less accessible.
  • Konfabulator plug-ins are Javascript+XML, the Javascript is not just regular client-side javascript, it can use Konfabulator API (containing many effect and rudimentary network access), and COM objects . That makes them very focused on presentation, and the Internet.
In the long run, Google choice makes sense, the forthcoming Avalon will make visual effects very accessible to windows developers.

Now back to the subject, I missed the 'activation on hotkey' feature from Konfabulator for the Google Sidebar. Fortunately, I a have found a powerful little open-source program, Autohotkey, that allowed me to do that very quickly. Here is the script I use (it's a hack since it relies on toolbar size (but not position), but I like the default position and it works (only using floating deskbar, i let you figure out for the non floating version)):
F12::
MouseGetPos, X, Y
if WinExist("ahk_class _GD_Sidebar")
{
WinActivate
BlockInput,On
MouseClick, left, 160, 16
MouseMove, X,Y
BlockInput,Off
return
}
else if WinExist("ahk_class ATL:0044A4C8")
{
WinActivate
BlockInput,On
MouseClick, left, 158, 16
MouseMove, X,Y
BlockInput,Off
return
}


Categories: , , , , ,

Tuesday, August 23, 2005

I Need Another DB Framework!

I am currently facing a problem that neither Hibernate nor iBatis solves nicely. I also looked at other ORM or just DB framework, without success.

What I would need is a framework that generates PreparedStatements with a query by Criteria like API. I have many queries that are similar but varying according to different input parameters. iBatis can handle this, but for complex queries and scenarios, the XML becomes completely unreadable, and you therefore loose any advantage that iBatis was bringing with the externalization of SQL statements in XML. The other issue I have with using iBatis is that for another part of my project, the automatic generation of SQL statements a-la Hibernate is useful.

Hibernate has a very nice Query by Criteria API, but it lacks just a tiny bit of flexibility in customizing queries. For example, I could not find a way to specify a "USE INDEX(index_name)" in the generated SQL, after the SELECT FROM xxx and before the rest of the query. I did not find either a way to specify the use of a "STRAIGHT_JOIN" instead of an INNER JOIN. These are all MySQL specific issues, but those little things are extremely useful at improving some of my queries performances. Writing N sql queries hard coded is not a good option, since this N can be quite big, which is why I am using Query by Criteria in the first place.

So is there a need for yet another DB framework?

I Need Another DB Framework!

I am currently facing a problem that neither Hibernate nor iBatis solves nicely. I also looked at other ORM or just DB framework, without success.

What I would need is a framework that generates PreparedStatements with a query by Criteria like API. I have many queries that are similar but varying according to different input parameters. iBatis can handle this, but for complex queries and scenarios, the XML becomes completely unreadable, and you therefore loose any advantage that iBatis was bringing with the externalization of SQL statements in XML. The other issue I have with using iBatis is that for another part of my project, the automatic generation of SQL statements a-la Hibernate is useful.

Hibernate has a very nice Query by Criteria API, but it lacks just a tiny bit of flexibility in customizing queries. For example, I could not find a way to specify a "USE INDEX(index_name)" in the generated SQL, after the SELECT FROM xxx and before the rest of the query. I did not find either a way to specify the use of a "STRAIGHT_JOIN" instead of an INNER JOIN. These are all MySQL specific issues, but those little things are extremely useful at improving some of my queries performances. Writing N sql queries hard coded is not a good option, since this N can be quite big, which is why I am using Query by Criteria in the first place.

So is there a need for yet another DB framework?

Sunday, August 21, 2005

del.icio.us toolbar customized

When I bookmark articles with delicious, I like to keep the content on my hard drive, because pages sometimes change, or are removed, or I want to do local searches. I believe this is one reason some people like furl (furl keeps a copy on their server that only yourself can read, but does not allow search).

A combination of slogger and delicious could solve partially the problem. But it is not integrated, I can't get my local version from delicious, so I loose the tagging, listing and all other plus from delicious.

I added my own feature to the delicious toolbar, which I like very much. This new toolbar saves automatically the file you bookmark (on the + button), and will add a link in your delicious home to the local version (if it exists).

I have it publicly accessible at http://perso.wanadoo.fr/logos01/deltoolbar.html

It is not meant to be used by everybody as it is not official. But the page will give you an idea of what it does. If you think it is useful, I will improve it, otherwise it will stay the way it is because it fits my use.

Categories: , ,