Home  >  Development  >  features

Anatomy of an Enterprise Flex RIA Part 8: Development Cycle

| | Comments (0)
AddThis Social Bookmark Button
 
riaseries_part8.jpg

Last installment we looked at building Flex with Maven and Ant, and now we'll look at the development lifecycle so far. Then, in preparation for next installment, we'll look at the dependencies for the persistence layer.

Now that we have tasks to help us and we’ve hooked into a few points in the Maven build process, let’s discuss making changes and reviewing those changes through the web browser in our development environment.

Let’s look at it from this point of view (see Table 4). What type of resource changed, and what needs to happen for us to see the changes? The “Build” column in the table tells what command to run and from what project to run it to compile, build, or otherwise make the changes “stick.”

The “Deploy” column tells which command from which project will push the changes to the local development environment so that we can see the changes.

Table 4. Maven build Resource Changes
Type of changeChanged resource Build Deploy
Database
change
bookie-data/
src/data/
schema.xml
`ant load-schema` in bookie-dataNone needed
Entity or session bean changeAny Java in
bookie-data
`mvn package` in bookie-data`ant dev-deploy` in root of project


For example, Figure 9 shows the output of load-schema in the bookie-data project.

anatomy8_fig9.jpg
Figure 9. Output of load-schema in bookie-data project


Building the Persistence Layer: Maven Configuration

We’ve already gone over the bulk of the POM file and its interaction with Ant. All that’s left is to look at the dependencies:


    <dependencies>
        <dependency>
           <groupId>microcontainer.jboss.ejb3</groupId>
           <artifactId>hibernate-all</artifactId>
           <version>rc9</version>
           <scope>provided</scope>
        </dependency>
    ...
    </dependencies>


I’m not going to put the whole dependency list in here, but there are a few points to hit. Notice how a dependency uses the same “big three” identifiers that all projects need to define: groupId, artifactId, and version. This is enough information for Maven to uniquely pick out a dependency.<scope>, the next tag under the big three, tells Maven when the project needs the dependency. Table 5 lists the full explanation of scope from Maven’s web site.


Table 5. Scope in Maven
ScopeDescription
compileThis is the default scope, and it is used if none is specified. Compile dependencies are available in all classpaths.
providedThis is much like compile, but it indicates that you expect the JDK or a container to provide it. It is available only on the compilation classpath, and it is not transitive.
runtimeThis scope indicates that the dependency is not required for compilation, but it is required for execution. It is in the runtime and test classpaths, but not in the compile classpath.
testThis scope indicates that the dependency is not required for normal use of the application, and it is available only for the test compilation and execution phases.
systemThis scope is similar to provided, except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository.


Inside src is a directory for the main source of the project, called main. At the same level is a folder for test code, called test. The code goes in the main and test directories and is organized by the type of language—in this case, a java directory holds the Java code in the data project directory, and a java and flex directory in the web project.

You can also mark a dependency true if there isn’t a hard requirement for it. For instance, some logging packages will make use of some dependencies if they’re found, but won’t use them if they’re not found.

Remember that you can build the bookie-data’s persistence unit JAR by typing `mvn package` on the command line inside the root of the bookie-data project.

Next installment we're going to look at the code that makes up the persistence layer of our sample application, both the Java and ActionScript code. You can always find the entire series here.

Comments

Leave a comment


Type the characters you see in the picture above.

Related Books

Development Series

Get an overview of the tools and technologies that work together to allow developers to build Rich Internet Applications (RIAs) quickly and easily.

Anatomy of an Enterprise Flex RIA

Recent Comments

Archives


 
 


Or, visit our complete archive.  

About This Site

Welcome to the premiere community site for all things RIA sponsored by O'Reilly Media and Adobe Systems Incorporated.

About Us
Meet the Experts
Meet Our Contributors
Send Us Feedback