Hi all!

I’m currently working on an editing system which has composite elements;

For example:

We store Products (e.g. an iPod 64GB) and those Products have Variants
(Blue).
Since a variant cannot exist without a product, and we want to enforce that
every product has at least one variant, we want to implement this in a
single screen.
So here the Product is a composite which contains one or more Variants.

To extend my example: a Variant has pricing based on Country, Website etc.
So the Variant is also a composite;

In all previous projects we either
a) relaxed the requirements, like don’t require a product to have at least
one variant, which means the creation of variants happens when the Product
already exists
b) perform all editing in a single form, so everything is committed in one
go

But since our composites are more complex in this project, the UI becomes a
bit crazy, so we want to break out the nested editors.
Essentially this requires us to build some sort of change tracking feature,
like a set of custom models that remembers what was provided in “setObject”
and can later replay this.
We can then track all changes that happen in editors, and replay those
changes later (e.g. when the Product editor is submitted).

Given that we want to support nested composites (Product -> List of Variant
-> List of VariantPrice), this can get quite complex.

So before embarking on this, I’d like to ask if others have implemented a
similar system, or if they have other suggestions.

I seem to recall that a long time ago there was discussion about this as
well, perhaps it was regarding a really complex
NestedPropertyChangeListenerModel (;-)) at topicus or hippo or similar.
I think it was ultimately refactored into something much simpler due to the
difficulty in maintaining it.
But alas, I cannot seem to find any mention of it anymore.

Thank you all for reading and any input you can provide.

Met vriendelijke groet,
Kind regards,

Bas Gooren

Reply via email to