Architecture

From Skyway Wiki

Jump to: navigation, search


Contents

Service Runtime Architecture

TBD


Web Runtime Architecture

The Skyway Web Runtime provides the infrastructure that is used to support the development of web applications backed by Skyway services. The Web Runtime itself consists of two major component areas: the Web Presentation Framework and the Web Dispatcher Framework. Both of these are backed and fully supported by the Spring Framework - and many of the concepts and architectural approach are drawn directly from Spring. The Skyway Web Runtime itself is an extension of Spring MVC that fully embraces the concepts of Model, View and Controller as a useful boundary for separation of a web application. The Web Presentation Framework focuses on the View component of MVC. The Web Dispatcher Framework focuses on the Controller component. These components work together with the Model - provided by the Skyway Service Runtime - to enable you to quickly build robust, scalable web applications.


The Web Presentation Framework

The Web Presentation Framework is the primary component which participates in user interaction. The Web Presentation Framework presents information (through a web browser), allows the user to respond to that information, and then interacts with the web dispatcher to handle the users input - ultimately providing some end user feature through this interaction.

The Spring Framework supports integration with a number of different Web Presentation Frameworks, including:

  • JSP
  • JSF
  • Struts
  • Stripes
  • Tapestry
  • Velocity

The Skyway Web Presentation Layer is based upon JSP 2.0. JSP 2.0 provides a sophisticated and expressive expression language that can be used with page templates to easily compose expressive rich web applications. Additionally, JSP 2.0 supports custom tags which can be assembled into tag libraries and implemented in code or through indivual .tag files - this makes it easy to create reusable user interface components.

Technical Notes: At the moment, the Skyway Web Presentation Layer is based upon JSP 2.0. There are some drawbacks to this - as only newer web containers fully support JSP 2.0. As an example - Tomcat 6.0 is the earliest version of Tomcat which fully supports JSP 2.0. For broader web container support, we may want to consider dropping JSP 2.0 support sand replacing with JSP 1.2. JSP 2.1 is a baseline requirement for JEE 5 - so it is logical for Skyway to use JSP 2.x since Skyway provides such a high level of compatability with JEE 5. The need to support earlier web containers should be the only compelling factor to discourage use of JSP 2.x.

Tag Libraries

Skyway provides a set of JSP tag libraries that support the standard user interface components defined in the HTML standard, as well as some of the most commonly used sophisticated controls (like, trees, grids, panels, etc). Some of the standard HTML controls are already fuly supported by Spring through the Spring Forms tag library. Wherever possible Skyway has used or extended these existing tags, such that they can be used in much the same way as they would be used in Spring standalone. Skyway Visual Perspectives provides support for the following tag libraries.

Tags are used as the primary building block for Skyway based web applciations. With this in mind, we can examine how tags are used to display information, interact with the user through the handling of events and interact with services as well as other components on the web page through the execution of web actions.


Tags, Events and Actions

Tags

Tags used to present information

  • Represent the primary building block of the web layer
  • Used with the Page Designer for page composition
  • Used for rendering of page components at runtime
  • Used for event handling and interaction with packaged JavaScript libraries such as prototype (possibly DWR, EXTJS and others later)


Events

Events are used to describe user gestures

As a user navigates in a web interaction - we need a mechanism to describe how the application should respond to particular user interactions or gestures. Events are the term we use to describe these gestures. A mouseclick is an event, a form sumit is an event. A page load is an event. The set of events available to a particular page within a Skyway Web Application is determinded by the HTML Specification, specifically the DOM Events reference specification.

Resources DOM Events Wikipedia: DOM Events The DOM Event Object


Web Actions

Web Actions are used to describe responses to a certain event. Web Actions are executed in the browser but can call through to logic on the server. A web action could be as simple a "Show Element" or as complex as "Invoke Server Action" os "Set Variables".

Web Actions will initially be implemented as "Tag-based" actions - meaning they are defiend and configured thorugh JSP tags even though they may emit JavaScript which executes in the browser. By making Web Actions tag based, we provide an easy way to add new types of actions in a consistent fashion. Additionally, we get all of the benefits and custom tag support provided by the Skyway Page Editor.

In the future, we may additionally support Script-based web actions that are defiend as standalone snippets of executable JavaScript, but for now Tag-based web actions can completely meet our needs.

Tag-based actions bind to particular events by containment within a specific Skyway container tage - the Skyway event tag. The Skyway event tag essentially defines an event handler for a named event. The contents of the event handler are determined by the tag-based web actions that are defined withing the Skyway event tag. The Skyway event tag then binds to a particular element on the page by containment or id. This means that you can define an event handler by enclosing a Skyway event tag as a nested tag for a UI component or you can define a Skyway event tag distinctly and point to the UI component by id.

Skyway will ship Visual Perspectives with a default set of web actions which represent the most frequently needed use cases - but will also make it very easy to add new web actions.


Architectural Details

Tag Implementation

Skyway has a core set of UI components and presentation elements that it must support out of the box. In providing implementations of these components, we wanted to leverage existing infrastructure as much as possible. As a results, these requirements have been met by combining tags from several tag libraries and presenting them as a single set. In particular. we currently make use of the Spring form tag library and the JSTL standard tags. We currently extend these existing tags and expose them through a common Skyway tag library (defined by a single skyway.tld tag library descriptor file).

Besides simply consolidating the tags into a unfied set, we extend the Spring tags in order to provide EL support for databinding.. We extend all of the Spring form tags to support this.

We also extend the JSTL tags, but at the moment we do not modify the behavior of the standard JSTL tags in any way.

Event Implementation

The Skyway event tag has initially been implemented as a JSP 2.0 .tag file. This tag emits JavaScript that attaches an event handler to the UI component being targeted. Specifically, it uses the JavaScript library - Prototype - to emit an Event.observe call on the target UI component. The body of the attached event handler is determine by any nested web action tag. Each nested web action tag contributes one or more lines of JavaScript into the event handler generated by the Skyway event tag.

In the event that we roll back to JSP 1.2 in liueu of JSP 2.0, then we would re-implement this tag as a JSP Tag class.


Action Implementation

Skyway has a core set of web actions that it must support out of the box. In addition, we want to make it very easy to support new types of web actions in the future. To meet this requirement, the default Skyway web action are implemented in exactly the same fashion as any custom web action would be implemented. Each web action is implemented as a JSP 2.0 tag file which emits JavaScript. The JAvaScript is used by the Skyway event tag to emit an event handler. The JavaScript emitted by a custom web action can make use of any of the features in Prototype (and other JavaScript libraries in the future).

We may later want to allow custom web action to contribute theirs own dependent JavaScript libraries - but that is something we can consider at a much later time.

Personal tools