Software:Force4

From HandWiki

Force4 is a development system and framework for the rapid development of rich Internet applications for the connection of databases to different presentation technologies. It integrates the creation and reverse engineering of database models, the creation of the necessary objects and access classes and the composing of Rich Internet Applications.

Function and Components of Force4

Workflow

Force4 Workflow

There is a clear difference between the Force4 application and the Force4 server. The Force4 application is installed on the desktop computer and consists of the Modeler and the Composer. The Force4 server is the communications backend for the applications made by the Composer.

The creation of RIAs with Force4 is divided in the two parts; database modeling and application composing. The Modeler can do both, communicate with the database to read its structure (Reverse Engineering) and change its structure as well. The structures are saved in the models. These abstract tables, views, columns etc. and their connections with each other into entities and relationships. In addition to that, the relevant properties of the database, such as available column types and JDBC parameters are saved. These models are both used by the composer to present the entities, attributes and relations and to connect them with visual and functional components. If the Force4 Server is Java EE based the models and the Java classes are saved on the server. They are used by the Force4 Server Framework to implement the object relational mapping. The modeler also creates both the classes and the access objects needed for the web client programming. These are referenced by the source code generated by the Composer for the applications. These Composer-generated applications are delivered from the presentation server to the web clients.

Databases

Force4 Database

The connection from the web client to the database is done by the Force4 Server. The web client never communicates directly with the database, rather only through a unified interface. This interface is on the one part based upon the force4-generated models and on the other part on strictly defined functions.

In the case of Java EE based Force4 Server, RDBMS are generally addressed by JDBC. From the feature set of the specific JDBC driver results both the possibility of Reverse-Engineering and DDL creation since Force4 accesses the database directly through the Java package java.sql. These steps are executed in the Force4 Modeler. Runtime database accesses (e.g. selects, updates,...) are executed by the ORM Layer in the Force4 server component. The web clients call Java methods (in Adobe Flex over Remote Objects, in OpenLaszlo over Java RMI), which obtain the data over the ORM Layer or send them to the database. The ORM Layer uses the Force4 Modeler created model to transform the abstract entities and relations used in the web client applications into database tables, columns and the required SQL dialect. The creation of primary keys needed for the insertion of new data is also executed. This can be configured in the modeler.

Primary keys are the foundation of object persistence between server and client. Although the client may have more than one instance of a database object available, on the server it is always the same one managed by the ORM Layer. Changes to the server side objects are therefore directly available to all clients. The Force4 server ensures the integrity of the objects, even if several clients manipulate the same object. The ORM Layer takes care of both database integrity and also object caching. Thereby guaranteeing optimal performance and memory usage.

The above-mentioned results in the advantage that web applications need not know the real database construct (tables, data types, primary and foreign keys...) but only the abstract view. Thus it is possible to offer a unified framework for the applications. This solution allows database structures to be changed (to a certain extent) without having to change applications. Moreover, the target database can be exchanged for another RDBMS System, as the Force4 Modeler can convert models between databases.

Applications

Force4 Application

The Force4 Composer-applications use the Force4 client framework and the object and access classes created by the Modeler to communicate with the database. The client framework offers basic DB access methods and an event management, which use the functional Force4 client components (search, list,...). The client framework is available in source code and is described in the developer documentation, so it can also be used in applications not created by the Force4 Composer.

Force4 RIAs consist of two kinds of components. First of course, the standard ones provided by the language of the presentation server. In order to introduce automatic functionality, so-called functional components are used. These components are derived from certain standard components. Their functionality includes search, lists and detail views. A search is specified by input fields such as: texts, date and popup lists. Subcomponents from the Force4 Client framework are used for this. The search action initiates a request through the Force4 server to the database. The results of these requests are listed and presented in the list component. Sole entries from the list can be shown in a detail component and also be edited and deleted therein. The functional components communicate with each other through an event mechanism, which relays changes to components to other related components. This mechanism allows not for only simple search-list-detail RIAs to be created, but also complex master-detail dependencies to be visualised.

Data Flow

Force4 Data Flow

The data flow shows the division between the Force4 Composer and the Force4 server component. The Force4 applications constructed by the Composer or handmade are delivered by a presentation server (Flex, Open Laszlo). Under certain circumstances the server will deliver parts of applications, libraries, pictures etc. afterwards. The client application uses, in case of Flex, so-called Remote Objects to communicate via an AMF gateway with the force4 server component. This means that all Force4 database operations are managed via this connection. The advantage of this concept is the possible division of the load between presentation server and Force4 server. Because the Force4 server component for the Java EE server is not tied to a Macromedia Flex it is possible to implement a standard Apache TOMCAT with OpenAMF as gateway.

Modeler

Force4 Modeler

The Force4 Modeler is an E/R-modeling-tool to easily deposit data structures in a repository and to keep these up-to-date quickly and easily during the modeling phase of a process. Furthermore, the Force4-Modeler works as a development connection between the database and Java, Macromedia Flex, Omnis Studio, with their specific terminologies.

The model in Force4-Modeler is first an abstract "construct", consisting of entities, attributes and relations, in order to build and present data structures resulting, for example, from a business-process. The construction can be done manually in the Modeler. Reading the structures from existing databases through a direct connection using JDBC, a so-called reverse engineering is also possible. After a model has been created based on functional demands, it is also possible to create a database as well as direct connections to Java, Macromedia Flex and Omnis Studio.

Entities and attributes are abstract counterparts to tables and table columns in a database. In addition to the properties which are needed to define a database table, further properties of entities and attributes can be set to create compatibility to Java and Macromedia Flex.

Relations in Force4-Modeler are connections between entities. The construction of these relations define the entities to form a relational structure. Relations on the database are represented by Foreign Key constraints, conditions on database-level, which show the connection of the tables as long as the database supports these constraints.

Composer

Force4 Composer

The Force4 Composer is the tool to create fast and easy Rich Internet applications from existing E/R Models, which have been made with the help of the Force4 Modeler. Here WYSIWYG GUI components and functions are put together using Drag & Drop. Applications can be created directly from templates, which have also been created by the Composer. The individual parts of the application can be attributed in style, size, etc. Additionally, these so-called containers, may be reused in other applications. The composer saves the application in a local database and is independent of the created source text. These applications are generated automatically and can be previewed in real-time, if connected to a presentation server.

Offline mode is available if the presentation server cannot be used directly. The composer is able to create RIAs without any further programming effort. The application's source text may be edited by the developer at a later date. This may be necessary in order to integrate specific business logic in the RIA. The Force4 Composer offers the basic tools for such integration. Thanks to the integrative character of Force4, Force4 is an ideal tool for rapid prototyping of database-supported rich Internet applications.

The Server Side

Force4 creates applications for Macromedia Flex and Open Laszlo RIA as source text, which are compiled by the presentation server and delivered to the client. The Force4 framework is used for this. The interface for RemoteObjects/JavaRPCs is defined in the framework. The framework is installed on the Flex/Open Laszlo server, at the same place where the composer saves its generated source text. This location will be used while compiling the Flash applications later on.

The framework is a part of the Force4 Server component, but requires no Force4 license and therefore it can be used easily on the presentation server which itself is not responsible for the Force4 database communication. The communication parts of the Force4 component can therefore be installed on all the common Java EE compatible servers. The current version expects a JRE 1.4.2 or compatible Java environment. A JDK is not necessary. Furthermore, the Force4 Server contains all the necessary packages to be able to run with standard JDBC (package java.sql) in JRE. Force4 does not use JDBC/JNDI name-binding and therefore it is totally independent from the Java EE server configured Java data sources. The necessary JDBC drivers needed for the database communication are also included in Force4. Extra drivers can be integrated as well.

See also

References

External links