Hi all,

no matter if we’re going to rename the PlcField to PlcTag, I think now is the 
time to give the interface a little cleanup:

We currently have:

Java:
Class<?> getDefaultJavaType()
String getPlcDataType()
int getNumberOfElements()

Go:
GetAddressString() string
GetTypeName() string
GetQuantity() uint16

I would like to:

Java:
Strin getAddressString()
PlcValueType getPlcValueType()
Int getQuantity()

Go:
GetAddressString() string
GetValueType() values.PlcValueType
GetQuantity() uint16

I think as we’e mapping all values returned to a fixed set of standard 
PlcValues, the getDefaultJavaType doesn’t really make much sense anymore. Also 
would I like to restrict the data-type to only the valid PlcValueType elements. 
Using anything else here doesn’t make much sense for me, as we don’t have any 
PlcValue implementations to wrap other types.

A fieldHandler can continue to for example parse an “INT16” (which we don’t 
support) to it’s PLC4X representation “INT” and would simply set the field to 
PlcValueType.INT.

This would make many areas in our code a lot more typesafe.

What do you think?

Chris

Reply via email to