# How should Dry Schema and Validations be prepared with monads?

**URL:** <https://discourse.hanakai.org/t/how-should-dry-schema-and-validations-be-prepared-with-monads/790>\
**Category:** questions\
**Created:** [January 28, 2023, 3:38pm UTC](https://discourse.hanakai.org/t/how-should-dry-schema-and-validations-be-prepared-with-monads/790 "2023-01-28T15:38:29Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![timriley](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.hanakai.org/timriley/32/621_2.png) [@timriley](https://discourse.hanakai.org/u/timriley)\
**Post date:** [March 6, 2023, 10:51am UTC](https://discourse.hanakai.org/t/how-should-dry-schema-and-validations-be-prepared-with-monads/790/3 "2023-03-06T10:51:46Z")

</div>

See the bottom part of my answer here for how I’ve typically done this: [What is the best way to initialize dependencies? - #3 by timriley](https://discourse.hanakai.org/t/what-is-the-best-way-to-initialize-dependencies/802/3)

tl;dr — create a base class in your app that all contracts, etc. inherit from, and put the global configuration in that file.

That way its only loaded when you need it, courtesy of your app’s contracts using it as a parent class.

---

_[View the full topic](https://discourse.hanakai.org/t/how-should-dry-schema-and-validations-be-prepared-with-monads/790)._
