Skip to content

Version 7.0.0

Humberto Sanchez II edited this page Jun 10, 2024 · 1 revision

This update was a major architectural change for Pyut.

Version 7.0.0 introduces a series of major architectural changes to Pyut. The rationale was that developing big features in Pyut was becoming increasingly difficult given the state of the code. It took me several years to become comfortable with the code and to document the necessary changes.

Data Model & Object Graph Library

Around version 6.6.0 I started simplifying the Pyut data model and Object Graph Library (OGL) classes name space in order to externalize them. I actually created the new GitHub repositories in order to test them and to prepare to later import them. At this point I discovered that several of the data model and OGL model classes were infested with Pyut UI details. As an example, the sequence diagram classes used the UML frames directly to create the SD lifelines. Additionally, the OGL class retrieved instances of the Pyut mediator to deal with popping up dialogs. Furthermore, I had let Pyut preferences creep into both the data model classes and the OGL classes.

Object Graph Library

These updates created a preferences class and an eventing system for OGL. The preferences class can be seamlessly imported into the Pyut preferences system even though they actually live in a separate stand alone file. Additionally, Pyut now registers itself on the OGL event engine to carry out requests for the library. This is a nice loose coupling.

External Plugin Development

The other high want was to externalize the Pyut plugin mechanism. Over time the plugins had become more and more tied to specific Pyut internal details. As I externalized them I found the contact points and sought to mask them via the new PluginAdapter interface. The Pyut Plugin Core repository even has its own testing scaffold to allow external testing and development before integrating with Pyut. What is missing is some world class documentation on the Plugin SDK. I will work on that later.

Mediator Removal

The big obstacle to decoupling all the Pyut components was the monolithic Mediator class that over time had become gargantuan. Over the summer of 2022, I successfully executed a series of “Extract Class” refactorings that allowed me to remove the Mediator. This then introduced an event engine for Pyut where various components essentially just send messages via the abstracted wxPython eventing mechanism. This makes debugging slightly more complicated when a component sends a message. The developer has to search for the handler via the PyEventBinder name. However, in my opinion the resulting gain in loose coupling and reduction in code brittleness is worth the slight increase in complexity. The eventing mechanism also introduces callbacks.

Remove Dead Code

Finally, I had previously discontinued support for old version 8 and 9 put files. That removed a large chunk of legacy code. I then opted for a standalone OGLIO repository that knows how to read and write PUT files. The code is greatly simplified and I removed the graph placement machinations that the deserializing code had to execute when reading the persisted data.

Dependency Updates

I introduced all the above in the midst of getting all the code base on the latest 3.10.x (now 3.10.6) Python version as well as upgrading to the latest wxPython version (4.2.0). Obviously, this also caused code perturbations as well as updates to the code base.

Final Comments

All in all, this work which started in April of 2020 upon our return to Nebraska from our Arizona winter sojourn now culminates upon a return to Arizona for a new winter sojourn. The result is a more stable and maintainable code base from which I can introduce more sophisticated UML diagraming capabilities and features that are on my extensive wish list.


The following are the issues documenting the changes

  • 429 Reorganize the Pyut package space
  • 428 Incorporate latest plugin manager
  • 426 Replace FileIo.save with oglio.Writer
  • 425 Replace FileIo.open with oglio.Reader ♻️
  • 424 Create EditObjectHandler
  • 423 Move Action Handler to separate class
  • [422](10/03/22 14:03:42) "Move cut"
  • 421 Obviate Mediator 🏗️
  • 319 Make plugins external 🏗️