SNEWS2 / SNEWS_Publishing_Tools

Publishing Tool for SNEWS
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

improve object encapsulation in `snews_pt` #73

Closed sybenzvi closed 9 months ago

sybenzvi commented 1 year ago

While making a minor update to the snews_pub module I noticed the encapsulation of the main data class SNEWSTiersPublisher is not enforced well. There are several utility classes in snews_pt_utils and snews_format_checker that must know all about the internal structure of SNEWSTiersPublisher. For example, the format checker includes lengthy conditional statements that depend on the published message type, which strongly couples the submodules and breaks the usual OOP design patterns. I foresee this becoming a potential maintenance headache.

This can be fixed with some refactoring and potentially use of an inheritance hierarchy for different message types, where each type knows how to internally check it's own message format for consistency. I have some thoughts but we should discuss if this is a good use of limited time.