My Roo prototype application

Spring Roo is a promising rapid application developer (RAD) tool from SpringSource. I took it for a test spin. Download and installation of the Eclipse-based STS was a breeze.  After some tries at making projects and using the included Maven tool, I felt ripe for making my program. Here is what I did:
  1. Start STS. Be prepared to wait while it loads hundreds of jar files and readies its resources and internal structures.
  2. New SpringSource | Roo Project. After filling out the details in a dialog window, Roo started to make some directories. Then the dialog window hang for a minute or two before it disappeared. During this period, the hard disk LED lighted now and then, signaling some activity going on, possibly updating the maven configuration. At the end the Roo Shell window appeared, tab stacked with the console.
  3. Roo shell appeared and I issued Roo commands.
  4. hint gave me first the hint that a persistence manager was needed.
  5. persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY told Roo what technologies to use as persistence manager. Roo updated some files and extended Mavens pom.xml with some dependencies.
So far so good. Now sketching the rough data models with primary types, leaving relations for later.
  1. entity --class ~.domain.Person creates a clean Roo class, which is a POJO with Roo annotations.
  2. field string --fieldName Name --notNull creates a private field in the last active class, the Person class.
  3. field string --fieldName Phone creates another private field, this one is nullable.
  4. entity --class ~.domain.Technology creates another class. For the next field insertions, it is easy to utilize the 'up' arrow key to select commands from history.
  5. field string --fieldName Phone creates a field in this new class. Ops! Wrong name of field.
  6. Deleted field references by manual file edit. The files were listed in console when Roo made changes to them, so in practice I just had to click on 3 file links to bring up 3 editor windows, one per file. I deleted all references to this field, in 2 of the files before Roo showed me the last field reference was deleted automatically after it has been deleted from the base domain class.
  7. Added code "private String Name" to domain class Technology.java and saved. Roo responded automatically by managing the associated ToString file and created a JavaBean file with the getter and setters. Roo notified in console which files were modified and what were done (managed, created), so the user has good control of what happens.
  8. Entered "entity --class KnowledgeLevel" in Roo Shell, and entered "private String description" in the Roo generated file KnowledgeLevel.java. Roo logged that it made changes in 2 files.
That was the basic data model, now onto relationships between these entities.
  1. field set --fieldName buildsUpon --element Technology should take care of 1:n relationships of type builds-upon between Technologies
  2. field set --fieldName equivalentTo --element Technology 
  3. field set --fieldName distributedOn --element Technology 
  4. field set --fieldName categorizedAs --element Technology
  5. Realizing such a set of relationships could replace KnowledgeLevel entirely, I simply delete KnowledgeLevel from the file list and Roo takes care of removing references in other files so everything stays all synced.
  6. class --class Person gets Roo shell to focus on this class instead of Technology
  7. field set --fieldName certifiedIn --element Technology and then make some other degrees of familiarity thought to be useful, some expand application focus to include technology planning.
  8. field set --fieldName comfortableWorkingWith --element Technology   
  9. field set --fieldName seeksExperienceWith --element Technology   
  10. field set --fieldName readAbout  --element Technology 
This is more than enough for relationships so let's go on with interaction controls.
  1. controller all --package ~.web
Amazingly, this is all that it takes. Roo is off making many many files and views and whatnot.


Surprisingly, Roo manages to pick plural forms of the entities when it creates URL parts for the controllers; Person -> /people, although it fails at Technology -> /technologys. A minor edit in the Roo generated TechnologyController and Roo updates its view files and we are back on track.


However, my exploration ends here. The GWT generated code has errors and I tried some quick fixes alas to no avail. I realize both STS and Roo is milestones towards full releases, so it might be wise to not dig too deep now.
  1. Some ..gwt.request.SetRecord class does not exist.  For my prototype, it looks that it should be ..gwt.request.TechnologyRecord or ..gwt.request.PersonRecord. Quite some files are affected.

    Populære innlegg fra denne bloggen

    5 generations of computer languages

    DOJO kamptyper [forbedre egen kompetanse]

    Generations of text formats