Last year, I have helped building an AJAX web application, where the web client was composed of only one web page and tons of javascript. The 1 web page for a site approach is similar to Gmail and many full AJAX sites. This approach looks quite elegant. Using JSON (and JSON templates) we were able to separated fully presentation logic and business logic and componentization seemed to occur naturally.
But I remember how often I complained on how bad Javascript was to code. I find it does not encourage good practices at all. The object orientation of Javascript is really a pain to use. If I had not a small experience with Python before, I would have thought scripting languages were really bad at building applications, even not so big ones. I find that even for good programmers, Javascript is a challenge, as it seems to always be a struggle to organize properly your code with it.
I was recently relieved to see that around me, almost nobody likes Javascript either. It is very sad that Netscape chosed such a bad language in 1995. Firefox appears like a miraculous program to me as a lot of the UI is done in Javascript.
Here is my new Mac Mini Core Solo. I am quite happy with it since it is very quiet. It makes a good jukebox/movie/server machine. Apple was very quick in shipping it (2 days)
However I was a bit disappointed by iPhoto 6, it is not as nice as Picasa to sort out pictures (no IPTC support). I did not try Java on it yet. I just found out my little Benham circle applet was not working properly on it.
Bertrand Meyer describes in his book " Object Oriented Software Construction (2nd Ed)" qualities that a good object oriented language should have. Java has almost all the features. Ruby is much farther off, which does not mean it is not a good language, I think it's very good to write some types of programs quickly (should I call them scripts?), syntax is quite nice, but it does lack the following useful features:
Assertions:
The language should make it possible to equip a class and its features with assertions (preconditions, postconditions and invariants), relying on tools to produce documentation out of these assertions and, optionally, monitor them at run time.
Information Hiding (Java is not good either on that one, the protected keyword is of dubious value):
It should be possible for the author of a class to specify that a feature is available to all clients, to no client, or to specified clients
Static Typing:
A well-defined type system should, by enforcing a number of type declaration and compatibility rules, guarantee the run-time type safety of the systems it accepts.
Genericity:
It should be possible to write classes with formal generic parameters representing arbitrary types.
More pragmatically, library choice and performance difference between Java and Ruby might be the most decisive.
Occasionally in Ant you can see messages like this: "[javac] Using modern compiler"
What does this mean?
In Ant you have the property " build.compiler" to specify if you want to use a classic or modern compiler. Now what do they mean by modern or classic. Well, they call classic compiler the compilers of JDK 1.1 and 1.2 and they call modern compiler the ones of JDK 1.3+. They made that distinction because a classic compiler does not support the same options as modern compilers: the semantics of javac tool changed in JDK 1.3.
This terminology can easily be confused with java class file compatibility. Java class file compatibility is changed using the "-target" option of javac tool. One can specify in ant to compile with modern compilers and a target 1.4, the result is likely to not run on JVM 1.3. One can specify modern and a target 1.1, the resulting classes will run on JVM 1.1, but ant build.xml file will not be usable with JDK 1.1 without changing modern to classic.
I find Ant choice of word a bit confusing as using a "modern" compiler has little to do with the resulting class files.
These days we tried to make Websphere and Jonas interoperate. Some EJBs are deployed in Jonas and we just try to call them from Websphere. The most natural way is to use RMI (with JRMP) for that. Jonas uses JDK1.4.2 (conforms to J2EE 1.4) and Websphere IBM JVM 1.3.1 (conforms to J2EE 1.3). Because of RMI serialization, an EJB from Jonas will not work on Websphere, because this EJB has references to J2EE 1.4 classes which are different from J2EE 1.3. The exact root cause is not exactly clear to me, it probably has to do with the Naming Factory and the EJB Stub, but we tried every possible thing here without success. Update: JRMP worked between JBoss 3.X on JDK 1.4 and Websphere 5.X (IBM JDK 1.3) using JBoss NamingFactory. So RMI interoperation seems quite unpredictable. One thing is that you have to pay attention to the naming factory you use. If it is a special library like in JBoss case, make sure it is compatible with your JDK.
One solution is to use RMI-IIOP, as it does not rely on serialization. It almost works. In our case we use Websphere Portal that needs to have security enabled. You might ask what security has to do with all that. Well, enabling security on websphere means that CORBA exchange will also be secured (using CSIv2). Tuning Jonas to understand what websphere asks is something we did not manage to do (and we don't know if it is possible at all). Update: We did manage to make it work by disabling Jonas CSIv2 support.
So there we are using Axis to do the communication! Update: Axis is not needed anymore as RMI-IIOP works as advertised.
There is an interesting benchmark of Axis vs JRMP vs RMI-IIOP (pdf). Axis is more than 10x slower than pure JRMP. Application servers use of JRMP seems to matter a lot, JBoss looks bad.
I wanted to reply to Diego Parilla post about scalability, but my reply ended up being too long not to post it over here. I don’t know if I am the only one here but I don’t fully understand his post and arguments.
Clustering the web server and clustering the model are just two parts of clustering, not exclusive.
In a LAMP application, clustering the model is traditionally done by clustering the DB (MySQL) which is a no brainer. Clustering the web server does not always implies sharing the “HTTP session”. For example you can limit yourself to use cookies. For many web apps this works well.
For more stateful web apps, there are strategies to avoid clustering the session, you can make one client attack one server only for his whole session duration. Another strategy is to use DB where you would use a session. This is actually reported to work quite well. If my memory is right, this is how Friendster rewrote its app (used to be Java and session based, moved to PHP+DB).
EJBs are not about clustering the model more than Spring, they are about clustering the business logic. And I don’t see how EJB3 is more scalable than Hibernate.
In my dream job, I would have freedom to play with and build software based on new ideas I have. In my dream job, I would work with creative people, luminaries. In my dream job, I would have a good enough salary. In my dream job, I would not have to worry about the company stability. In my dream job, I would have freedom in my work schedule.
Get paid for doing what you really want (i.e. your ideas) is possible. But without worrying about the next 6 months, I have not seen that.
The latest well done (e.g. blind) listening test comparing Ogg, MPC, MP3, AAC at about 180kbps shows that Ogg is superior to all other compressing formats. It’s not that easy to find relevant tests. Many people claim to be able to notice huge differences between CD and MP3 and yet, but confronted to a blind listening test, they are very surprised how difficult it actually is. Hydrogenaudio has a good community of audiophiles.
Unfortunately Ogg is not supported officially in iTunes and not supported in the most popular hardware (iPod). It’s been a while now Ogg is out, and even if it is a superior format, unless Apple embraces it, I don’t see it succeeding. I wish Apple would make a tiny effort.
In Java it is possible to play ogg files using Jorbis but I did not find any useable Java player compared to Windows foobar2000 or Linux XMMS or Apple iTunes.
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.
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.