Context Framework

Context Framework
Context Framework
Stable release 0.8.4 / August 23, 2011
Written in Java
Operating system Cross-platform
Type Application Framework
License Apache License 2.0
Website contextfw.net

The Context Framework is an open source component based web framework for the Java platform and it has similarities with Apache Wicket and Lift.

Contents

Design

The goal of Context is to create a flexible and lightweight framework based on XSLT-templating language. All pages are a tree of components (including the page-component ifself) and during rendering they form a single DOM-tree that is transformed into XHTML. The choice creates a sharp separation between logical representation and physical representation and only very little logic is possible to present on XSLT-templates.

Second aspect is that all interaction and page updates are javascript based. For instance traditional form-submits are not encouraged, however they are possible if needed. Third, the component-model is designed in such way that each component is able to update their content independently from other components. This enables complex interaction between page components.

Pages themselves are normally made of multiple views that are nested. With this approach the outer views can concentrate to general content such as HTML-decrations or menus. Outer views also generate a natural perimeter for authentication so that only authenticated users are allowed to access inner views.

Framework is also highly stateful, where each page instance has their own state on server. This is called a page scope. The goal was to create page state in such manner that it does not interfere with having multiple open pages on same site. A speciality for mainting the page scopes is that no cookies or session is used.

Even if framework is considered stateful, creating new pages is lightweight operation thus making Context suitable for small sites or large web applications.

Context support full live class reloading to pages and their components during development mode. It allows new set of compiled classes to be loaded into system during page loads thus minimizing the need for complete system restarts. The live class reloading can be extend singletons-scoped instances if designed carefully.

Example

A Hello World view, containing two files:

HelloWorldView.java
The Java-component for the page
@PageScoped
@View(url="/helloworld", parent=OuterView.class)
public class HelloWorldView extends Component {
 
    @Attribute
    private Date currentTime = new Date();
 
}

When rendered this component translates into following DOM-tree snippet:

<HelloWorldView id="el1" currentTime="...." />
HelloWorldView.xsl
The template for the view
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
<xsl:template match="HelloWorldView">
 <h1>Hello World!</h1>
 <p>
  Current date is: <xsl:value-of select="currentTime" />
 </p>
</xsl:template>
 
</xsl:stylesheet>

See also

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Context-dependent memory — refers to improved recall of specific episodes or information when the context present at encoding and retrieval are the same. One particularly common example of context dependence at work occurs when an individual has lost an item (e.g. lost car …   Wikipedia

  • Context-aware pervasive systems — Context aware computing refers to a general class of mobile systems that can sense their physical environment, and adapt their behavior accordingly. Such systems are a component of a ubiquitous computing or pervasive computing environment. Three… …   Wikipedia

  • Context analysis — is a method to analyze the environment in which a business operates. Environmental scanning mainly focuses on the macro environment of a business. But context analysis considers the entire environment of a business, its internal and external… …   Wikipedia

  • framework — Sir Ernest Gowers (1965) was greatly offended by what he saw as the overuse of the expression within (or in) the framework of, meaning broadly ‘in the context of’. Presumably he grew tired of reading it in successions of official Civil Service… …   Modern English usage

  • context — [n] framework, circumstances ambience, background, conditions, connection, frame of reference, lexicon, relation, situation, substance, text, vocabulary; concepts 682,696 …   New thesaurus

  • Framework interpretation (Genesis) — This article focuses on the views of certain Christian commentators and theologians. For a more general account of the topic, see Creation according to Genesis. For a canvass of some of the Jewish approaches, see Jewish views on evolution. The… …   Wikipedia

  • Context-free grammar — In formal language theory, a context free grammar (CFG) is a formal grammar in which every production rule is of the form V → w where V is a single nonterminal symbol, and w is a string of terminals and/or nonterminals (w can be empty). The… …   Wikipedia

  • Framework Programmes for Research and Technological Development — The Framework Programmes for Research and Technological Development, also called Framework Programmes or abbreviated FP1 through FP8, are funding programmes created by the European Union in order to support and encourage research in the European… …   Wikipedia

  • Framework — A framework is a basic conceptual structure used to solve or address complex issues. This very broad definition has allowed the term to be used as a buzzword, especially in a software context. Conceptual frameworkA conceptual framework is used in …   Wikipedia

  • context — Synonyms and related words: alentours, ambiance, ambience, ambit, background, borderlands, circle, circuit, circumambiencies, circumjacencies, circumstances, compass, entourage, environing circumstances, environment, environs, existing conditions …   Moby Thesaurus

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”