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.
Germany
Slovakia
Canada
Brazil
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
United States
Great Britain
India
Spain
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
France
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Australia
Japan
Russia