webfirmframework for Java Experts

Web Firm Framework

Web Firm Framework is an open source java framework powered by Apache. Its latest version wffweb-12.x.x is a fully fledged presentation framework. It can be used to build complicated realtime web applications. The advantage of using this framework is its ability to dynamically generate HTML5 and CSS3 and update it with ui. It also provides some inbuilt support for optimized HTML/CSS output. In a wffweb project, we are keeping java files for ui (for HTML5/CSS3 ui generation) instead of keeping any separate html/css files. This framework gives the way to write Object Oriented HTML using Java. A servlet & websocket support is enough to create web applications with this framework. It gives guaranteed high performance and highly secured UI generation.

wffweb-1.x.x provides just to generate HTML5 & CSS3 and some other sophisticated features for UI development. wffweb-2.x.x or later is an upgraded version of wffweb-1.x.x with server-client bi-directional full-duplex communication. Check out Developers Guide for more info.

Whom is this framework for?

Developers who want to be a designer to develop very complex and secure ui. Say for example, an online spreadsheet where each cell has many functionalities and each of the functionalities needs to be handled by independent/group of developers.

To develop highly secured ui, for eg:- a financial application like banking product.

What are the supported programming languages?

Java and Kotlin. Checkout sample projects and sample project with embedded server.

What are the advantages of this framework over other ui frameworks?

In other ui development frameworks, the developer may face some helpless situations to satisfy some ui features because of their limited control to the developer, in this framework the developer has full control over html & css generation. In other frameworks, the html to java data structure will be different so the developer has to keep different logic in the code, but here it is same so the developer is able to make a one to one mapping with html to java with less modifications. An HTML to Java code conversion tool is also provided in the webfirmframework.com website which helps you to understand how the converted code looks like. In some complex ui development cases, we may have to keep a dedicated designer to develop the design html/css and the designer may be unaware of Java, in such cases we can convert these designed html/css to the corresponding wff java code. The designer will be able to understand the output html/css even if he/she doesn’t know the java because of the webfirm java code structure. It supports css3 and html5 and also a way to use custom css/html tags so that you will not have to wait for a new release to use new html tag or css.

wffweb is an independent framework. It can be used in combination of any kind of application servers or embedded containers. Sometimes we prefer to embed containers inside the application instead of running app inside the container.

The memory consumed by this framework is very low so you can build complete web application alone with this framework which can be run on any low memory servers. If you are using client-server communication feature of wffweb-2.x.x or later, then you have to use server which supports websocket.

Why wffweb is amazingly fast.

There are couple of reasons for this

In a normal web application when you request for a page it consumes disks, memory and processor. The web application performance depends up on the speed of disk read operation, that's why we go for SSD solutions for performance gain.

But, when we use webfirmframework (wffweb) there is no disk read/write done as the complete web page is dynamically generated by logical programs. This makes it to gain the maximum performance which even an SSD solution can't make. And when you develop application with wffweb-2.x.x or later as a single page web application, only the required portions of the page are changed instead of the entire page. Therefore there is minimal logical operations done which makes minimal cpu/memory consumption (absolutely no disk read/write).

Server to Browser communication is another important factor for performance. A normal application communicates with http / https protocol. But, since wffweb-2.x.x or later it uses websocket for server-client bi-directional full-duplex communication which eliminates the overhead of http / https communication (Eg: DNS lookup, opening/closing connection on each request etc..).

In a normal web application you may have to handle server/ajax calls and a couple of JavaScript libraries for UI changes. This may cause the browser to consume more memory and cpu unless you handle it carefully thus the result for a huge project will be poor performance. But, in wffweb-2.x.x or later you don't have to manually handle any server calls and no additional libraries are required for UI updates. Nowadays, we buy third party ready made frameworks for styling UI, wffweb-2.x.x or later doesn't restrict using third party js/css/other libs in the project so you have the freedom to use any libraries.

When you develop your project with wffweb-2.x.x or later you will understand more reasons for the performance gain.

Why wffweb is highly secure

All UI logic may be kept at server side instead of client side while offering the freedom to keep the logic either at client side or server side.

When you use wss with wffweb-2.x.x or later which is more secure than an https communication as it again reduces the risk of MITM attack.

How reliable it is

The WFF Hub itself is built by wffweb-3.x.x and we ourselves use wffweb-3.x.x for all of our internal projects that makes us to bring new ideas or improvements it requires. As per our analytics, wffweb is used by around 550 new projects every month and it's actively used in 56 countries in the world.

It's an independent framework i.e. it has no dependency over any other frameworks or Java EE classes that makes the consuming project to be minimal in size and the framework to be improvable at any level.

Java Sample code :-

Develop web application with Java code in the way you write HTML.

Since 3.0.7 you can write in functional style coding. Eg:
Html html = new Html(null).give(rootTag -> {
    new Head(rootTag);
    new Body(rootTag).give(body -> {
        new NoTag(body, "Hello World");
    });
});

// prepends the doc type <!DOCTYPE html>
html.setPrependDocType(true);
System.out.println(html.toHtmlString()); 
Eg for anonymous class style coding:
Html html = new Html(null) {{
    new Head(this);
    new Body(this) {{
        new NoTag(this, "Hello World");
    }};
}};

// prepends the doc type <!DOCTYPE html>
html.setPrependDocType(true);
System.out.println(html.toHtmlString()); 
alternatively
Html html = new Html(null);
new Head(html);
Body body = new Body(html);
new NoTag(body, "Hello World");

// prepends the doc type <!DOCTYPE html>
html.setPrependDocType(true);
System.out.println(html.toHtmlString()); 

prints the following output

<!DOCTYPE html>
<html>
<head>
</head>
<body>
Hello World
</body>
</html>

Kotlin Sample code :-

val html = Html(null).apply {
    Head(this)
    Body(this).apply {
        NoTag(this, """
                        Do you know
                        that writing multiple lines
                        in Kotin is very easy
                        """)
     }
}

// prepends the doc type 
html.isPrependDocType = true
println(html1.toHtmlString())
alternatively
val html = Html(null)
Head(html)
val body = Body(html)
NoTag(body, """
               Do you know
               that writing multiple lines
               in Kotin is very easy
            """)

// prepends the doc type 
html.isPrependDocType = true
println(html.toHtmlString())

prints the following output

<!DOCTYPE html>
<html>
<head>
</head>
<body>
               Do you know
               that writing multiple lines
               in Kotin is very easy
</body>
</html>