Case Study
Explore how to apply object-oriented design principles in Python through a case study using UML diagrams. Learn to define core classes like Sample, KnownSample, TrainingData, and Hyperparameter with type hints and class structures. Understand design decisions behind class definitions and alternative approaches in Python’s object model.
We'll cover the following...
This section expands on the object-oriented design of our realistic example. We’ll start with the diagrams created using the Unified Modeling Language (UML) to help depict and summarize the software we’re going to build. We’ll describe the various considerations that are part of the Python implementation of the class definitions. We’ll start with a review of the diagrams that describe the classes to be defined.
Logical view
Here’s the overview of the classes we need to build. This is (except for one new method) the previous chapter’s model:
Major classes
There are three classes that define our core data model, plus some uses of the generic List class. We’ve shown it using the type hint of List. Here ...