Comparing Web Frameworks: RIFE
Well, it seems that the series of articles comparing all the different frameworks using Simon's initial set of requirements is expanding. This time, Geert Bevin, the creator of RIFE, has done the same thing, using his own framework.
I've always found RIFE very interesting, but a little daunting for new users. It uses a lot of cool concepts, like web continuations, blueprints, constrained meta data, etc., but if you are starting at server-side development using Java, or if you come from a much simpler framework like Struts, then you might find all of this just a little bit too much.
Also, it seems that there are at least 3 ways to accomplish the same task for many tasks that you want to do. This says wonders about the flexibility of the framework, but if you only want to 'get it done', you will probably stall with RIFE, trying to figure out which one of the options is the best for you; and then, after selecting one, you might start thinking that the other ones might have been better.
I'm sure that the amount of work Geert has put into his framework is making RIFE very flexible. However, I would still choose Wicket over RIFE, as Wicket provides a simpler entry point, in my opinion. I guess the real issue is how does each framework handle more complex requirements, though.
I've always found RIFE very interesting, but a little daunting for new users. It uses a lot of cool concepts, like web continuations, blueprints, constrained meta data, etc., but if you are starting at server-side development using Java, or if you come from a much simpler framework like Struts, then you might find all of this just a little bit too much.
Also, it seems that there are at least 3 ways to accomplish the same task for many tasks that you want to do. This says wonders about the flexibility of the framework, but if you only want to 'get it done', you will probably stall with RIFE, trying to figure out which one of the options is the best for you; and then, after selecting one, you might start thinking that the other ones might have been better.
I'm sure that the amount of work Geert has put into his framework is making RIFE very flexible. However, I would still choose Wicket over RIFE, as Wicket provides a simpler entry point, in my opinion. I guess the real issue is how does each framework handle more complex requirements, though.
Categories : Web
Migrating wicket-example to Wicket 1.2 (beta 1)
UPDATE: I changed the BlogApplication code based on feedback from Igor (one of the Wicket developers). It should now work against the latest trunk from the Subversion repository.Well, my last entry had some very good feedback from you. It seems people really are interested in learning Wicket, and someone even told me that his boss asked him to evaluate Wicket after reading my article. That kind of reaction for me is both a blessing and a curse. A blessing because I feel good with this kind of response, but a curse (in a good way) because now I want to give more, something that's not always easy to do, as I do have a day job.
My interest in Wicket comes from the fact that I like the way the framework works. And I'm sure that the more I learn about Wicket, the more I will be able to share with you how to do things. There are a couple of introductory articles already, and the wiki pages also provide good reference points, but there's nothing like a practical example to understand what's going on (at least I learn better by example).
And speaking of examples, the example I created for the article used Wicket 1.1.1, but Wicket 1.2 is just around the corner, and barring some last minute critical API changes, it should be stable enough for people to use it.
Migrating the example to 1.2 was actually very easy. All I had to do was to put the new wicket-1.2-beta1.jar file in my lib folder, take out the old jar (of course) and also the ognl jar which is no longer needed, as Wicket now provides its own internal Object-Graph navigation. I also had to modify two classes: BlogApplication and ViewBlogEntry.
The new BlogApplication class now looks like:
package org.javageek.wicket;As you can see, in Wicket 1.2 you no longer need to do getPages().setHomePage() in order to set the main page for your web app. Instead, your WebApplication subclass needs to override the getHomePage() method. Also, all the settings should now be set in the init() method. ApplicationSettings no longer exists, and instead has been replaced by specific settings interfaces. A couple of convenience methods were also added, like Application.configure() for direct configuration of an application.
import wicket.Application;
import wicket.protocol.http.WebApplication;
import wicket.settings.IMarkupSettings;
import domain.Blog;
import domain.BlogService;
public class BlogApplication extends WebApplication {
private BlogService blogService = new BlogService();
@Override protected void init() {
IMarkupSettings markupSettings = getMarkupSettings();
configure(DEVELOPMENT);
markupSettings.setStripWicketTags(true);
markupSettings.setDefaultMarkupEncoding("UTF-8");
markupSettings.setStripXmlDeclarationFromOutput(false);
}
@Override public Class getHomePage() {
return Index.class;
}
public static final BlogApplication instance() {
return (BlogApplication) Application.get();
}
public Blog getBlog() {
return blogService.getBlog();
}
}
This is how ViewBlogEntry looks like:
package org.javageek.wicket;The only difference here from the old example is that instead of invoking a method (redirectTo) to go to the 404 page, I now throw a RestartResponseException. This seems cleaner, as I'm basically stoping what I'm doing with the exception. I also don't need to instantiate a page object in 1.2, but send the class reference as the exception parameter.
import java.text.DateFormat;
import wicket.PageParameters;
import wicket.RestartResponseException;
import wicket.markup.html.basic.Label;
import domain.Blog;
import domain.BlogEntry;
public class ViewBlogEntry extends BasePage {
public ViewBlogEntry(PageParameters parameters) {
super();
Blog blog = getBlog();
BlogEntry entry = blog.getBlogEntry(parameters.getString("id"));
if (null == entry) {
throw new RestartResponseException(PageNotFound.class);
} else {
add(new Label("entryTitle", entry.getTitle()));
add(new Label("entryBody", entry.getBody()).setEscapeModelStrings(false));
add(new Label("pageTitle", entry.getTitle() + " : " + blog.getName()));
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, getBlog().getLocale());
add(new Label("entryDate", df.format(entry.getDate())));
}
}
}
The whole migration took me less than an hour, but I wouldn't use this as a benchmark, as the example is very basic in terms of Wicket functionality. Even though 1.2 breaks a couple of things from 1.1, in my opinion it is a necessary evil in order to put Wicket in a state that makes it even easier to develop things. As before, I'm making the source code available.
Comparing Web Frameworks: Wicket
In this article, I introduce the Wicket web framework by using the same comparison requirements as the ones posted by Simon Brown on his Java.net blog.
The Tesla Testament
I was given an Advanced Readers Copy (ARC) of the upcoming novel The Tesla Testament by Eugene Ciurana. The book isn't due to be published until october of 2006, but I wanted to share my impressions of the book.
The novel centers around freelancer Francis Montagnet, who besides doing his regular jobs as software consultant and his Muay Thai training, he sometimes takes the not-so-clean jobs of some intelligence agency I rather not mention. This time (it is the second novel Eugene writes about Francis), he has to stop a terrorist organization called Enbeaath, or Rebirth Alliance, from obtaining some stolen classified documents that detail the inventions of Nikola Tesla, a genius who understood electricity a little too much, and whose inventions got confiscated and deemed classified "Top Secret" by the FBI after his dead, in 1943.
I must confess that when I usually read novels, I go mostly for the Sci-Fi/Fantasy themes. However, I've also enjoyed books by Stephen King, Tom Clancy, Michael Crichton and Dan Brown (the usual suspects), and if I were to classify Eugene's book, I would probably put it in the 'Tom Clancy meets Dan Brown' section, mixing espionage themes with a lot of historical facts about Tesla.
I found reading The Tesla Testament to be rather enjoyable. Francis is a regular guy, intelligent but very human. He's not the suave Hollywood-Bond type (I haven't read any of the Ian Flemming novels, but I hope Flemming's Bond is a little less vacous), but a more down-to-earth guy who wants to survive in a very dangerous situation. Francis is a guy who doesn't play fair, he plays to win.
The novel is well written in my opinion, and it is hard to put it down at night as you want to keep reading about what's going to happen next. I found a couple of really small flaws (continuity errors), but fortunately since this is an ARC, I was able to point them out to Eugene and he has fixed them, so I expect the final print edition to come out really nice. The climax of the novel seems to end just a little too soon for me, as I wanted a longer confrontation between the good guys and the bad guys, but that's probably just me. I guess it speaks good about a novel that you want to keep reading it even after it has finished.
I hope the book sells well, so Eugene keeps writing more about Montagnet.
Technorati Tags: tesla, testament, ciurana, novel
The novel centers around freelancer Francis Montagnet, who besides doing his regular jobs as software consultant and his Muay Thai training, he sometimes takes the not-so-clean jobs of some intelligence agency I rather not mention. This time (it is the second novel Eugene writes about Francis), he has to stop a terrorist organization called Enbeaath, or Rebirth Alliance, from obtaining some stolen classified documents that detail the inventions of Nikola Tesla, a genius who understood electricity a little too much, and whose inventions got confiscated and deemed classified "Top Secret" by the FBI after his dead, in 1943.
I must confess that when I usually read novels, I go mostly for the Sci-Fi/Fantasy themes. However, I've also enjoyed books by Stephen King, Tom Clancy, Michael Crichton and Dan Brown (the usual suspects), and if I were to classify Eugene's book, I would probably put it in the 'Tom Clancy meets Dan Brown' section, mixing espionage themes with a lot of historical facts about Tesla.
I found reading The Tesla Testament to be rather enjoyable. Francis is a regular guy, intelligent but very human. He's not the suave Hollywood-Bond type (I haven't read any of the Ian Flemming novels, but I hope Flemming's Bond is a little less vacous), but a more down-to-earth guy who wants to survive in a very dangerous situation. Francis is a guy who doesn't play fair, he plays to win.
The novel is well written in my opinion, and it is hard to put it down at night as you want to keep reading about what's going to happen next. I found a couple of really small flaws (continuity errors), but fortunately since this is an ARC, I was able to point them out to Eugene and he has fixed them, so I expect the final print edition to come out really nice. The climax of the novel seems to end just a little too soon for me, as I wanted a longer confrontation between the good guys and the bad guys, but that's probably just me. I guess it speaks good about a novel that you want to keep reading it even after it has finished.
I hope the book sells well, so Eugene keeps writing more about Montagnet.
Technorati Tags: tesla, testament, ciurana, novel
Categories : General
Gmail tip of the day
If you're like me, you're using gmail for all those mailing lists that you have to be on, even if you don't actually read most of the mails sent there, and have a label (and a filter) for each of the lists, so the mail skip the inbox and go directly to the label 'folder'.
If any of this sounds familiar, I have a tip for you. If you want to quickly scan all the unread mails to see what's new and/or mark them as 'read', you can search using the 'is:unread' special search tag. That way, you'll get all the unread mail in one place, and quickly act on it.
There's a bug, though. If you're looking at the unread search results, you can't mark them with the 'Select: Unread' option and mark them as read. You have to 'Select: All' and then you can mark them as read.
Technorati Tags: gmail, tips
If any of this sounds familiar, I have a tip for you. If you want to quickly scan all the unread mails to see what's new and/or mark them as 'read', you can search using the 'is:unread' special search tag. That way, you'll get all the unread mail in one place, and quickly act on it.
There's a bug, though. If you're looking at the unread search results, you can't mark them with the 'Select: Unread' option and mark them as read. You have to 'Select: All' and then you can mark them as read.
Technorati Tags: gmail, tips
Categories : General

