Skip to end of metadata
Go to start of metadata

Developing a Tynamo app using an IDE

Class reloading and hot-code swapping

As explained in Tapestry's documentation on class reloading, Tapestry automatically reloads your changes in templates and classes without having to restart the context/container/JVM. Sun's JVM has also supported hot code swapping for years, though that only works only for changing code within the method body, not for method signatures, but that nicely compliments Tapestry's class reloading as typically your services have better defined interfaces. Generally, if you find yourself restarting the container often, you are doing something wrong. You also want to configure the container's JVM with -Dtapestry.production-mode=false setting to give you nice and exact error reporting (see Tapestry's configuration guide)

Using Eclipse

You want to use Eclipse IDE for Java EE Developers, the latest (at the time of writing this) Eclipse JEE 3.5.x is known to work fine. You also need some Maven support as Eclipse doesn't yet have built-in Maven integration. Your best option is to get the m2eclipse plugin (use the 0.9.9 dev version.

For integrated, in-place development, you have several options: jetty (with Eclipse Run Jetty Run plugin), Tomcat (with Sysdeo's Tomcat plugin or with Merve Tomcat Launcher), or using JEE's native servlet container support. JEE's native container support tends to be somewhat cumbersome as the concept is generalized to work for multiple servlet containers and doesn't offer as high level of integration for a particular container. One of the issues is that JEE's support works so it scans source folders and copies them to target directories, for which there isn't a real need for. Sysdeo's Tomcat plugin offers the highest level of Tomcat integration (reload web app context from a context-specific menu, separate buttons for starting and stopping), but has its own issues for loading the dependent libraries (need to manually install devloader, need to semi-manually keep the libraries in sync when you add them, pukes out if multiple servlet-apis are found on load path). Merve is a good choice if you want to get up and running quickly with Tomcat, without having to install it first and and it allows you to set the port etc. for the container straight from Eclipse. Merve adds itself as Eclipse/Run As.. configuration and you don't need to manually update library paths or anything else.

Jetty is another servlet container and has a no-frills Eclipse plugin very similar to Merve. Some claim Jetty is a little faster to start-up than Tomcat which is an advantage in development, but equally configured, it's difficult to notice any real difference in performance.

Using IntelliJ IDEA

Since version 7.0 IntelliJ IDEA lets you create projects directly from Maven descriptor files, enabling you to quickly switch to your selected development environment.
Starting with version 9, IntelliJ IDEA is offered in two editions: Community Edition, free and open-source, and Ultimate Edition, encompassing 100% of the famous IntelliJ IDEA functionality. http://www.jetbrains.com/idea/download/
The Community Edition includes fully integrated Maven support.
Importing Maven projects to IntelliJ IDEA with automatic artifacts downloading is pretty easy.
Start a new project selecting "Import project from external model"

Then select Maven.

Finally select the root directory for your new Tynamo project.

Idea also lets you execute and manage Maven goals from within the IDE.
If the Community Edition is not enough for you the Ultimate Edition has beautiful support for both Hibernate & Tapestry.

Back to Creating your domain model or continue to Working with databases

  • No labels