[client] Audit mixin/proxy architecture once read-only surface is complete (merge, relocate, or unify) #151

Closed
opened 2026-10-27 09:38:46 +00:00 by mat · 0 comments
Owner

Once the read-only client surface (roadmap section 3) is fully shipped, do a
global architecture review of the ComwattClient composition:

  • Mixin vs proxy split is inconsistent: weather got a namespaced
    WeatherProxy (client.weather.*, unauthenticated base URL), every other
    domain is a flat mixin (client.get_*). Decide when a domain deserves a
    proxy and apply the rule uniformly.
  • Mixin inventory (~15 files): auth, alert-configs, aggregations,
    capacities, devices, gateways, grid, plannings, sites, connected-objects,
    streaming, electricity-contracts, typical-days, thermal-control,
    weather-proxy — plus the incoming catalogues mixin. Some are thin (one or
    two methods), some overlap semantically (typical-days vs plannings vs
    thermal-control; aggregations vs grid vs series).
  • Questions to answer: merge thin mixins that share a domain? relocate
    misplaced methods (e.g. get_device_kinds sits in DevicesMixin despite
    being a catalogue read)? does the MRO / _BaseClient split still hold?
    should anything become a proxy?

Constraint: public API compatibility — moving methods between private modules
is free, renaming/removing public methods needs a deprecation path.

Deferred until #97 and the remaining read-only issues (#98, #102, #103,
#106…) are merged, so the review sees the final shape.

Once the read-only client surface (roadmap section 3) is fully shipped, do a global architecture review of the `ComwattClient` composition: - **Mixin vs proxy split is inconsistent**: weather got a namespaced `WeatherProxy` (`client.weather.*`, unauthenticated base URL), every other domain is a flat mixin (`client.get_*`). Decide when a domain deserves a proxy and apply the rule uniformly. - **Mixin inventory** (~15 files): auth, alert-configs, aggregations, capacities, devices, gateways, grid, plannings, sites, connected-objects, streaming, electricity-contracts, typical-days, thermal-control, weather-proxy — plus the incoming catalogues mixin. Some are thin (one or two methods), some overlap semantically (typical-days vs plannings vs thermal-control; aggregations vs grid vs series). - Questions to answer: merge thin mixins that share a domain? relocate misplaced methods (e.g. `get_device_kinds` sits in DevicesMixin despite being a catalogue read)? does the MRO / `_BaseClient` split still hold? should anything become a proxy? Constraint: public API compatibility — moving methods between private modules is free, renaming/removing public methods needs a deprecation path. *Deferred until #97 and the remaining read-only issues (#98, #102, #103, #106…) are merged, so the review sees the final shape.*
mat closed this issue 2026-10-27 14:41:47 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mat/python-comwatt-client#151
No description provided.