当前位置: 首页 > news >正文

OMG--IDL(Interface Definition Language)

OMG--IDL(Interface Definition Language)

  • 1 概述
  • 2 内容
    • 缩写
    • IDL 语法和语义概述
    • 词法约定
      • ISO Latin-1的字母字符如下表
      • 十进制数字字符
      • 图形字符
      • 格式化字符
      • Tokens
      • 注释
      • 标识符
      • 冲突规则
      • 转义标识符
      • 关键字
      • IDL识别的其他字符
      • 字面量
    • 预处理
    • IDL 语法
      • 构建块核心数据类型
      • 构建任何块
      • 构建块基本接口
      • 构建块完整接口
      • 构建块数据类型
      • 构建块CORBA实现--接口
      • 构建块CORBA实现--数据类型
      • 构建块组件--基本
      • 构建块组件--homes
      • 构建块CCM实现
      • 构建块组件--端口和连接器
      • 构建模板模块
      • 构建块扩展数据类型
      • 构建块匿名类型
      • 构建块注释
      • 构建模块之间的关系
  • 3 补充
    • 3.1 OMG介绍
    • 3.2 CORBA
      • XML-RPC / SOAP
      • REST
      • CORBA 和 gRPC 比较
    • 3.3 EBNF(扩展巴科斯范式)
  • 参考

1 概述

如下介绍,OMG组织定义的IDL(Interface Definition Language)。

  • Version: 4.2
  • OMG Document Number: formal/18-01-05
  • Release Date: March 2018
  • Standard Document URL: http://www.omg.org/spec/IDL/4.2/

2 内容

缩写

AcronymMeaning
ASCIIAmerican Standard Code for Information Interchange
BIPMBureau International des Poids et Mesures
CCMCORBA Component Model
CORBACommon Object Request Broker Architecture
DDSData Distribution Service
EBNFExtended Backus Naur Form
IDLInterface Definition Language
ISOInternational Organization for Standardization
LwCCMLightweight CCM
OMGObject Management Group
ORBObject Request Broker
XTypeseXtensible and dynamic topic Types (for DDS)

IDL 语法和语义概述

  • OMG IDL是一种语言,它允许对客户端对象可能使用的接口进行明确的规范(服务器)对象实现提供了所有需要的相关结构,如异常和数据类型。数据需要类型来指定接口操作的参数和返回值。
  • IDL是一种纯粹的描述性语言。
  • 包含用 IDL 编写的规范的源文件应具有“.idl”扩展名。

列出了EBNF格式中使用的符号及其含义:
在这里插入图片描述

词法约定

词法约定在IDL规范中定义令牌(tokens)并描述注释、标识符、关键字和字面值——整数、字符、浮点常量和字符串字面值。
IDL使用ASCII字符集,除了字符串文字和字符文字,它们使用ISO Latin-1 (8859-1)字符集。ISO Latin-1字符集分为字母(字母)数字、图形字符、字符空格(空白)字符和格式化字符。

ISO Latin-1的字母字符如下表

在这里插入图片描述
在这里插入图片描述

十进制数字字符

在这里插入图片描述

图形字符

在这里插入图片描述
在这里插入图片描述

格式化字符

在这里插入图片描述

Tokens

有五种tokens:标识符、关键字、文字、操作符和其他分隔符。

注释

字符/开始一个注释,注释以字符/结束。这些注释不能嵌套。
字符//开始一个注释,该注释在它们出现的行结束。

标识符

标识符是由ASCII字母、数字和下划线(_)字符组成的任意长序列。第一个字符必须是ASCII字母字符。所有字符都是重要的。IDL标识符不区分大小写。但是,对定义的所有引用必须使用与定义相同的大小写发生。这允许对区分大小写的语言进行自然映射。

冲突规则

  • 大写字母和小写字母被视为相同的字母。
  • 在每个作用域中,IDL标识符只有一个名称空间。使用相同的标识符用于常量和接口,例如,会产生编译错误。
module M {typedef long Foo;const long thing = 1;interface thing { 						// Error: reuse of identifier thingvoid doit (in Foo foo 						// Error: Foo and foo collide…); 									// … and refer to different thingsreadonly attribute long Attribute;	// Error: Attribute collides with keyword…// … attribute};
};

转义标识符

  • 和所有语言一样,IDL使用一些保留字,称为关键字。
  • 随着IDL的发展,添加到IDL语言中的新关键字可能会无意中与中使用的标识符冲突现有的IDL和使用该IDL的程序。修复这些冲突不仅需要修改IDL,还需要依赖于该IDL的编程语言代码也必须更改。的语言映射规则重命名的IDL标识符将导致映射的标识符名称(例如,方法名称)被更改。
  • 为了尽量减少工作量,用户可以在词法上通过在an前面加上下划线(_)来“转义”标识符标识符。这是一个纯粹的词法约定,只关闭关键字检查。结果标识符紧随其后标识符处理的其他规则。例如,标识符_AnIdentifier被当作AnIdentifier来处理。
module M {interface thing {attribute boolean abstract;		// Error: abstract collides with keyword abstractattribute boolean _abstract;	// OK: abstract is an identifier};
};

关键字

在这里插入图片描述

module M {typedef Long Foo;			// Error: keyword is long not Longtypedef boolean BOOLEAN;	// Error: BOOLEAN collides with the keyword…// …boolean;
};

IDL识别的其他字符

  • 标点符号
    在这里插入图片描述
  • 记号
    在这里插入图片描述

字面量

  • Integer
  • Character
  • Floating-point
  • String
  • Fixed-point

转义字符
在这里插入图片描述
在这里插入图片描述

字符串是以空结尾的字符序列。如果字符串由非宽字符组成,则为字符串类型;如果字符串由宽字符组成,则为wstring(宽字符串)类型。

const string S1 = "Hello";
const wstring S2 = L"Hello";

预处理

IDL应按照ISO/IEC 14882:2003中预处理器的规范进行预处理。预处理器可以作为单独的进程实现,也可以内置于IDL编译器中。

IDL 语法

格式良好的IDL规范的语法是用扩展巴科斯范式表示的规则来描述的(EBNF)。

构建块核心数据类型

The following set of rules form the building block:

(1) <specification>				::= <definition>+
(2) <definition>				::= <module_dcl> ";"| <const_dcl> ";"| <type_dcl> ";"
(3) <module_dcl>				::= "module" <identifier> "{" <definition>+ "}"
(4) <scoped_name>				::= <identifier>| "::" <identifier>| <scoped_name> "::" <identifier>
(5) <const_dcl> 				::= "const" <const_type> <identifier> "=" <const_expr>
(6) <const_type> 				::= <integer_type>| <floating_pt_type>| <fixed_pt_const_type>| <char_type>| <wide_char_type>| <boolean_type>| <octet_type>| <string_type>| <wide_string_type>| <scoped_name>
(7) <const_expr> 				::= <or_expr>
(8) <or_expr> 					::= <xor_expr>| <or_expr> "|" <xor_expr>
(9) <xor_expr> 					::= <and_expr>| <xor_expr> "^" <and_expr>
(10) <and_expr> 				::= <shift_expr>| <and_expr> "&" <shift_expr>
(11) <shift_expr> 				::= <add_expr>| <shift_expr> ">>" <add_expr>| <shift_expr> "<<" <add_expr>
(12) <add_expr> 				::= <mult_expr>| <add_expr> "+" <mult_expr>| <add_expr> "-" <mult_expr>
(13) <mult_expr> 				::= <unary_expr>| <mult_expr> "*" <unary_expr>| <mult_expr> "/" <unary_expr>| <mult_expr> "%" <unary_expr>
(14) <unary_expr> 				::= <unary_operator> <primary_expr>| <primary_expr>
(15) <unary_operator> 			::= "-"| "+"| "~"
(16) <primary_expr> 			::= <scoped_name>| <literal>| "(" <const_expr>")"
(17) <literal> 					::= <integer_literal>| <floating_pt_literal>| <fixed_pt_literal>| <character_literal>| <wide_character_literal>| <boolean_literal>| <string_literal>| <wide_string_literal>
(18) <boolean_literal> 			::= "TRUE"| "FALSE"
(19) <positive_int_const> 		::= <const_expr>
(20) <type_dcl> 				::= <constr_type_dcl>| <native_dcl> | <typedef_dcl>
(21) <type_spec> 				::= <simple_type_spec>
(22) <simple_type_spec> 		::= <base_type_spec>| <scoped_name>
(23) <base_type_spec> 			::= <integer_type>| <floating_pt_type>| <char_type>| <wide_char_type>| <boolean_type>| <octet_type>
(24) <floating_pt_type> 		::="float"| "double"| "long" "double"
(25) <integer_type> 			::= <signed_int>| <unsigned_int>
(26) <signed_int> 				::= <signed_short_int>| <signed_long_int>| <signed_longlong_int>
(27) <signed_short_int> 		::="short"
(28) <signed_long_int> 			::="long"
(29) <signed_longlong_int> 		::="long""long"
(30) <unsigned_int> 			::= <unsigned_short_int>| <unsigned_long_int>| <unsigned_longlong_int>
(31) <unsigned_short_int> 		::="unsigned""short"
(32) <unsigned_long_int> 		::="unsigned""long"
(33) <unsigned_longlong_int> 	::="unsigned""long""long"
(34) <char_type> 				::="char"
(35) <wide_char_type> 			::="wchar"
(36) <boolean_type> 			::="boolean"
(37) <octet_type> 				::="octet"
(38) <template_type_spec> 		::= <sequence_type>| <string_type>| <wide_string_type>| <fixed_pt_type>
(39) <sequence_type> 			::= "sequence" "<" <type_spec> "," <positive_int_const> ">"| "sequence" "<" <type_spec> ">"
(40) <string_type> 				::= "string" "<" <positive_int_const> ">"| "string"
(41) <wide_string_type> 		::= "wstring" "<" <positive_int_const> ">"| "wstring"
(42) <fixed_pt_type> 			::= "fixed" "<" <positive_int_const> "," <positive_int_const> ">"
(43) <fixed_pt_const_type> 		::= "fixed"
(44) <constr_type_dcl> 			::= <struct_dcl>| <union_dcl>| <enum_dcl>
(45) <struct_dcl> 				::= <struct_def>| <struct_forward_dcl>
(46) <struct_def> 				::= "struct" <identifier> "{" <member>+ "}"
(47) <member> 					::= <type_spec> <declarators> ";"
(48) <struct_forward_dcl> 		::= "struct" <identifier>
(49) <union_dcl> 				::= <union_def>| <union_forward_dcl>
(50) <union_def> 				::= "union" <identifier> "switch" "(" <switch_type_spec> ")""{" <switch_body> "}"
(51) <switch_type_spec> 		::= <integer_type>| <char_type>| <boolean_type>| <scoped_name>
(52) <switch_body> 				::= <case>+
(53) <case> 					::= <case_label>+ <element_spec> ";"
(54) <case_label> 				::= "case" <const_expr> ":"| "default" ":"
(55) <element_spec> 			::= <type_spec> <declarator>
(56) <union_forward_dcl> 		::= "union" <identifier>
(57) <enum_dcl> 				::= "enum" <identifier>"{" <enumerator> { "," <enumerator> } * "}"
(58) <enumerator> 				::= <identifier>
(59) <array_declarator> 		::= <identifier> <fixed_array_size>+
(60) <fixed_array_size> 		::= "[" <positive_int_const> "]"
(61) <native_dcl> 				::= "native" <simple_declarator>
(62) <simple_declarator> 		::= <identifier>
(63) <typedef_dcl> 				::= "typedef" <type_declarator>
(64) <type_declarator> 			::= { <simple_type_spec>| <template_type_spec>| <constr_type_dcl>} <any_declarators>
(65) <any_declarators> 			::= <any_declarator> { "," <any_declarator> }*
(66) <any_declarator> 			::= <simple_declarator>| <array_declarator>
(67) <declarators> 				::= <declarator> { "," <declarator> }*
(68) <declarator> 				::= <simple_declarator>

构建任何块

(69) <base_type_spec> 			::+ <any_type>
(70) <any_type> 				::= "any"

构建块基本接口

(71) <definition> 				::+ <except_dcl> ";"
| <interface_dcl> 				";"
(72) <except_dcl> 				::= "exception" <identifier> "{" <member>* "}"
(73) <interface_dcl> 			::= <interface_def>| <interface_forward_dcl>
(74) <interface_def> 			::= <interface_header> "{" <interface_body> "}"
(75) <interface_forward_dcl> 	::= <interface_kind> <identifier>
(76) <interface_header> 		::= <interface_kind> <identifier>[ <interface_inheritance_spec> ]
(77) <interface_kind> 			::= "interface"
(78) <interface_inheritance_spec>::= ":" <interface_name> { "," <interface_name> }*
(79) <interface_name> 			::= <scoped_name>
(80) <interface_body> 			::= <export>*
(81) <export> 					::= <op_dcl> ";"| <attr_dcl> ";"
(82) <op_dcl> 					::= <op_type_spec> <identifier> "(" [ <parameter_dcls> ] ")" [ <raises_expr> ]
(83) <op_type_spec> 			::= <type_spec>| "void"
(84) <parameter_dcls> 			::= <param_dcl> { "," <param_dcl> } *
(85) <param_dcl> 				::= <param_attribute> <type_spec> <simple_declarator>
(86) <param_attribute> 			::= "in"| "out"| "inout"
(87) <raises_expr> 				::= "raises" "(" <scoped_name> { "," <scoped_name> } * ")"
(88) <attr_dcl> 				::= <readonly_attr_spec>| <attr_spec>
(89) <readonly_attr_spec> 		::= "readonly" "attribute" <type_spec> <readonly_attr_declarator>
(90) <readonly_attr_declarator>::= <simple_declarator> <raises_expr>| <simple_declarator> { "," <simple_declarator> }*
(91) <attr_spec> 				::= "attribute" <type_spec> <attr_declarator>
(92) <attr_declarator> 			::= <simple_declarator> <attr_raises_expr>| <simple_declarator> { "," <simple_declarator> }*
(93) <attr_raises_expr> 		::= <get_excep_expr> [ <set_excep_expr> ]| <set_excep_expr>
(94) <get_excep_expr> 			::= "getraises" <exception_list>
(95) <set_excep_expr> 			::= "setraises" <exception_list>
(96) <exception_list> 			::= "(" <scoped_name> { "," <scoped_name> } * ")"

构建块完整接口

(97) <export> 					::+ <type_dcl> ";"| <const_dcl> ";"| <except_dcl> ";"

构建块数据类型

(98) <definition> 				::+ <value_dcl> ";"
(99) <value_dcl> 				::= <value_def>| <value_forward_dcl>
(100) <value_def> 				::= <value_header> "{" <value_element>* "}"
(101) <value_header> 			::= <value_kind> <identifier> [ <value_inheritance_spec> ]
(102) <value_kind> 				::= "valuetype"
(103) <value_inheritance_spec>::= [ ":" <value_name> ] [ "supports" <interface_name> ]
(104) <value_name> 				::= <scoped_name>
(105) <value_element> 			::= <export>| <state_member>| <init_dcl>
(106) <state_member> 			::= ( "public" | "private" ) <type_spec> <declarators> ";"
(107) <init_dcl> 				::= "factory" <identifier> "(" [ <init_param_dcls> ] ")" [ <raises_expr> ] ";"
(108) <init_param_dcls> 		::= <init_param_dcl> { "," <init_param_dcl>}*
(109) <init_param_dcl> 			::= "in" <type_spec> <simple_declarator>
(110) <value_forward_dcl> 		::= <value_kind> <identifier>

构建块CORBA实现–接口

(113) <type_id_dcl> 			::= "typeid" <scoped_name> <string_literal>
(114) <type_prefix_dcl> 		::= "typeprefix" <scoped_name> <string_literal>
(115) <import_dcl> 				::= "import" <imported_scope>
(116) <imported_scope> 			::= <scoped_name> | <string_literal>
(117) <base_type_spec> 			::+ <object_type>
(118) <object_type> 			::= "Object"
(119) <interface_kind> 			::+ "local" "interface"
(120) <op_oneway_dcl> 			::= "oneway" "void" <identifier> "(" [ <in_parameter_dcls> ] ")"
(121) <in_parameter_dcls> 		::= <in_param_dcl> { "," <in_param_dcl> } *
(122) <in_param_dcl> 			::= "in" <type_spec> <simple_declarator>
(123) <op_with_context> 		::= {<op_dcl> | <op_oneway_dcl>} <context_expr>
(124) <context_expr> 			::= "context" "(" <string_literal> { "," <string_literal>* } ")"

构建块CORBA实现–数据类型

(125) <value_dcl> 				::+ <value_box_def>| <value_abs_def>
(126) <value_box_def> 			::= "valuetype" <identifier> <type_spec>
(127) <value_abs_def> 			::= "abstract" "valuetype" <identifier> [ <value_inheritance_spec> ]"{" <export>* "}"
(128) <value_kind> 				::+ "custom" "valuetype"
(129) <interface_kind> 			::+ "abstract" "interface"
(130) <value_inheritance_spec>::+ ":" ["truncatable"] <value_name> { "," <value_name> }*[ "supports" <interface_name> { "," <interface_name> }* ]
(131) <base_type_spec> 			::+ <value_base_type>
(132) <value_base_type> 		::= "ValueBase"

构建块组件–基本

(133) <definition> 				::+ <component_dcl> ";"
(134) <component_dcl> 			::= <component_def>| <component_forward_dcl>
(135) <component_forward_dcl>::= "component" <identifier>
(136) <component_def> 			::= <component_header> "{" <component_body> "}"
(137) <component_header> 		::= "component" <identifier> [ <component_inheritance_spec> ]
(138) <component_inheritance_spec>::= ":" <scoped_name> 
(139) <component_body> 			::= <component_export>*
(140) <component_export> 		::= <provides_dcl> ";"| <uses_dcl> ";"| <attr_dcl> ";"
(141) <provides_dcl> 			::= "provides" <interface_type> <identifier>
(142) <interface_type> 			::= <scoped_name>
(143) <uses_dcl> 				::= "uses" <interface_type> <identifier>

构建块组件–homes

(144) <definition> 				::+ <home_dcl> ";"
(145) <home_dcl> 				::= <home_header> "{" <home_body> "}"
(146) <home_header> 			::= "home" <identifier> [ <home_inheritance_spec> ]"manages" <scoped_name>
(147) <home_inheritance_spec> 	::= ":" <scoped_name>
(148) <home_body> 				::= <home_export>*
(149) <home_export> 			::= <export>| <factory_dcl> ";"
(150) <factory_dcl> 			::= "factory" <identifier> "(" [ <factory_param_dcls> ] ")" [ <raises_expr> ]
(151) <factory_param_dcls> 		::= <factory_param_dcl> {"," <factory_param_dcl>}*
(152) <factory_param_dcl> 		::= "in" <type_spec> <simple_declarator>

构建块CCM实现

(153) <definition> 				::+ <event_dcl> ";"
(154) <component_header> 		::+ "component" <identifier> [ <component_inheritance_spec> ]<supported_interface_spec>
(155) <supported_interface_spec>::= "supports" <scoped_name> { "," <scoped_name> }*
(156) <component_export> 		::+ <emits_dcl> ";"| <publishes_dcl> ";"| <consumes_dcl> ";"
(157) <interface_type> 			::+ "Object"
(158) <uses_dcl> 				::+ "uses" "multiple" <interface_type> <identifier>
(159) <emits_dcl> 				::= "emits" <scoped_name> <identifier>
(160) <publishes_dcl> 			::= "publishes" <scoped_name> <identifier>
(161) <consumes_dcl> 			::= "consumes" <scoped_name> <identifier>
(162) <home_header> 			::+ "home" <identifier> [ <home_inheritance_spec> ][ <supported_interface_spec> ]"manages" <scoped_name> [ <primary_key_spec> ]
(163) <primary_key_spec> 		::= "primarykey" <scoped_name>
(164) <home_export> 			::+ <finder_dcl> ";"
(165) <finder_dcl> 				::= "finder" <identifier> "(" [ <init_param_dcls> ] ")" [ <raises_expr> ]
(166) <event_dcl> 				::= ( <event_def>| <event_abs_def>| <event_forward_dcl> )
(167) <event_forward_dcl> 		::= [ "abstract" ] "eventtype" <identifier>
(168) <event_abs_def> 			::= "abstract" "eventtype" <identifier> [ <value_inheritance_spec> ]"{" <export>* "}"
(169) <event_def> 				::= <event_header> "{" <value_element> * "}"
(170) <event_header> 			::= [ "custom" ] "eventtype" <identifier> [ <value_inheritance_spec> ]

构建块组件–端口和连接器

(171) <definition> 				::+ <porttype_dcl> ";"| <connector_dcl> ";"
(172) <porttype_dcl> 			::= <porttype_def>| <porttype_forward_dcl>
(173) <porttype_forward_dcl> 	::= "porttype" <identifier>
(174) <porttype_def> 			::= "porttype" <identifier> "{" <port_body> "}"
(175) <port_body> 				::= <port_ref> <port_export>*
(176) <port_ref> 				::= <provides_dcl> ";"| <uses_dcl> ";"| <port_dcl> ";"
(177) <port_export> 			::= <port_ref>| <attr_dcl> ";"
(178) <port_dcl> 				::= {"port" | "mirrorport"} <scoped_name> <identifier>
(179) <component_export> 		::+ <port_dcl> ";"
(180) <connector_dcl> 			::= <connector_header> "{" <connector_export>+ "}"
(181) <connector_header> 		::= "connector" <identifier> [ <connector_inherit_spec> ]
(182) <connector_inherit_spec> 	::= ":" <scoped_name>
(183) <connector_export> 		::= <port_ref>| <attr_dcl> ";"

构建模板模块

(184) <definition> 				::+ <template_module_dcl> ";"| <template_module_inst> ";"
(185) <template_module_dcl> 	::= "module" <identifier> "<" <formal_parameters> ">""{" <tpl_definition> +"}"
(186) <formal_parameters> 		::= <formal_parameter> {"," <formal_parameter>}*
(187) <formal_parameter> 		::= <formal_parameter_type> <identifier>
(188) <formal_parameter_type> 	::= "typename" | "interface" | "valuetype" | "eventtype"| "struct" | "union" | "exception" | "enum" | "sequence"| "const" <const_type>| <sequence_type>
(189) <tpl_definition> 			::= <definition>| <template_module_ref> ";"
(190) <template_module_inst> 	::= "module" <scoped_name> "<" <actual_parameters> ">" <identifier>
(191) <actual_parameters> 		::= <actual_parameter> { "," <actual_parameter>}*
(192) <actual_parameter> 		::= <type_spec>| <const_expr>
(193) <template_module_ref> 	::= "alias" <scoped_name> "<" <formal_parameter_names> ">" <identifier>
(194) <formal_parameter_names>::= <identifier> { "," <identifier>}

构建块扩展数据类型

(195) <struct_def> 				::+ "struct" <identifier> ":" <scoped_name> "{" <member>* "}"| "struct" <identifier> "{" "}"
(196) <switch_type_spec> 		::+ <wide_char_type>| <octet_type>
(197) <template_type_spec> 		::+ <map_type>
(198) <constr_type_dcl> 		::+ <bitset_dcl>| <bitmask_dcl>
(199) <map_type> 				::= "map" "<" <type_spec> "," <type_spec> "," <positive_int_const> ">"| "map" "<" <type_spec> "," <type_spec> ">"
(200) <bitset_dcl> 				::= "bitset" <identifier> [":" <scoped_name>] "{" <bitfield>* "}"
(201) <bitfield> 				::= <bitfield_spec> <identifier>* ";"
(202) <bitfield_spec> 			::= "bitfield" "<" <positive_int_const> ">"| "bitfield" "<" <positive_int_const> "," <destination_type> ">"
(203) <destination_type> 		::= <boolean_type> | <octet_type> | <integer_type>
(204) <bitmask_dcl> 			::= "bitmask" <identifier> "{" <bit_value> { "," <bit_value> }* "}"
(205) <bit_value> 				::= <identifier>
(206) <signed_int> 				::+ <signed_tiny_int>
(207) <unsigned_int> 			::+ <unsigned_tiny_int>
(208) <signed_tiny_int> 		::= “int8”
(209) <unsigned_tiny_int> 		::= “uint8”
(210) <signed_short_int> 		::+ “int16”
(211) <signed_long_int> 		::+ “int32”
(212) <signed_longlong_int> 	::+ “int64”
(213) <unsigned_short_int> 		::+ “uint16”
(214) <unsigned_long_int> 		::+ “uint32”
(215) <unsigned_longlong_int> 	::+ “uint64”

构建块匿名类型

(216) <type_spec> 				::+ <template_type_spec>
(217) <declarator> 				::+ <array_declarator>

构建块注释

(218) <definition> 				::+ <annotation_dcl> " ;"
(219) <annotation_dcl> 			::= <annotation_header> "{" <annotation_body> "}"
(220) <annotation_header> 		::= "@annotation" <identifier>
(221) <annotation_body> 		::= { <annotation_member>| <enum_dcl> ";"| <const_dcl> ";"| <typedef_dcl> ";" }*
(222) <annotation_member> 		::= <annotation_member_type> <simple_declarator>[ "default" <const_expr> ] ";"
(223) <annotation_member_type>::= <const_type> | <any_const_type> | <scoped_name>
(224) <any_const_type> 			::= "any"
(225) <annotation_appl> 		::= "@" <scoped_name> [ "(" <annotation_appl_params> ")" ]
(226) <annotation_appl_params>::= <const_expr>| <annotation_appl_param> { "," <annotation_appl_param> }*
(227) <annotation_appl_param>::= <identifier> "=" <const_expr>

构建模块之间的关系

即使构建块被设计得尽可能独立,它们也被一些依赖关系联系在一起。
在这里插入图片描述

3 补充

3.1 OMG介绍

OMG成立于1989年,是一个开放的会员制、非盈利的计算机行业标准联盟。为可互操作、可便携和可复用的分布式、异构环境下的企业应用程序,制定和维护计算机行业规范。会员包括资讯科技供应商、终端用户、政府机构和学术界。
OMG的成员公司按照成熟、开放的流程编写、采用和维护其规范。OMG的规范实现模型驱动架构(MDA),通过对企业的全生命周期方法最大化ROI集成,包括多种操作系统、编程语言、中间件和网络基础设施,以及软件开发环境。
详见:http://www.omg.org/

3.2 CORBA

  • CORBA,Common Object Request Broker Architecture,公共对象请求代理体系结构。由OMG组织制订的一种标准的面向对象应用程序体系规范。或者说 CORBA体系结构是OMG为解决分布式处理环境(DCE)中,硬件和软件系统的互连而提出的一种解决方案。
  • 现在CORBA用的已经很少了,基本上只有一些大的电信项目还在用,现在同类的解决方案中WebService是比较流行的。
    在这里插入图片描述

XML-RPC / SOAP

XML-RPC发表于1998年,由UserLand Software(UserLand Software)的Dave Winer及Microsoft共同发表。后来在新的功能不断被引入下,这个标准慢慢演变成为今日的SOAP协议。

REST

REST是当今最为流行的API。因为大量的Web应用采用REST作为其API的选择。REST是 Representational State Transfer 的缩写。是Roy Thomas Fielding博士于2000年在他的博士论文中提出来的一种万维网软件架构风格。
在这里插入图片描述

CORBA 和 gRPC 比较

CORBA 和 gRPC 二者的设计,都是为了使客户端相信服务器在同一台机器。客户机在桩(Stub)上调用一个方法(method),调用过程由底层协议透明地处理。
在这里插入图片描述

3.3 EBNF(扩展巴科斯范式)

  • 扩展巴科斯-瑙尔范式(Extended Backus–Naur Form,EBNF)是一种用于描述计算机编程语言等正式语言的与上下文无关语法的元语法(metasyntax)符号表示法。简而言之,它是一种描述语言的语言。它是基本巴科斯范式(BNF)元语法符号表示法的一种扩展。
  • 最初由尼克劳斯·维尔特开发,最常用的EBNF变体由标准是 ISO-14977 所定义。

EBNF的基本语法形式如下,这个形式也被叫做production:

左式(LeftHandSide) = 右式(RightHandSide).

标准ISO/IEC 14977 所定义的符号:
在这里插入图片描述

参考

1、OMG–IDL-4.2-PDF
2、wiki-扩展巴克斯-诺尔范式
3、CORBA的简单介绍及HelloWorld
4、扩展巴科斯范式(EBNF)简介
5、架构师该如何为应用选择合适的API
6、远程通信协议:从 CORBA 到 gRPC

相关文章:

OMG--IDL(Interface Definition Language)

OMG--IDL&#xff08;Interface Definition Language&#xff09; 1 概述2 内容缩写IDL 语法和语义概述词法约定ISO Latin-1的字母字符如下表十进制数字字符图形字符格式化字符Tokens注释标识符冲突规则转义标识符关键字IDL识别的其他字符字面量 预处理IDL 语法构建块核心数据类…...

英语学习:M开头

machine 机器 mad 发疯的&#xff0c;生气的 madam 女士&#xff0c;夫人 madame 夫人 magazine 杂志 magic 有魔力的 maid 女仆&#xff0c;侍女 mail 邮递 mailbox 邮箱 mainland 大陆 major 较大的&#xff0c;主要的 majority 大多数 male 雄的 man 人类 man…...

【计算机组成原理与体系结构】控制器

目录 一、CPU的功能与基本结构 二、指令周期的数据流 三、数据通路 四、硬布线控制器 五、微程序控制器 六、微指令 一、CPU的功能与基本结构 运算器基本结构 控制器基本结构 CPU的基本结构 二、指令周期的数据流 取址周期 间址周期 中断周期 指令周期流程 三、数据通路 …...

结构化命令

章节目录&#xff1a; 一、使用 if-then 语句二、if-then-else 语句三、嵌套 if 语句四、test 命令4.1 数值比较4.2 字符串比较4.3 文件比较 五、复合条件测试六、if-then 的高级特性6.1 使用单括号6.2 使用双括号6.3 使用双方括号 七、case 命令八、结束语 本章内容&#xff1…...

Java Web实训项目:西蒙购物网

文章目录 一、创建数据库和表1、创建数据库2、创建用户表3、创建类别表4、创建商品表5、创建订单表 二、创建Simonshop项目1、创建web项目2、修改Artifacts名称&#xff1a;simonshop3、重新部署项目4、编辑首页5、启动应用&#xff0c;查看效果 三、创建实体类1、用户实体类2、…...

ChatGPT Prompt 提示词设计技巧必知必会

本文内容整理自图灵社区直播《朱立成&#xff1a;ChatGPT Prompt提示词技巧必知必会》。 朱立成&#xff0c;图灵社区《ChatGPT即学即用》视频课程作者&#xff0c;软件工程师&#xff0c;对新事物充满好奇&#xff0c;关注ChatGPT应用。2001年毕业于浙江大学&#xff0c;从事软…...

尚硅谷-云尚办公-项目复盘

尚硅谷-云尚办公-项目复盘 资料地址本文介绍问题汇总问题1.knife4j无法下载 视频4问题2.dev等含义 视频5问题3.wrapper继承/实现图 视频8问题4.修改统一返回结果 视频11问题5.修改后新增也变修改 视频29问题6.redis中key值乱码 视频55-60问题7.RangeError: Maximum call stack …...

nacos升级到2.0.3(单机模式)

前提&#xff1a;https://github.com/alibaba/spring-cloud-alibaba/wiki/版本说明 Spring Cloud AlibabaSpring CloudSpring BootNacos2.2.7.RELEASESpring Cloud Hoxton.SR122.3.12.RELEASE2.0.3 一、pom.xml文件 <parent><groupId>org.springframework.boot&…...

Koa学习3:用户添加、错误处理

模型 在src目录下创建model目录&#xff0c;用来存放模型 创建用户模型 user.model.js 注意&#xff1a; UUID类型是无法自增的&#xff0c;将id设置为UUID类型时只需要为其指定默认值即可 // 数据类型 const { DataTypes } require(sequelize); // 导入已经连接了数据库…...

网络安全入门学习第十五课——PHP基础

文章目录 一、WEB技术1、什么是web2、B/S架构3、C/S架构 二、PHP概述1、PHP是什么2、PHP受欢迎的原因3、基于MVC模式的PHP框架4、常用编译工具5、PHP环境搭建6、开发工具 三、PHP基本语法格式1、标记2、输出语句3、注释4、标识符 四、数据与运算1、常量1.1、常量定义1.2、预定义…...

电子科技大学 数学专业-功不唐捐,玉汝于成

电子科技大学 数学专业 功不唐捐&#xff0c;玉汝于成 1.本科背景 本科是坐落于湖南湘潭的湖南科技大学&#xff0c;专业为网络工程专业&#xff0c;因热爱数学专业&#xff0c;所以决定跨考数学专业。 本科专业课平均成绩85&#xff0c;排名10/104。CET 4 474分&#xff0c;…...

Android10.0 iptables用IOemNetd实现删除子链功能的实现

1.前言 在10.0的系统rom定制化开发中,在system中netd网络这块的产品需要中,会要求设置屏蔽ip地址之内的功能, liunx中iptables命令也是比较重要的,接下来就来在IOemNetd这块实现删除创建子链的相关功能 2. iptables用IOemNetd实现删除创建子链功能的实现的核心类 syste…...

OpenGL光照之光照贴图

文章目录 漫反射贴图镜面光贴图放射光贴图代码 每个物体都拥有自己独特的材质从而对光照做出不同的反应的方法。这样子能够很容易在一个光照的场景中给每个物体一个独特的外观&#xff0c;但是这仍不能对一个物体的视觉输出提供足够多的灵活性。 我们将整个物体的材质定义为一个…...

2018~2019 学年第二学期《信息安全》考试试题(B 卷)

北京信息科技大学 2018 ~2019 学年第 2 学期 《信息安全》课程期末考试试卷 B 课程所在学院:计算机学院 适用专业班级:计科 1601-06&#xff0c;重修 考试形式:(闭卷) 一. 选择题(本题满分 10 分&#xff0c;共含 10 道小题&#xff0c;每小题 1 分) 网络中存在的安全漏洞主…...

LeetCode-C#-0002.两数相加

0.声明 该题目来源于LeetCode 如有侵权&#xff0c;立马删除。 解法不唯一&#xff0c;如有新解法可一同讨论。 1.题目 0002两数相加 给你两个非空的链表&#xff0c;表示两个非负的整数&#xff0c;它们每位数字都是按照逆序的方式存储的&#xff0c;并且每个节点只能存储一…...

访问修饰符private,default,protected,public访问等级区别

private&#xff1a;private是最严格的访问修饰符&#xff0c;它将成员声明为私有的。私有成员只能在声明它们的类内部访问&#xff0c;其他类无法直接访问私有成员。这样可以确保数据的封装性和安全性。 default&#xff08;默认&#xff09;&#xff1a;如果没有明确指定访问…...

阿里云(Linux)安装Docker教程

首先安装docker&#xff0c;需要找到帮助文档&#xff0c;那肯定是我们的官网&#xff1a; Install Docker Engine on CentOS | Docker Documentation 找到对应的位置&#xff0c;这里是安装在CentOS中&#xff0c;版本需要Ce…...

Linux C编程基础:获取时间

1.前言 对于linux下的编程&#xff0c;无论是用户态还是内核态&#xff0c;时间获取都是经常需要使用到的。以下分别从用户态和内核态整理了几个常用的时间获取接口&#xff0c;供编写代码时快速查阅。 2.用户态获取时间 2.1 clock_gettime() #include <time.h>int c…...

Spring核心注解

1、Bean注解 作用&#xff1a;用于把当前方法的返回值作为bean对象存入spring的ioc容器中位置: 一般出现在方法上面属性: name:用于指定bean的id。当不写时&#xff0c;默认值是当前方法的名称细节&#xff1a;当我们使用注解配置方法时&#xff0c;如果方法有参数&#xff0c;…...

哈希表原理,以及unordered_set/和unordered_map的封装和迭代器的实现

哈希表 unordered系列unordered_set和unordered_map的使用哈希哈希概念哈希冲突哈希函数闭散列开散列哈希表的扩容哈希表源码&#xff08;开散列和闭散列&#xff09; 封装unordered_set/和unordered_map&#xff0c;以及实现迭代器节点定义unordered_set定义unordered_map定义…...

网络编程(Modbus进阶)

思维导图 Modbus RTU&#xff08;先学一点理论&#xff09; 概念 Modbus RTU 是工业自动化领域 最广泛应用的串行通信协议&#xff0c;由 Modicon 公司&#xff08;现施耐德电气&#xff09;于 1979 年推出。它以 高效率、强健性、易实现的特点成为工业控制系统的通信标准。 包…...

iOS 26 携众系统重磅更新,但“苹果智能”仍与国行无缘

美国西海岸的夏天&#xff0c;再次被苹果点燃。一年一度的全球开发者大会 WWDC25 如期而至&#xff0c;这不仅是开发者的盛宴&#xff0c;更是全球数亿苹果用户翘首以盼的科技春晚。今年&#xff0c;苹果依旧为我们带来了全家桶式的系统更新&#xff0c;包括 iOS 26、iPadOS 26…...

Unity3D中Gfx.WaitForPresent优化方案

前言 在Unity中&#xff0c;Gfx.WaitForPresent占用CPU过高通常表示主线程在等待GPU完成渲染&#xff08;即CPU被阻塞&#xff09;&#xff0c;这表明存在GPU瓶颈或垂直同步/帧率设置问题。以下是系统的优化方案&#xff1a; 对惹&#xff0c;这里有一个游戏开发交流小组&…...

全球首个30米分辨率湿地数据集(2000—2022)

数据简介 今天我们分享的数据是全球30米分辨率湿地数据集&#xff0c;包含8种湿地亚类&#xff0c;该数据以0.5X0.5的瓦片存储&#xff0c;我们整理了所有属于中国的瓦片名称与其对应省份&#xff0c;方便大家研究使用。 该数据集作为全球首个30米分辨率、覆盖2000–2022年时间…...

最新SpringBoot+SpringCloud+Nacos微服务框架分享

文章目录 前言一、服务规划二、架构核心1.cloud的pom2.gateway的异常handler3.gateway的filter4、admin的pom5、admin的登录核心 三、code-helper分享总结 前言 最近有个活蛮赶的&#xff0c;根据Excel列的需求预估的工时直接打骨折&#xff0c;不要问我为什么&#xff0c;主要…...

多模态商品数据接口:融合图像、语音与文字的下一代商品详情体验

一、多模态商品数据接口的技术架构 &#xff08;一&#xff09;多模态数据融合引擎 跨模态语义对齐 通过Transformer架构实现图像、语音、文字的语义关联。例如&#xff0c;当用户上传一张“蓝色连衣裙”的图片时&#xff0c;接口可自动提取图像中的颜色&#xff08;RGB值&…...

从零开始打造 OpenSTLinux 6.6 Yocto 系统(基于STM32CubeMX)(九)

设备树移植 和uboot设备树修改的内容同步到kernel将设备树stm32mp157d-stm32mp157daa1-mx.dts复制到内核源码目录下 源码修改及编译 修改arch/arm/boot/dts/st/Makefile&#xff0c;新增设备树编译 stm32mp157f-ev1-m4-examples.dtb \stm32mp157d-stm32mp157daa1-mx.dtb修改…...

【Web 进阶篇】优雅的接口设计:统一响应、全局异常处理与参数校验

系列回顾&#xff1a; 在上一篇中&#xff0c;我们成功地为应用集成了数据库&#xff0c;并使用 Spring Data JPA 实现了基本的 CRUD API。我们的应用现在能“记忆”数据了&#xff01;但是&#xff0c;如果你仔细审视那些 API&#xff0c;会发现它们还很“粗糙”&#xff1a;有…...

C++.OpenGL (10/64)基础光照(Basic Lighting)

基础光照(Basic Lighting) 冯氏光照模型(Phong Lighting Model) #mermaid-svg-GLdskXwWINxNGHso {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-GLdskXwWINxNGHso .error-icon{fill:#552222;}#mermaid-svg-GLd…...

土地利用/土地覆盖遥感解译与基于CLUE模型未来变化情景预测;从基础到高级,涵盖ArcGIS数据处理、ENVI遥感解译与CLUE模型情景模拟等

&#x1f50d; 土地利用/土地覆盖数据是生态、环境和气象等诸多领域模型的关键输入参数。通过遥感影像解译技术&#xff0c;可以精准获取历史或当前任何一个区域的土地利用/土地覆盖情况。这些数据不仅能够用于评估区域生态环境的变化趋势&#xff0c;还能有效评价重大生态工程…...