You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by bu...@apache.org on 2015/01/01 17:43:48 UTC
svn commit: r934699 - in /websites/staging/isis/trunk: cgi-bin/ content/
content/intro/tutorials/resources/petclinic/050-01-list-all.png
content/intro/tutorials/resources/petclinic/050-02-view-pet.png
content/intro/tutorials/step-by-step-petclinic.html
Author: buildbot
Date: Thu Jan 1 16:43:47 2015
New Revision: 934699
Log:
Staging update by buildbot for isis
Added:
websites/staging/isis/trunk/content/intro/tutorials/resources/petclinic/050-01-list-all.png (with props)
websites/staging/isis/trunk/content/intro/tutorials/resources/petclinic/050-02-view-pet.png (with props)
Modified:
websites/staging/isis/trunk/cgi-bin/ (props changed)
websites/staging/isis/trunk/content/ (props changed)
websites/staging/isis/trunk/content/intro/tutorials/step-by-step-petclinic.html
Propchange: websites/staging/isis/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Jan 1 16:43:47 2015
@@ -1 +1 @@
-1648695
+1648877
Propchange: websites/staging/isis/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Jan 1 16:43:47 2015
@@ -1 +1 @@
-1648695
+1648877
Added: websites/staging/isis/trunk/content/intro/tutorials/resources/petclinic/050-01-list-all.png
==============================================================================
Binary file - no diff available.
Propchange: websites/staging/isis/trunk/content/intro/tutorials/resources/petclinic/050-01-list-all.png
------------------------------------------------------------------------------
svn:mime-type = image/png
Added: websites/staging/isis/trunk/content/intro/tutorials/resources/petclinic/050-02-view-pet.png
==============================================================================
Binary file - no diff available.
Propchange: websites/staging/isis/trunk/content/intro/tutorials/resources/petclinic/050-02-view-pet.png
------------------------------------------------------------------------------
svn:mime-type = image/png
Modified: websites/staging/isis/trunk/content/intro/tutorials/step-by-step-petclinic.html
==============================================================================
--- websites/staging/isis/trunk/content/intro/tutorials/step-by-step-petclinic.html (original)
+++ websites/staging/isis/trunk/content/intro/tutorials/step-by-step-petclinic.html Thu Jan 1 16:43:47 2015
@@ -634,17 +634,26 @@ git checkout <a href="https://github.com
<p>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.</p>
+<p>Therefore delete the BDD feature spec and glue in the <code>integtest</code> module:</p>
+
+<ul>
+<li><code>integration/specs/*</code></li>
+<li><code>integration/glue/*</code></li>
+</ul>
+
<p><div class="note">
git checkout <a href="https://github.com/danhaywood/isis-app-petclinic/commit/9046226249429b269325dfa2baccf03635841c20">9046226249429b269325dfa2baccf03635841c20</a>
</div></p>
<h2>Rename the app, and rename the SimpleObject entity</h2>
+<p>Time to start refactoring the app. The heart of the PetClinic app is the <code>Pet</code> concept, so go through the code and refactor. While we're at it, refactor the app itself from "SimpleApp" to "PetClinicApp".</p>
+
<p><div class="note">
git checkout <a href="https://github.com/danhaywood/isis-app-petclinic/commit/bee3629c0b64058f939b6dd20f226be31810fc66">bee3629c0b64058f939b6dd20f226be31810fc66</a>
</div></p>
-<p>Time to start refactoring the app. The heart of the PetClinic app is the <code>Pet</code> concept, so go through the code and refactor. While we're at it, refactor the app itself from "SimpleApp" to "PetClinicApp".</p>
+<p>See the git commit for more detail, but in outline, the renames required are:</p>
<ul>
<li>in the <code>dom</code> module's production code
@@ -684,16 +693,86 @@ git checkout <a href="https://github.com
</ul></li>
</ul>
-<p><a href="resources/petclinic/020-01-idea-configuration.png"><img src="resources/petclinic/020-01-idea-configuration.png" width="600"></img></a></p>
+<p>To run the application will require an update to the IDE configuration, for the changed name of the fixture class:</p>
+
+<p><a href="resources/petclinic/030-01-idea-configuration.png"><img src="resources/petclinic/030-01-idea-configuration.png" width="600"></img></a></p>
+
+<p>Running the app should now show <code>Pet</code>s:</p>
+
+<p><a href="resources/petclinic/030-02-updated-app.png"><img src="resources/petclinic/030-02-updated-app.png" width="600"></img></a></p>
<h2>Update package names</h2>
<p>The classes created by the simpleapp archetype are by default in the <code>simple</code> package. Move these classes to <code>pets</code> package instead:</p>
+<p>See the git commit for full details; it's all pretty mechanical.</p>
+
<p><div class="note">
git checkout <a href="https://github.com/danhaywood/isis-app-petclinic/commit/55ec36e520191f5fc8fe7f5b89956814eaf13317">55ec36e520191f5fc8fe7f5b89956814eaf13317</a>
</div></p>
+<p>To run the application will require a further update to the IDE configuration, for the changed package of the fixture class:</p>
+
+<p><a href="resources/petclinic/040-01-idea-configuration-updated.png"><img src="resources/petclinic/040-01-idea-configuration-updated.png" width="600"></img></a></p>
+
+<h2>Add PetSpecies (as an enum)</h2>
+
+<p>Each <code>Pet</code> is of a particular species. Model these as an enum called <code>PetSpecies</code>:</p>
+
+<pre><code>public enum PetSpecies {
+ Cat,
+ Dog,
+ Budgie,
+ Hamster,
+ Tortoise
+}
+</code></pre>
+
+<p>Introduce a new property on <code>Pet</code> of this type:</p>
+
+<pre><code>public class Pet {
+ ...
+ private PetSpecies species;
+ @javax.jdo.annotations.Column(allowsNull = "false")
+ public PetSpecies getSpecies() { return species; }
+ public void setSpecies(final PetSpecies species) { this.species = species; }
+ ...
+}
+</code></pre>
+
+<p>Update fixtures, unit tests and integration tests.</p>
+
+<p><div class="note">
+git checkout <a href="https://github.com/danhaywood/isis-app-petclinic/commit/55c9cd28ff960220719b3dc7cb8abadace8d0829">55c9cd28ff960220719b3dc7cb8abadace8d0829</a>
+</div></p>
+
+<h2>Icon reflects the pet species</h2>
+
+<p>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.</p>
+
+<pre><code>public class Pet {
+ ...
+ public String iconName() {
+ return getSpecies().name();
+ }
+ ...
+}
+</code></pre>
+
+<p>Download corresponding icon files (<code>Dog.png</code>, <code>Cat.png</code> etc)</p>
+
+<p><div class="note">
+git checkout <a href="https://github.com/danhaywood/isis-app-petclinic/commit/2212765694693eb463f8fa88bab1bad154add0cb">2212765694693eb463f8fa88bab1bad154add0cb</a>
+</div></p>
+
+<p>Running the app shows the <code>Pet</code> and its associated icon:</p>
+
+<p><a href="resources/petclinic/050-01-list-all.png"><img src="resources/petclinic/050-01-list-all.png" width="600"></img></a></p>
+
+<p>with the corresponding view of the <code>Pet</code>:</p>
+
+<p><a href="resources/petclinic/050-02-view-pet.png"><img src="resources/petclinic/050-02-view-pet.png" width="600"></img></a></p>
+
<!--