Dec 22, 2010

Vaadin - Introduction

Vaadin is a Java library which is used to develop web-based user interfaces. Java developer can use SWING SWT or AWT to create the web page as he/she is designing a software with a UI. Knowledge of HTML or CSS is not necessary. Therefor, the developer need only to think a bout the logic of the web application and develop it in the way he/she develop a desktop software.
Vaadin use AJAX and Javascripts. Therefor it will only create a single window and all other things will viewed by using AJAX. This will minimize the loading time and increase the performance.

To use Vaadin we need to download Vaadin library from its website. Then we can create a Java web based project and import thar library file as a dependent to the project. For some IDEs there are some plugins too. There is a maven archetype also. Vaadin runs on any Applet Server like Apache-tomcat, Jetty etc. So in order to use Vaadin you must install some applet server. All these things are based on Java and therefor it needs Java Development Kit or JDK.

Now we can try a simple code. If you use Eclipse you will get a system generated sample code. It will be like this.

import com.vaadin.Application;
import com.vaadin.ui.Label;
import com.vaadin.ui.Window;

public class MyVaadinApplication extends Application
    private Window mainWindow;

    public void init()
        mainWindow = new Window("Myproject Application");
        Label label = new Label("Hello Vaadin user");



In here we haven't use any HTML or CSS thing. But if you view the source of that HTML, you can see HTML tags with some javascripts. We just need to use lables, buttons and related things like in software development, Vaadin will create a web site for us.

No comments:

Post a Comment

Your comments are always welcome ...