Kontakt

Archive for Juni, 2010

Registry Startup

Mittwoch, Juni 16th, 2010

In web applications it’s often necessary to execute extra logic at application startup. When your application is starting, you might want to schedule a task for one-time or repeated execution. A typical use case is the initialization of the database. Imagine you deliver a demo version of your application to a customer in order to convince him that you did a better job than your competitors. When the customer drops the WAR file into the servlet container, the application should be usable immediately. In this case you might want to create some demo data (e.g. demo accounts with default credentials) at start time.

In Tapestry you can execute some logic at Registry startup by making contributions to the RegistryStartup service configuration. The values contributed are Runnable objects. Here is an example:

public class AppModule {

  public static void contributeRegistryStartup(
         OrderedConfiguration<Runnable> configuration,
         final DatabaseStartup dbStartup) {

      configuration.add("DbStartup", new Runnable() {
         public void run() {
                dbStartup.init();
         }
      }, "before:*");
  }
}

Startup Methods in Tapestry 5.2

In Tapestry 5.2 the way of providing extra logic to be executed at Registry startup has been simplified. Instead of making contributions to the RegistryStartup service configuration you can provide startup methods inside your modules. As you can see in the following example you just annotate an arbitrary module method with @Startup annotation and that’s it. Tapestry will detect these methods and invoke them after the registry has been started.

public class AppModule {

  @Startup
  public static void initApplication(DatabaseStartup dbStartup) {
      dbStartup.init();
  }
}

Note that RegistryStartup service configuration is ordered. Providing the order constraint it’s possible to control in what order the contributions are executed. In contrast the order of startup methods is determined by the alphabetical order of the method names. You should not rely on that. The alphabetical ordering of module methods is a part of the internal API and may be changed in the upcoming releases.

Manning Publications translates my Tapestry 5 book

Freitag, Juni 11th, 2010

I’m pleased to announce the amazing news. Manning Publications Co. will translate my Tapestry 5 book into English. Tapestry folks have been waiting for a book on Tapestry 5 for a long time and I’m excited to finally move forward with this book.

We have a great team. Joachim Van der Auwera will translate the German copy into English. I’ll update the translated book with the Tapestry 5.2 contents. There is a lot of innovative stuff in the 5.2 trunk the world should know about. I’m also going to extend some chapters which were covered in the German version not in the depth. Maybe some of the articles from this blog will be available in the book. The German version has around 430 pages. The Manning book on Tapestry will get additional 50 – 70 pages. Finally Howard Lewis Ship is interested in joining the project as technical editor. If Howard will be available he will review whether the book covers his vision of Tapestry.

I would like to thank Angelika Ritthaler from Addison Wesley and Christina Rudloff from Manning Publications Co. for making this book real.

Stay tuned!

First Impressions From Jazoon

Freitag, Juni 4th, 2010

The Jazoon 2010 is closed. I enjoyed the most of the talks and met some folks. My talk JavaServer Faces 2.0 vs. Tapestry 5 took place on Thursday, 3 June in the arena 7. Unfortunately my presentation will not be available as video since only talks in the largest arena 5 has been recorded. The slides of the talk are available here. However, I enjoyed the conference and will submit some presentation proposals next year again.

Directly after my talk Roger Kitains, a JSF co-specification lead, was giving a presentation Exploring HTML5 With JavaServer Faces 2.0. He was attending my presentation and I had the pleasure to discuss Tapestry and JSF with him. Roger told me he enjoyed my talk and was impressed by Tapestry. He likes Tapestry’s annotation-based approach and implicit type conversion which probably will be adapted in the upcoming JSF version.

Also Andy Bosch, another JSF guru, was attending my talk. He was impressed by the Live Class Reloading feature. Probably we’ll give together a JSF vs. Tapestry talk in the future. I believe that such a talk would be very funny. I would concentrate on Tapestry part and he would present JSF.

I also had a chance to meet Evgeni Kabanov, the founder and CTO of ZeroTurnaround, who gave an amazing talk on class loaders. I was interested in his talk and was not disappointed. We discovered Zurich together and had the pleasure to discuss the Live Class Realoading in Tapestry and JRebel during a dinner in a Japanese restaurant. By the way, if some of the readers is not using Tapestry but wants to be productive, you should give JRebel a try.

As summary of my talk I will publish a series of articles on JSF vs. Tapestry topic in order to share with you the result of my research.

Here are some pics which has been taken during my presentation.

Tapestry 5 Blog - Copyright © 2009 - Eclectic Theme by Your Inspiration Web - Powered by WordPress