You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2015/01/01 17:49:46 UTC
svn commit: r1648882 -
/isis/site/trunk/content/intro/tutorials/step-by-step-petclinic.md
Author: danhaywood
Date: Thu Jan 1 16:49:45 2015
New Revision: 1648882
URL: http://svn.apache.org/r1648882
Log:
petclinic tutorial
Modified:
isis/site/trunk/content/intro/tutorials/step-by-step-petclinic.md
Modified: isis/site/trunk/content/intro/tutorials/step-by-step-petclinic.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/intro/tutorials/step-by-step-petclinic.md?rev=1648882&r1=1648881&r2=1648882&view=diff
==============================================================================
--- isis/site/trunk/content/intro/tutorials/step-by-step-petclinic.md (original)
+++ isis/site/trunk/content/intro/tutorials/step-by-step-petclinic.md Thu Jan 1 16:49:45 2015
@@ -41,6 +41,10 @@ You'll need:
## Run the archetype
+{note
+git checkout [249abe476797438d83faa12ff88365da2c362451](https://github.com/danhaywood/isis-app-petclinic/commit/249abe476797438d83faa12ff88365da2c362451)
+}
+
As per the [Isis website](http://isis.apache.org/intro/getting-started/simpleapp-archetype.html), run the simpleapp archetype to build an empty Isis application. We recommend you use the snapshot release:
mvn archetype:generate \
@@ -59,11 +63,7 @@ This will generate the app in a `petclin
rmdir petclinic
-
-{note
-git checkout [249abe476797438d83faa12ff88365da2c362451](https://github.com/danhaywood/isis-app-petclinic/commit/249abe476797438d83faa12ff88365da2c362451)
-}
-
+
## Build and run
@@ -183,15 +183,19 @@ If you have issues with the integration
## Update POM files
-The POM files generated by the simpleapp archetype describe the app as "SimpleApp". Update them to say "PetClinic" instead.
-
{note
git checkout [68904752bc2de9ebb3c853b79236df2b3ad2c944](https://github.com/danhaywood/isis-app-petclinic/commit/68904752bc2de9ebb3c853b79236df2b3ad2c944)
}
+The POM files generated by the simpleapp archetype describe the app as "SimpleApp". Update them to say "PetClinic" instead.
+
## Delete the BDD specs
+{note
+git checkout [9046226249429b269325dfa2baccf03635841c20](https://github.com/danhaywood/isis-app-petclinic/commit/9046226249429b269325dfa2baccf03635841c20)
+}
+
During this tutorial we're going to keep the integration tests in-sync with the code, but we're going to stop short of writing BDD/Cucumber specs.
Therefore delete the BDD feature spec and glue in the `integtest` module:
@@ -199,19 +203,16 @@ Therefore delete the BDD feature spec an
* `integration/specs/*`
* `integration/glue/*`
-{note
-git checkout [9046226249429b269325dfa2baccf03635841c20](https://github.com/danhaywood/isis-app-petclinic/commit/9046226249429b269325dfa2baccf03635841c20)
-}
## Rename the app, and rename the SimpleObject entity
-Time to start refactoring the app. The heart of the PetClinic app is the `Pet` concept, so go through the code and refactor. While we're at it, refactor the app itself from "SimpleApp" to "PetClinicApp".
-
{note
git checkout [bee3629c0b64058f939b6dd20f226be31810fc66](https://github.com/danhaywood/isis-app-petclinic/commit/bee3629c0b64058f939b6dd20f226be31810fc66)
}
+Time to start refactoring the app. The heart of the PetClinic app is the `Pet` concept, so go through the code and refactor. While we're at it, refactor the app itself from "SimpleApp" to "PetClinicApp".
+
See the git commit for more detail, but in outline, the renames required are:
* in the `dom` module's production code
@@ -264,6 +265,10 @@ To run the application will require a fu
## Add PetSpecies (as an enum)
+{note
+git checkout [55c9cd28ff960220719b3dc7cb8abadace8d0829](https://github.com/danhaywood/isis-app-petclinic/commit/55c9cd28ff960220719b3dc7cb8abadace8d0829)
+}
+
Each `Pet` is of a particular species. Model these as an enum called `PetSpecies`:
public enum PetSpecies {
@@ -287,13 +292,13 @@ Introduce a new property on `Pet` of thi
Update fixtures, unit tests and integration tests.
-{note
-git checkout [55c9cd28ff960220719b3dc7cb8abadace8d0829](https://github.com/danhaywood/isis-app-petclinic/commit/55c9cd28ff960220719b3dc7cb8abadace8d0829)
-}
-
## Icon reflects the pet species
+{note
+git checkout [2212765694693eb463f8fa88bab1bad154add0cb](https://github.com/danhaywood/isis-app-petclinic/commit/2212765694693eb463f8fa88bab1bad154add0cb)
+}
+
Rather than using a single icon for a domain class, instead a different icon can be supplied for each instance. We can therefore have different icon files for each pet, reflecting that pet's species.
public class Pet {
@@ -306,10 +311,6 @@ Rather than using a single icon for a do
Download corresponding icon files (`Dog.png`, `Cat.png` etc)
-{note
-git checkout [2212765694693eb463f8fa88bab1bad154add0cb](https://github.com/danhaywood/isis-app-petclinic/commit/2212765694693eb463f8fa88bab1bad154add0cb)
-}
-
Running the app shows the `Pet` and its associated icon:
<a href="resources/petclinic/050-01-list-all.png"><img src="resources/petclinic/050-01-list-all.png" width="600"></img></a>