Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-7791

composites - weakref caching

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: butler
    • Labels:
      None

      Description

      when getting objects in butler, keep a weakref to objects so that if they are a component that is loaded a second time by another object the component does not get loaded into a second instance, but is instead shared between composites.

      if feasible, the caching mechanism should be easy to change by configuration or by subclass or plugin.

      notes:
      weakref caching has certain implications; objects will not be kept if another (composite) object is destroyed; if the composite is destroyed and then another composite that uses the same component is loaded, the object will be reloaded. (this has plusses and minuses, depending on use case

      Butler does not protect shared objects being changed and it's possible that one owner could change the shared object at a time or in a way that the other owner does not expect it. The question of how to address this remains open.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                npease Nate Pease
                Reporter:
                npease Nate Pease
                Reviewers:
                Brian Van Klaveren, Jim Bosch, Kian-Tat Lim
                Watchers:
                Brian Van Klaveren, Jim Bosch, Kian-Tat Lim, Nate Pease
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel