« Who is replacing the web? | Main | Widgets and Social Commerce: news from the front of Web 2.0 »

Using Maven for building Flex enterprise applications

Maven is a project management and comprehension tool that covers all the phases of a software product development, such as building, documentation, reporting, dependencies, configuration management, releases, by applying well known patterns to a project's infrastructure. These characteristics allow multiple individuals to work at the same project, or at large projects that require the development of minor projects, without the need to understand all the phases, building order or generally the project in its ensemble. Maven goes beyond project building and towards complete project management, thus is appealing to project managers; the projects are managed through the POM structure, which is the Project Object Model that Maven introduces, and refer to library repositories that are required for a particular project. Repositories can be local or remote, the last ones can be mirrored and update the local ones; they allow developers to use the same versions of a library and generally to deal less with them.

The POM describes the project metadata, handles dependencies, describes goals; goals are tasks performed on a project, they have an output and are reusable, just like methods for an object. Maven is structured in modules, some of which included by default and handle common phases like build and deploy, others can be added and combined to best fit the project's requirements.

Another concept introduced by Maven is the archetype, which is defined as an original pattern or model from which all other things of the same kind are made (http://maven.apache.org/); it's a template that can be reused or created ad hoc, for example to reflect the common structure an organization wants its projects to have.

This tool can handle large, enterprise projects that involve different technologies and manages different stages of the development project. Maven can be used for the development of Flex applications also and its characteristics come into play when the application uses remoting services such as LiveCycle Data Services together with Java EE: Maven allows to integrate the build, test, integration and deploy processes through unique commands, at the cost of the creation of the POM files. There is a Maven plugin for Flex that can be found at http://www.israfil.net/projects/mojo/maven-flex2-plugin/ that enables Flex applications building using Maven and Flex SDK. The plugin has to be obtained separately and has to be instructed on where the Flex SDK is installed on the system. The plugin provides three goals: flex2:compile-swc, flex2:copy-flex-applications and flex2:compile-swf that allow to build a swf / swc file and move it to a specified location; the goals are highly configurable and provide parameters to best customize the build.

The plugin developer site offers an example on how to create the POM files for a Flex application that uses Data Services. The example is at http://www.israfil.net/projects/mojo/maven-flex2-plugin/examples/simple_war_project.html and worths illustrating some of the aspects: two POM files describe the build of the swf application and of the WAR application; the swf POM defines common compilation parameters such as useNetwork and dataServicesConfig (for the path to the data services services-config.xml file); the war POM file, besides build configuration, sets all required dependencies and one of them is the swf build, as a tag.

Maven is a smart tool that greatly helps managing large or complex projects and through its plugins can be easily used to develop simple Flex applications as well as data services Flex applications, that are heterogeneous in technology; its structure allows the deploying of such applications to be made in single, defined steps: just call the deploy goal and all the backends, frontends and configuration files are being placed as defined in the POM file.

TrackBack

TrackBack URL for this entry:
http://blog.comtaste.com/mt-tb.cgi/33

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on November 11, 2007 11:48 PM.

The previous post in this blog was Who is replacing the web?.

The next post in this blog is Widgets and Social Commerce: news from the front of Web 2.0.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33