I'm not sure exactly where to start the discussion.
Improving the Parent/Child relationships in XPages is NOT specific to using Java. You can get some improvements just by sticking with SSJS. You mention carrying a couple of repeated fields as being "no big deal". But in reality it can be depending on how you use it. You need to have code to keep those in sync etc. Or do a live lookup like @getDocField -I've never used that one myself - but that won't help you in a view I'm sure. Just from the form.
So in XPages itself being able to do things like a lookup from anywhere - but especially a view panel control or a repeat control opens up a lot of doors for the "Parent/Child" stuff.
The other big one is being able to use 2 datasources on a page. So you can have a viewPanel/RepeatControl on the page with a document so you in effect get the same embedded view with show single category that you had before. But it's much better because you have so much more control over the UI and hooks to the child document that you just can't get with the Notes client. I've done several shows on this stuff. I can't remember then all but I think I did a bunch in NotesIn9 018. https://www.youtube.com/watch?v=snV8qzN-Crc&fmt=22 So you might find that interesting.
Now all that has nothing to do with "Java".
If you're starting out in Java I would ignore for now "Inheritance, polymorphism, and Interfaces". It's not needed yet. Here's what I might typically do.
I'll create a class called "Company". That will load in all the values from the document. Then I forget the document. I don't care. When I go to save it I reload the document and save all the current values of the object/bean back to the document. Done.
I'll also create a class called "Contact". It'll do the same thing as company. It'll load from a "Contact document" and also save back to the contact document. There will be a method like:
load(String uniqueKey) {]
do from the Company object I'll have a method like:
loadContacts()
inside there I'll get a handle on the view.. create a collection of the contacts with the shared key... you might use UNID's I prefer @Unique()'s. I loop thought the collection and do something on the loop like:
Contact tmpContact = new Contact();
tmpContact.load(this.uniqueKey) // this refers to the current company object
this.contactList.add(tmpContact);
----
So in company I'll have declared:
List<Contact> contactList;
In the constructor I might have:
this.contactList = new ArrayList<Contact>();
in there will be a method in the company like:
public List<Contact> getContacts() {
return this.contactList;
}
so from an XPage that is being bound to the company object I can throw in a repeat control to show all the contacts by using something like:
Company.getContacts() in the javaScript of the repeat control. Or I could use EL as well of course.
So this is how I'm using Java in a lot of apps. It's allowed me to make a "Business API" of my key objects. Starting that is more important then trying to get all the Java right from a "Purist Java Developer" point of view. Because now you can easily add new methods:
Company.getSales()
Company.getPastDueBills()
Company.createContact()
Company.getPrimaryContact()
Company.getPrimaryContact().getBirthDay()
Company.getContactsByLocation("Pa")
Contact.getShippingAddress()
Contact.getCellPhone()
etc.... It'll just grow and grow and it's all reusable code that keeps getting better because you don't need to keep reinventing the wheel.
A little bit ago I started a series on NotesIn9.com designed as an intro to Java for XPages developers. It's a build an app from scratch. I've NOT finished it yet... hope to start up soon. I don't think I got to any parent child stuff yet... hopefully soon... but it might be interesting to you.
Let me know if you have further questions. Either here or email me. My address is on every video.
Good Luck!
Dave