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:
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 saidOwner
-
book a
Pet
in for aVisit
-
enter an
outcome
andcost
of aVisit
-
allow an
Owner
to pay for aVisit
-
find
Visit
s not yet paid and overdue -
delete an
Owner
and itsPet
s andVisit
s, so long as there are no unpaidVisit
s.
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
Exercise
-
the changes for
HelloWorldObject
entity are:-
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.