I also fully agree with this:
> Detecting an error when creating a record is much better than when using it later on, as during creation you have the context needed to debug the problem.
I made it a rule to perform integrity checks as early as possible: when creating, accepting or transforming data. I use spec (but schema would work just as well here), and have lots of pre/post conditions in my code.
I tend to settle on "simpler" solutions. I use mount, rather than component, because it uses the namespace hierarchy and requires less code and management. I use very few macros, and try to use simpler tools rather than more complex ones.
I noticed that these days roughly 30-40% of the code I write deals with integrity checks, anomalies and anomaly handling.