firstly, please forgive my pseudo-code, I think in this case it is more legible than the full code. Assume that the property in the pseudocode is actually a field with the getter and setter method, except ArticleElementwhere it just needs a property accessible from the object either by the direct getter method, or two getter steps (i.e. getArticleSource().getName()).
Say I have a template object:
ArticleTemplate
Long id;
String name;
String description;
Integer amount;
Schedule schedule;
and is used (via its schedule) to create many potential child objects on different dates:
Article
Long id;
String name;
String description;
Integer amount;
Date date;
Boolean complete;
ArticleTemplate template;
some child objects are not created from the parent, they can be autonomous (the template can be null).
. :
a)
) ,
c) -, [/p >
, :
ArticleElement
// actual value if from Article, null if from potential from ArticleTemplate
Long id;
// actual value if from Article or ArticleTemplate
String name;
// actual value if from Article or ArticleTemplate
String description;
// actual value if from Article or ArticleTemplate
Integer amount;
// actual value if from Article, simulated if from potential from ArticleTemplate
Date date;
// actual value if from Article, false if from potential from ArticleTemplate
Boolean complete;
// actual value (nullable) if from Article, self if from potential from ArticleTemplate
ArticleTemplate template;
// false if from Article, true if from potential from ArticleTemplate
Boolean templateSimulation;
// once the list is sorted, a running tally of this.amount is to be stored on this object
Integer runningTally;
// would be type of interface if Article and ArticleTemplate implement same
Object source;
, 3 , ..
, , , .
!
.