Today I started working on builders for entities, to remove some code duplication in the constructors.
After those changes, there will be at most 4 constructors :

  • copy constructor;
  • move constructor;
  • builder constructor;
  • constructor with every parameters for a faster creation;

The builder constructor is a constructor which takes the builder as a parameter, and construct the object.
This is required for builder inheritance and do :


Line(Builder) : CADEntity(builder) { … }

The builder constructor is private so the build() method of the builder should be used, which verify all the parameters. The verification will be done in the constructor with every parameters when all the others constructors will be removed.

The unneeded constructors will not be removed now at it will take time to update all the code, and I think I'll take more time than what I planned to add blocks and INSERT support.