The advantage of using an object-oriented design approach is that the document structures described earlier in this chapter can be simply converted into Python classes. We can then group related classes into modules. The disadvantage of this approach is that we can no longer rely on the Pymongo database driver to automatically populate our classes for us. The burden of producing instances of the final entity classes – Customer, Partner, Property, and Booking – devolves from the domain service classes.
For the purposes of this chapter, we'll focus only on the most complicated entity class: booking. The full implementations of the classes associated with the other collections can be found at /path/to/repo/chapters/07/src/booksomeplace/entity.




















































