The pattern is described here as the Blackboard Pattern. But it was named at a time when chalkboards were common, and whiteboards had not yet been invented. (Whiteboards are a lot cleaner, with no chalk dust to breathe and clean up!)
On the scale weâre talking about here, the âwhiteboardâ would be a global variable, in some module outside of your forms, but accessible to all of them. Typically, the variable contains a Python dict
(or other structured object), where each form places information for other forms to read, and to âreason aboutâ.
The advantage: It lets your forms collect information and coordinate, without each one having to know anything about the othersâ internal details, such as where to find that information within the other form(s), what the other form(s) call it, and so on.
Thus, you are free to completely restructure any form, rename any variable inside a form, without impacting the other forms. Only the name of the âwhiteboardâ, and its contents, needs to be (relatively) stable.
Where needed, this technique can be very helpful. But one can also overdo it.
This works best when the variable collects information, from several sources, about a single context or situation, with well-defined scope and limits. That is, it has a limited number of âcontainedâ variables, and theyâre all different aspects of a single topic. Theyâre cohesive.
âGrab-bagâ or âcatch-allâ variables, which try to know everything about everything, can quickly turn a well-structured program into a real mess.