SA0119:面向对象的特性
检测面向对象功能的使用,例如功能块声明 EXTENDS
和 IMPLEMENTS
,或属性和接口声明。当您编写旨在移植到其他符合 IEC 61131-3 的系统的代码时,此规则很有用。
理由:并非所有系统都支持面向对象编程。没有面向对象的代码更容易移植。
重要性:低
例 102. 例子
//Function block extended by another and implementing an interface: FUNCTION_BLOCK POU EXTENDS CTD IMPLEMENTS ITF //SA0119 ;
// Declaration parts of property methods assigned to a function block: POU.Prop.Get //SA0119
POU.Prop.Set //SA0119
输出在 留言 看法:
SA0119:不允许面向对象的功能