Preparation for object transactions

The preceding code reorganization gives us a solid, logical place to create the new Abstract Base Class (ABC) that we mentioned earlier. The goal of this new ABC is to require derived classes to be able to provide a message-data-ready data structure that can be passed to DaemonMessage as the data argument in its __init__ method, both streamlining the process of creating a message for any given object that needs one, and allowing the code for that process to exist as part of the individual data object classes themselves. In keeping with the naming convention that's evolved in the code so far, this would probably be best written as an instance method named to_message_data. Another option considered was

Get Hands-On Software Engineering with Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.