Getting Started with Roo
Josh Long, Steve Mayzak
Format: PDF / Kindle (mobi) / ePub
Spring Roo goes a step beyond the Spring Framework by bringing true Rapid Application Development to Java—just as Grails has done with Groovy. This concise introduction shows you how to build applications with Roo, using the framework's shell as an intelligent and timesaving code-completion tool. It's an ideal RAD tool because Roo does much of the tedious code maintenance.
You'll get started by building a simple customer relationship management application, complete with step-by-step instructions and code examples. Learn how to control any part of the application with Roo's opt-in feature, while using this open source framework to automate the rest of the code.
* Set up a Spring application and working Maven build to see Roo in action
* Address persistence with JPA and the Neo4j graph database—and learn how Roo supports NoSQL databases
* Use Roo’s database reverse-engineering feature to generate a data model from an existing schema
* Build Roo applications with Spring MVC, Spring WebFlow, Google Web Toolkit, Vaadin, and other web frameworks
* Secure and test your application
and leaves you with a working GWTbased UI for your entities, in much the same fashion as the original Spring MVC application. Below is a screenshot. You can restart the Spring application inside of tcServer, and then start the GWT client side code itself. SpringSource Tool Suite already has all the Google plugins pre-configured to support development with GWT. Your Integrating Roo with other Web Frameworks | 37 Maven builds already been configured to correctly compile the GWT application code
once (in college, perhaps? You don’t have to admit it aloud. You were young. It was a warm summer evening … the moon was full … and your awesome new startup (TM) needed a way to manage customer data. Totally cool. No worries. We won’t judge.) Now that you’ve got SpringSource Tool Suite installed, fire it up, select a workspace, and then go to File > New > Spring Roo Project (Figure 1-4). Figure 1-4. Opening a new Roo Project The dialog’s a bit “busy,” but you don’t need to worry about most of
as to what Spring Roo can help you achieve, type “help,” and then hit Enter. Spring Roo will show all the commands that it can respond to. Similarly, if you ever have a doubt as to how to proceed, ask Roo by typing “hint” on the shell. Let’s do so: Welcome to Spring Roo. For assistance press CTRL+SPACE or type "hint" then hit ENTER. roo> hint Roo requires the installation of a JPA provider and associated database. Type 'persistence setup' and then hit CTRL+SPACE three times. We suggest you type
commands and writing them to a log at the root of the project in a file called log.roo which you can refer to anytime you want. Naturally, you can also save off the commands into a file and run them on the shell, effectively replaying your commands. This is, among other things, a very convenient way to bootstrap new projects. We’re going to tell you how to do this, this time, but remember, long after you’ve finished reading this tidy, tiny tome on Spring Roo, you may occasionally find that you’re
(Figure 1-8). Uncheck it if it’s selected. You are not supposed to modify these other files, they are there for Roo but lets see whats in them. Open the SRC_MAIN_JAVA/com/crmco/crm/model/Cus tomer_Roo_Entity.aj file. This file exists because Spring Roo placed a @RooEntity annotation on your class. If you examine the code, you’ll see that Spring Roo’s already generated an ID for your Customer entity, it’s already generated a version column, and it’s already generated simple, ActiveRecord-style