August 2018
Intermediate to advanced
332 pages
9h 12m
English
In this example, we are going to create the case for an application that is in charge of reading information about events from a source (this could be log files, a database, or many more sources), and identifying the actions corresponding to each particular log.
A design that fails to conform to the SRP would look like this:

Without considering the implementation, the code for the class might look in the following listing:
# srp_1.pyclass SystemMonitor: def load_activity(self): """Get the events from a source, to be processed.""" def identify_events(self): """Parse the source raw data into events (domain ...