mbeckerle commented on a change in pull request #326: Daffodil 2280 cleanup -
removes backpointers and factory patterns no longer needed
URL: https://github.com/apache/incubator-daffodil/pull/326#discussion_r393736406
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/dsom/ChoiceGroup.scala
##########
@@ -110,9 +110,12 @@ abstract class ChoiceTermBase(
with ChoiceAGMixin
with HasOptRepTypeMixinImpl {
- requiredEvaluations(branchesAreNonOptional)
- requiredEvaluations(branchesAreNotIVCElements)
- requiredEvaluations(modelGroupRuntimeData.preSerialization)
+ override protected def check() {
+ super.check()
+ requiredEvaluations(branchesAreNonOptional)
+ requiredEvaluations(branchesAreNotIVCElements)
+ requiredEvaluations(modelGroupRuntimeData.preSerialization)
+ }
Review comment:
This will need some scaladoc and a design note.
A significant' change here is that in the past there were these factories.
They did little except postpone the creation of the "real objects" until they
were known participants in the schema.
Upon creation, the requiredEvaluation functions are registered, and *will*
be evaluated later.
Now, we allow creation of the objects, and those objects which are always
part of the "active schema" like the schema set and processor factory object
always can issue requiredEvaluations. But many other objects are created but we
don't want to register their requiredEvaluations until it is known they are "in
use by" the schema. Those have their calls to requiredEvaluations enclosed in a
call to check(). Finally, a third class of things are only created on demand
when another object, that has been determined to be "in use" causes them to be
constructed. Those also require no qualification around their calls to
requiredEvaluations(...) once constructed it is known they are used.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services