-
Book Overview & Buying
-
Table Of Contents
Hands-On Software Engineering with Python - Second Edition
By :
There are two business object classes that need to be defined with data persistence, Artisan and Product. In order for those to have data persistence, following the current design intention, they will need to derive from a common BaseDataObject class, which will be defined as an Abstract Base Class (ABC). The Artisan class, since it represents an artisan user, and business policy requires that artisans’ addresses need to be available, will also need to incorporate an address data structure. The kind of data that an address object would store and manage — a simple mailing address — is not limited to being associated with an Artisan. It could also be part of an order later, so the data structure, while not a business object, will be defined as a separate Address class that can be composed or aggregated into other classes as needed.
Composition and aggregation
Composition in an OOP context means that one object is...