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 2014/12/31 12:59:50 UTC

svn commit: r1648685 - /isis/site/trunk/content/intro/tutorials/step-by-step-petclinic.md

Author: danhaywood
Date: Wed Dec 31 11:59:49 2014
New Revision: 1648685

URL: http://svn.apache.org/r1648685
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=1648685&r1=1648684&r2=1648685&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 Wed Dec 31 11:59:49 2014
@@ -120,15 +120,19 @@ To configure the app, use these links:
   * configure [Eclipse](http://isis.apache.org/intro/getting-started/ide/eclipse.html), import app
 * Set up IDE [editor templates](http://isis.apache.org/intro/resources/editor-templates.html)
 
-Then set up a launch configuration and check that you can:
+Then set up a launch configuration so that you can run the app from within the IDE.  To save having to run the fixtures 
+every time, specify the following system properties:
 
-* Run the app from within the IDE
-* Run the app in debug mode
-* Run with different deploymentTypes; note whether `@Prototype` actions are available or not:
-  - `--type SERVER_PROTOTYPE`
-  - `--type SERVER`
+    -Disis.persistor.datanucleus.install-fixtures=true -Disis.fixtures=fixture.simple.scenario.SimpleObjectsFixture
+    
+For example, here's what a launch configuration in IntelliJ idea looks like:    
 
 <a href="resources/petclinic/020-01-idea-configuration.png"><img src="resources/petclinic/020-01-idea-configuration.png" width="600"></img></a>
+
+where the "before launch" maven goal (to run the DataNucleus enhancer) is defined as:
+
+<a href="resources/petclinic/020-02-idea-configuration.png"><img src="resources/petclinic/020-02-idea-configuration.png" width="300"></img></a>
+
   
   
 ## Explore codebase
@@ -170,9 +174,7 @@ If you have issues with the integration
     
 ## Update POM files
 
-The generated POM files use describe the app as "SimpleApp".  Update them to say "PetClinic".
-
-edit:
+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)
@@ -183,8 +185,46 @@ git checkout [68904752bc2de9ebb3c853b792
 
 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.
 
-> checkpoint:
-> https://github.com/danhaywood/isis-app-petclinic/commit/68904752bc2de9ebb3c853b79236df2b3ad2c944
+
+{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":
+
+* in the `dom` module's production code
+    * `SimpleObject` -> `Pet` (entity)
+    * `SimpleObjects` -> `Pets` (repository domain service)
+    * `SimpleObject.layout.json` -> `Pet.layout.json` (layout hints for the `Pet` entity)
+    * delete the `SimpleObject.png`, and add a new `Pet.png` (icon shown against all `Pet` instances).
+* in the `dom` module's unit test code
+    * `SimpleObjectTest` -> `PetTest` (unit tests for `Pet` entity)
+    * `SimpleObjectsTest` -> `PetsTest` (unit tests for `Pets` domain service)
+* in the `fixture` module:
+    * `SimpleObjectsFixturesService` -> `PetClinicAppFixturesService` (rendered as the prototyping menu in the UI)
+    * `SimpleObjectsTearDownService` -> `PetClinicAppTearDownService` (tear down all objects between integration tests)
+    * `SimpleObjectAbstract` -> `PetAbstract` (abstract class for setting up a single pet object
+        * and corresponding subclasses to set up sample data (eg `PetForFido`)
+    * `SimpleObjectsFixture` -> `PetsFixture` (tear downs system and then sets up all pets)
+* in the `integtest` module:
+    * `SimpleAppSystemInitializer` -> `PetClinicAppSystemInitializer` (bootstraps integration tests with domain service/repositories)
+    * `SimpleAppIntegTest` -> `PetClinicAppIntegTest` (base class for integration tests)
+    * `SimpleObjectTest` -> `PetTest` (integration test for `Pet` entity)
+    * `SimpleObjectsTest` -> `PetsTest` (integration test for `Pets` domain service)
+* in the `webapp` module:
+    * `SimpleApplication` -> `PetClinicApplication`
+    * update `isis.properties`
+    * update `web.xml`
+    
+{note
+git checkout [bee3629c0b64058f939b6dd20f226be31810fc66](https://github.com/danhaywood/isis-app-petclinic/commit/bee3629c0b64058f939b6dd20f226be31810fc66)
+}
+
+
+
 
 
 <!--