View Issue Details

IDProjectCategoryView StatusLast Update
000428110000-003: Address SpaceSpecpublic2020-12-08 20:23
ReporterWolfgang Mahnke Assigned ToJeff Harding  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionreopened 
Summary0004281: Clarifications on overridden Methods
Description

Section 6.2.7. defines specific rules for overridden Variables w.r.t. their data types. Currently we do not have defined clear rules for overridden Methods and their input- and output arguments.

MandatoryPlaceholder and OptionalPlaceholder are defined for Methods to indicate that the arguments will be defined somewhere else. But we do not specify the bahaviour for Mandatory and Optional used on Methods.
Can I add/remove arguments or change the data types?

TagsNo tags attached.
Commit Version
Fix Due Date

Activities

BjarneBostrom

2018-06-29 13:40

reporter   ~0009219

Adding a note just in case.. OPC UA is basically an object orientend programming language (or the concepts are close enough anyway). An object-oriented language cannot break https://en.wikipedia.org/wiki/Liskov_substitution_principle. So every subtype must be able to be seen and handled as their supertype. Given that Methods are defined for an ObjectType, this means if a method is overridden, it must have the same exact number of parameters, they must have same names. Input types must be same. Output types can be subtypes of the method outputs that is being overridden.

This also applies instances of that object, otherwise it cannot be used based on the type information.

e.g. the AutoID model holds this true when it overrides methods. A bit dangerous but is correct. If it were to violate that constraint, it would be impossible to e.g. generate code for those types as normal object oriented language types as those methods could not be made made to compile.

BjarneBostrom

2018-06-29 13:44

reporter   ~0009220

(and as additional clarification, different input signature would mean overload, not override, and OPC UA does not currently allow overloads, as the BrowseName of the method must be unique to the type, and making the same BrowseName in subtype creates an override of that Method)

Jeff Harding

2020-06-09 16:49

developer   ~0012213

UA Working Group discussion:

Agreed we need to add a statement in the spec that explains that a subtype can't change the arguments of a method defined by its super type.

Agreed for methods which use abstract datatypes we could allow overriding the datatypes. Once a concrete datatype is introduced no further subtyping would be allowed.
Agreed we need to state that a mandatory argument can't be set to optional in a subtype of the method.

Jeff Harding

2020-06-15 20:49

developer   ~0012322

Added a clarification for methods to Overriding InstanceDeclarations as follows:

"A subtype shall not override an argument of its supertype’s Method InstanceDeclarations which is defined with a concrete DataType. Method arguments defined with an abstract DataType may be overridden.
A subtype may change an optional argument of a supertype’s Method to mandatory however a mandatory argument shall not be changed to optional. "

Jeff Harding

2020-08-25 14:11

developer   ~0012718

On further review we concluded the June agreement was flawed and this issues was reopened.

Jeff Harding

2020-08-25 14:51

developer   ~0012719

Agreed to limit the statement to "A subtype shall not override an argument of its supertype’s Method InstanceDeclarations"
Need to create Errata for 1.04, and 1.03.
Discussed adding a new reference type to relate overloaded methods to each other. Agreed to add this reference type.

Jim Luth

2020-12-08 20:23

administrator   ~0013409

Agreed to changes in Virtual F2F.

Issue History

Date Modified Username Field Change
2018-05-11 13:42 Wolfgang Mahnke New Issue
2018-06-29 13:40 BjarneBostrom Note Added: 0009219
2018-06-29 13:44 BjarneBostrom Note Added: 0009220
2018-08-14 16:27 Jim Luth Assigned To => Jeff Harding
2018-08-14 16:27 Jim Luth Status new => assigned
2020-06-09 16:49 Jeff Harding Note Added: 0012213
2020-06-15 20:49 Jeff Harding Status assigned => resolved
2020-06-15 20:49 Jeff Harding Resolution open => fixed
2020-06-15 20:49 Jeff Harding Fixed in Version => 1.05
2020-06-15 20:49 Jeff Harding Note Added: 0012322
2020-08-25 14:11 Jeff Harding Status resolved => feedback
2020-08-25 14:11 Jeff Harding Resolution fixed => reopened
2020-08-25 14:11 Jeff Harding Note Added: 0012718
2020-08-25 14:51 Jeff Harding Status feedback => assigned
2020-08-25 14:51 Jeff Harding Note Added: 0012719
2020-12-08 20:23 Jim Luth Status assigned => closed
2020-12-08 20:23 Jim Luth Note Added: 0013409