Cloud Technologies Mobile Technology Tools & Frameworks

Spinneret

SpinneretWe, the tech communities, have always wanted a better approach to develop our GUIs. And a far-better approach to integrate the presentation tier with the other tiers. Coding the business tier, service tier, and persistence tier is actually the up-hill task. But we have never felt so. Why is that?

The answer to this question is,

  • It is pure java code
  • Testing is so easy that we just test with a simple method or use JUnit
  • Making a call to other layers is so easy (We just need to create a new instance, and call a method by passing our DO or VO) This has been the answer from so many. But when asked about presentation tier, and brining the GUI, we see faces shrink and grow!

Why, is it really rocket science to construct a UI and integrate it with other tiers? After several rounds of brain storming we identified

  • Every one finds it easy to construct a GUI in HTML
  • Issues are faced when brining data at runtime to front end
  • Confusion over getting and setting objects from session / request / application scope
  • Handling multiple form submits.

And now, with Apache Struts and Spring taking the center stage, we still juggle around with our conventional approach and MVC approach.

This is what took us to stand up and say that we wanted to come up with a framework that takes the plus points of coding a business or service tier, and address the minus point of coding a presentation tier. Hence, putting up a lot of thought process into working on the design of this framework, we had to delve ourselves into topics that were non-technical, and dealt with human psychology too! We're sure that you would now be wondering whether we're talking something to scrap, but believe us, it is true that you need to think about all these things when you want to be different.

Why are we still facing issues with GUIs and presentation tier, even after Apache Struts, Spring, JSF is only one. We resist ourselves or find it hard to pull ourselves out of the conventional way of thinking, and when, is during the times of hot fixed! Yes, this is when people instead of exploring what Struts or Spring offers to address the issues, just decide to set the object to the session, or request and fix it, which actually is the starting point of the confusion.

Finally the idea to have a framework by which we can achieve dynamic presentation capabilities evolved. One mandate was to have this framework Web 2.0 ready! This is when we explored the Google Web Toolkit, an open-source UI toolkit from Google. Thus came about Spinnert! – the dynamic presentation framework.

Overview

Spinneret – is a dynamic presentation framework, developed on Java v1.6 with GWT v1.5.0 and Struts 1.1. Spinneret is a 100% extendable, customizable, and configurable framework.

Spinneret fits into the presentation tier of the enterprise layer, and takes care of rendering the UI based on the configuration files.

To begin with, Spinneret requires the web page / UI to be configured in an XML and placed into the directory in spinneret's class path. Spinneret jar file is all that you need to add to your existing GWT project reference path. Once spinneret is added, configure all your web pages as Spinneret XML, and spinneret takes care of generating GWT code when compiling your GWT module.

Spinneret is integrated with Struts 1.1, which takes care of the listener for the GUI objects of the spinneret framework from the view. Every spinneret action is submitted to the ActionServlet of struts, and is routed via struts.

Spinneret has in-built, programmable templates, which is based on the GWT layouts available. These templates are extendable, and user is free to write their own template.

Spinneret, synonymic, refers to a spider's silk spinning organ. We spun the UI for you!

Tech Talk

The different layers that constitute the framework are shown below. The core of Spinneret framework is Google GWT engine. Spinneret extensively uses the gwt-ext libraries to achieve its stunning looks for the GUI. A thick framework layer is developed on top of the core gwt layer which has the core framework classes, both on server, and client side of GWT and the utility helper classes.

The spinneret core layer consists of the core components of the framework that read the set of configuration files, and generate the get widgets and gwt panels, and add them to the root panel. The core layer action is to facilitate by the core utils layers which are written in java that uses the JAXB interfaces to parse the xml, and feed to the core layer.

Spinneret client layer consists of the pre-programmed gwt widgets, which actually form an integral part of the web page. These widgets are aligned to form a single panel, based on the template selected, and the page is defined as xml.

Dissection of spinneret framework would reveal that spinneret is essentially one more gwt module, but programmed in such a way that addresses the need of a dynamic ui generation in gwt. Hence addressing the need, spinneret evolves itself as a framework for presenting dynamic UI based on GWT.

Any user wishing to work on spinneret, needs to create a gwt module specific to their project, add the spinneret.jar file, and have the set of configuration files in the WEB-INF/classes folder. The "addModule" implementation of the root element for the project needs to make a call to the spinneret root elements.

The corresponding server side code for the client actions needs to be programmed by the user, and once complete, when generating the GWT code using the GWT compiler, the user gets all the UI code and functionality generated, without even coding a single client side component.

To know more about this tool please mail us at: cssinnovations@csscorp.com

Download

Download Spinneret