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. 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. Here’s a sketch of (our version of) its domain:

diagram

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 Pets for said Owner

  • book a Pet in for a Visit

  • enter an outcome and cost of a Visit

  • allow an Owner to pay for a Visit

  • find Visits not yet paid and overdue

  • delete an Owner and its Pets and Visits, so long as there are no unpaid Visits.

This tutorial has worked solutions for all of these.

Rename HelloWorldObject to Owner

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

Solution

git checkout tags/020-rename-HelloWorldObject-to-Owner
mvn clean package jetty:run

Exercise

  • the changes for HelloWorldObject entity are:

    • rename class HelloWorldObjectOwner

    • rename file HelloWorldObject.layout.xmlOwner.layout.xml

    • rename file HelloWorldObject.pngOwner.png

      • or replace with another more suitable icon

    • rename class HelloWorldObjectTest_updateNameOwnerTest_updateName

    • rename class HelloWorldObjectTest_deleteOwnerTest_delete

  • for the HelloWorldObjects domain service:

    • rename class HelloWorldObjectsOwners

    • update file menubars.layout.xml

Run the application and make sure it still runs fine.