Home >
Anatomy of an Enterprise Flex RIA Part 8: Development Cycle
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 change | Changed resource | Build | Deploy |
| Database change | bookie-data/ src/data/ schema.xml | `ant load-schema` in bookie-data | None needed |
| Entity or session bean change | Any 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.
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 | |
|---|---|
| Scope | Description |
| compile | This is the default scope, and it is used if none is specified. Compile dependencies are available in all classpaths. |
| provided | This 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. |
| runtime | This 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. |
| test | This 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. |
| system | This 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. |
You can also mark a dependency
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.







Facebook Application Development
Thanks for Maven’s web site link. I found the link very useful
-------------------------------------
Greg MyPage
Hi all
I tried a few weeks ago and it crashed very often. i dnt know why but i had to uninstall and now i use ie7 again. i will wait for a later release.
lazer epilasyon
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 catering
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. yemek şirketi very nice article.
This 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. nakliyat heer very nice.Good article.