openopc2
openopc2 copied to clipboard
Improvement: OPC server statefulness in OpcDaClient
In openopc2.da_client.OpcDaClient
, there is some awkward statefulness:
open_opc_config = OpenOpcConfig()
open_opc_config.OPC_SERVER = opc_server # Pretend no env vars for now
opc_client = OpcDaClient(open_opc_config=open_opc_config)
opc_client.connect(opc_server=opc_server)
The statefulness comes from:
- Having to embed
opc_server
intoOpenOpcConfig
, only forOpcDaClient
never to useself.opc_server
- Having to pass
opc_server
again toopc_client.connect
Just pointing out this is awkward, and to me indicates room for a better design.