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 2021/09/29 06:25:49 UTC

[isis] branch ISIS-2873-petclinic updated: ISIS-2783: updates to 010 and 020

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-2873-petclinic
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/ISIS-2873-petclinic by this push:
     new 3fb2ec2  ISIS-2783: updates to 010 and 020
3fb2ec2 is described below

commit 3fb2ec2a8c1df2d4d2b5270acf9601afb91fb33a
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Sep 29 07:24:13 2021 +0100

    ISIS-2783: updates to 010 and 020
---
 .run/SimpleApp.run.xml                             |  2 +-
 .../partials/UNUSED/faster-turnaround-times.adoc   |  2 +-
 .../petclinic/pages/010-getting-started.adoc       | 16 +++++--
 .../petclinic/pages/020-an-example-domain.adoc     | 55 ++++++++++++----------
 4 files changed, 43 insertions(+), 32 deletions(-)

diff --git a/.run/SimpleApp.run.xml b/.run/SimpleApp.run.xml
index e9d41a7..0a4dea2 100644
--- a/.run/SimpleApp.run.xml
+++ b/.run/SimpleApp.run.xml
@@ -1,6 +1,6 @@
 <component name="ProjectRunConfigurationManager">
   <configuration default="false" name="SimpleApp (JPA)" type="Application" factoryName="Application">
-    <option name="MAIN_CLASS_NAME" value="domainapp.webapp.SimpleApp" />
+    <option name="MAIN_CLASS_NAME" value="domainapp.webapp.PetClinicApp" />
     <module name="simpleapp-jpa-webapp" />
     <shortenClasspath name="ARGS_FILE" />
     <extension name="coverage">
diff --git a/antora/components/setupguide/modules/intellij/partials/UNUSED/faster-turnaround-times.adoc b/antora/components/setupguide/modules/intellij/partials/UNUSED/faster-turnaround-times.adoc
index 665d718..a8988b9 100644
--- a/antora/components/setupguide/modules/intellij/partials/UNUSED/faster-turnaround-times.adoc
+++ b/antora/components/setupguide/modules/intellij/partials/UNUSED/faster-turnaround-times.adoc
@@ -74,7 +74,7 @@ Similarly, gradle can be run to reduce the turn-around time when tweaking the UI
 xref:userguide:fun:ui.adoc#object-layout[*.layout.xml] file for each domain class), when the app is running.
 
 The framework will automatically notice any changes to `.layout.xml` files, but these are read from the classpath (the `target/classes` directory), not the source path.
-With IntelliJ these can be copied over manually by invoking `Run > Reload Changed Classes`.
+With IntelliJ these can be copied over manually by invoking menu:Run[Debugging Actions > Reload Changed Classes].
 Once the browser is refreshed, the new layout will be rendered.
 
 [NOTE]
diff --git a/antora/components/tutorials/modules/petclinic/pages/010-getting-started.adoc b/antora/components/tutorials/modules/petclinic/pages/010-getting-started.adoc
index 432e1e3..0d43f9f 100644
--- a/antora/components/tutorials/modules/petclinic/pages/010-getting-started.adoc
+++ b/antora/components/tutorials/modules/petclinic/pages/010-getting-started.adoc
@@ -34,7 +34,7 @@ Apache Isis provides a two starter apps, xref:docs:starters:helloworld.adoc[Hell
 These are identical in terms of functionality, but the simpleapp provides more structure and includes example tests.
 
 NOTE: there are JPA and JDO variants of the starter apps.
-This tutorial uses JPA as it is more commonly used.
+This tutorial uses JPA as it is the more commonly used persistence mechanism.
 
 We start the tutorial simply with a copy of xref:docs:starters:simpleapp.adoc[SimpleApp]; in subsequent exercises we'll refactor and build upon it to morph it into the petclinic domain.
 
@@ -46,6 +46,10 @@ We start the tutorial simply with a copy of xref:docs:starters:simpleapp.adoc[Si
 git clone https://github.com/apache/isis-app-demo
 ----
 
+* (optional) Load the git repo into a GUI tool such as SourceTree or GitKraken
++
+This will make it easier to inspect differences between different tags.
+
 * Checkout the first tag, and build:
 +
 [source,bash]
@@ -62,6 +66,8 @@ mvn -pl webapp spring-boot:run
 ----
 
 
+
+
 == Exercise 1.2: Explore the Simple App
 
 Although we'll be refactoring the codebase in the next exercise, take a few minutes to familiarize yourself with the functionality of the simpleapp.
@@ -93,7 +99,7 @@ If you want to go deeper, open up the xref:docs:starters:simpleapp.adoc[page des
 
 
 
-== Naked Objects pattern
+== Exercise 1.4: Naked Objects pattern
 
 Apache Isis is an implementation of the _naked objects pattern_, which means that entities (and later, as we'll see view models) are automatically exposed in the UI.
 
@@ -128,7 +134,7 @@ As well as writing our own domain services, there are also many framework-provid
 See the xref:refguide:applib-svc:about.adoc[Reference Guide: Domain Services] docs for the full list.
 
 
-== UI Hints
+== Exercise 1.5: UI Hints
 
 The framework derives as much of the UI as possible from the domain objects' intrinsic structure and behaviour, but there are some supporting structures and conventions that are there primarily to improve the UI.
 
@@ -190,7 +196,7 @@ This is modelled upon bootstrap and so supports arbitrary rows and columns as we
 * compare the structure of the layout file to that of the rendered object
 * change the file, eg the relative widths of the columns
 * use the IDE to copy over the file to the classpath; the new version will be picked up automatically
-** for example, with IntelliJ use menu:Run[Reload Changed Classes].
+** for example, with IntelliJ use menu:Run[Debugging Actions > Reload Changed Classes].
 
 
 You can learn more about file-based layouts in the fundamentals guide describing at xref:userguide:fun:ui.adoc#object-layout[Object Layout]s.
@@ -210,7 +216,7 @@ In a similar fashion, the actions of the various domain services are grouped int
 * compare the structure of the layout file to that of the rendered menu bar
 * change the file, eg reorder menu items or create new menus
 * again, use the IDE to copy over the file to the classpath
-** for example, with IntelliJ use menu:Run[Reload Changed Classes]/
+** for example, with IntelliJ use menu:Run[Debugging Actions > Reload Changed Classes]/
 
 
 To learn more, see the section of the fundamentals guide describing xref:userguide:fun:ui.adoc#file-based-menus[file-based] menu bar layout.
diff --git a/antora/components/tutorials/modules/petclinic/pages/020-an-example-domain.adoc b/antora/components/tutorials/modules/petclinic/pages/020-an-example-domain.adoc
index 2dcc942..92a02a8 100644
--- a/antora/components/tutorials/modules/petclinic/pages/020-an-example-domain.adoc
+++ b/antora/components/tutorials/modules/petclinic/pages/020-an-example-domain.adoc
@@ -2,7 +2,7 @@
 
 = An Example Domain
 
-By now you should understand the basics of what Apache Isis does, but there's only so much we can learn from a one domain class.
+By now you should understand the basics of what Apache Isis does, but there's only so much we can learn from a single domain class.
 Let's therefore evolve the app into a slightly more interesting domain and explore other features of the framework.
 
 The domain we're going to work on is a version of the venerable "Pet Clinic" app.
@@ -40,7 +40,7 @@ package pets {
     }
 
 
-    class Owner <<role>> {
+    class PetOwner <<role>> {
         +id
         ..
         #lastName
@@ -69,9 +69,9 @@ package visits {
 }
 
 
-Owner *-down-> "0..*" Pet
-Visit "   \n*" -up->  Pet
-Pet  "*" -right--> PetSpecies
+PetOwner *-r--> "0..*" Pet
+Visit "   \n*" -r->  Pet
+Pet  "*" -u-> PetSpecies
 ----
 
 [TIP]
@@ -82,44 +82,49 @@ The colours used are from "Java: Modeling in Color" book by Coad et al.
 
 Some of the use cases we might want to support include:
 
-* create an `Owner`
-* add and remove ``Pet``s for said `Owner`
+* create a `PetOwner`
+* add and remove ``Pet``s for said `PetOwner`
 * book a `Pet` in for a `Visit`
 * enter an `outcome` and `cost` of a `Visit`
-* allow an `Owner` to pay for a `Visit`
+* allow a `PetOwner` to pay for a `Visit`
 * find ``Visit``s not yet paid and overdue
-* delete an `Owner` and its ``Pet``s and ``Visit``s, so long as there are no unpaid ``Visit``s.
+* delete a `PetOwner` and its ``Pet``s and ``Visit``s, so long as there are no unpaid ``Visit``s.
 
 This tutorial has worked solutions for all of these.
 
-== Rename `HelloWorldObject` to `Owner`
+== Exercise 2.1: Refactor `SimpleObject` to `PetOwner`
 
-To start with, let's rename the `HelloWorldObject` entity to `Owner`
-You can either make the changes yourself, or just checkout the next git tag checkpoint
+To start with, let's rename the `SimpleObject` entity to `PetOwner`
 
 === Solution
 
 [source,bash]
 ----
-git checkout tags/020-rename-HelloWorldObject-to-Owner
-mvn clean package jetty:run
+git checkout tags/02-01-renames-SimpleObject-to-PetOwner
+mvn clean install
+mvn -pl spring-boot:run
 ----
 
-=== Exercise
+=== Tasks
 
-* the changes for `HelloWorldObject` entity are:
+Just checkout the solution above and review the git history to see the changes that have already been made.
+These include:
+
+* Domain classes renamed (along with corresponding tests)
+
+** `SimpleObject` entity -> `PetOwner`
+** `SimpleObjects` domain service -> `PetOwners`
+** `SimpleObjectRepository` repository service -> `PetOwnerRepository`
+
+** Infrastructure classes renamed
+
+** `SimpleModule` -> `PetsModule`
+** `SimpleApp` -> `PetClinicApp`
+
+* the `README.adoc` has been updated and slimmed down
 
-** rename class `HelloWorldObject` -> `Owner`
-** rename file `HelloWorldObject.layout.xml` -> `Owner.layout.xml`
-** rename file `HelloWorldObject.png` -> `Owner.png`
-*** or replace with another more suitable icon
-** rename class `HelloWorldObjectTest_updateName` -> `OwnerTest_updateName`
-** rename class `HelloWorldObjectTest_delete` -> `OwnerTest_delete`
 
-* for the `HelloWorldObjects` domain service:
 
-** rename class `HelloWorldObjects` -> `Owners`
-** update file `menubars.layout.xml`
 
 Run the application and make sure it still runs fine.