type safe ddd