[ 
https://issues.apache.org/jira/browse/PLC4X-202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17126037#comment-17126037
 ] 

Alessandro Rossignoli commented on PLC4X-202:
---------------------------------------------

I agree with [~nalim2]. After doing my modifications using Milo, what I 
realised was that it is better to implement Unsigned types inside plc4x 
library, for these two strong reasons:
 * we won't force users of plc4x to rely on Eclipse Milo, but will only see the 
exposed unsigned types.
 * we need a way to distinguish signed/unsigned (e.g. unsigned short (using 
int) from normal int)

For our internal implementation we could use inheritance or dependency 
injection and use whatever implementation we want, initially also Eclipse Milo 
to swap it in the future or keep it if it is satisfying.

I think this is the cleanest and safer way to spread Unsigned type support 
across all the drivers, with the flexibility to change implementation in the 
future but also hiding this complexity to the user.


These are my thoughts on the matter after working on it, but I'd like to know 
what you think.

 

PS. reading of unsigned of course works because of how it is implemented.

 

> OPC-UA Driver cannot write Unsigned Types
> -----------------------------------------
>
>                 Key: PLC4X-202
>                 URL: https://issues.apache.org/jira/browse/PLC4X-202
>             Project: Apache PLC4X
>          Issue Type: Bug
>          Components: Driver-OPC-UA
>    Affects Versions: 0.7.0
>            Reporter: Alessandro Rossignoli
>            Priority: Major
>
> Currently, unsigned types are not supported in writing direction from the 
> driver although they are fully supported by Eclipse Milo and in reading.
> Actually I have applied a modification and tested it to be able to support 
> these types. It is kind of the same patch applied for BigIntegers but done 
> introducing UShort and UInteger from Eclipse Milo.
> The downside is that every driver will use the Eclipse Milo types, being the 
> JVM missing unsigned types. I don't know if you have a better solution or if 
> using Milo types in all the drivers is acceptable for you.
> I am open for suggestions :)
>  
> (PS. when I will complete all the testing I will create 3 separate PR for 
> issue #200, #201 and this one)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to