Refactoring #1598

Feature #1290: === Core: framework ===

Feature #1712: == Code maintenance ==

decide on policy for incomplete ICompositeSample descendant constructors

Added by wuttke over 4 years ago. Updated over 3 years ago.

Status:RejectedStart date:31 Aug 2016
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


Descendants of ICompositeSample typically need one or more children to be defined before a simulation can be run. Presence of these children is currently not enforced: we do have constructors like Particle() that create a particle without material and with form factor, hence not immediately useable for simulation.

Therefore in the implementation of class Particle we never know whether mP_material or mP_form_factor isn't a null pointer, so we have to test, and react case by case. Such extra code is not nice, and typically it is not covered by functional tests.

Shall we forbid null pointer children for good?

This policy could be enforced in two different ways:

(1) Delete constructors that do not set all children.

(2) Equip constructors with default arguments, for instance: material=Air(), form_factor=FormFactorDot(), interference_function=InterferenceFunctionNone().


#1 Updated by wuttke about 4 years ago

  • Parent task changed from #1290 to #1712

#2 Updated by pospelov over 3 years ago

  • Status changed from Rfc to Rejected

Rejected, see #1823

Also available in: Atom PDF