public static void Main()
public abstract class Builder<T> where T : new() {
this.ObjectUnderConstruction = new T();
protected T ObjectUnderConstruction { get; private init;}
if (VerifyObjectComplete())
return ObjectUnderConstruction;
throw new Exception("Builder verification failed or somesuch");
protected abstract bool VerifyObjectComplete();
public class TestBuilder : Builder<SomeObject> {
public void SetA(object value)
ObjectUnderConstruction.A = value;
protected override bool VerifyObjectComplete() {
var verifyA = ObjectUnderConstruction.A != null;
public object A {get; set;}