Skip to content

Redesign Connection Class structure

Summary

The Connection class defines both read() and write(), which not all Connections implement.

Also the typing for from_node does not work properly, since a BaseSeriesConnection will get type BaseConnection (thus read_series isn't allowed to be called)

Explain your context

https://en.wikipedia.org/wiki/Interface_segregation_principle

In the field of software engineering, the interface segregation principle (ISP) states that no code should be forced to depend on methods it does not use

What is the expected correct behavior? What was your goal?

Define interfaces for each functionality and then let connections inherit from those.