Skip to content
  • Thomas Haller's avatar
    settings: use delegation instead of inheritance for NMSettingsConnection and NMConnection · 38273a88
    Thomas Haller authored
    NMConnection is an interface, which is implemented by the types
    NMSimpleConnection (libnm-core), NMSettingsConnection (src) and
    NMRemoteConnection (libnm).
    
    NMSettingsConnection does a lot of things already:
    
      1) it "is-a" NMDBusObject and exports the API of a connection profile
         on D-Bus
      2) it interacts with NMSettings and contains functionality
         for tracking the profiles.
      3) it is the base-class of types like NMSKeyfileConnection and
         NMIfcfgConnection. These handle how the profile is persisted
         on disk.
      4) it implements NMConnection interface, to itself track the
         settings of the profile.
    
    3) and 4) would be better implemented via delegation than inheritance.
    
    Address 4) and don't let NMSettingsConnection implemente the NMConnection
    interface. Instead, a settings-connection references now a NMSimpleConnection
    instance, to which it delegates for keeping the actual profiles.
    
    Advantages:
    
    ...
    38273a88