Issue 3923: #pragma prefix issue (java-rtf) Source: SciTegic Inc. (Scott Markel, Ph.D., nobody) Nature: Uncategorized Issue Severity: Summary: Section 1.5.3 of the OMG's IDL Style Guide (ab/98-06-03) indicates that #pragma prefix "omg.org" should appear in any IDL file belonging to an OMG-approved specification. With the use of this prefix, the RepositoryID of a valuetype V in module M would be "IDL:omg.org/M/V:1.0" Section 1.13.8 of the IDL to Java Language Mapping Specification (formal/99-07-53) specifies the algorithm to be used in determining the location of a valuetype and its corresponding default factory, where location is in the Java package sense. If an ORB vendor follows this algorithm, the default value factory will be assumed to be in the Java package given by omg.org.M Following the Java convention of reversing a domain name to obtain a package hierarchy, one would expect to have implementation code in org.omg.M This mismatch requires users to register default value factories, which seems to go against the spirit of the second paragraph of section 5.4.3 of the CORBA 2.3.1 Specification (formal/99-10-07) where the term "implicit registration" is used. Proposed resolution: In the IDL to Java language mapping the omg.org prefix is reversed to org.omg. Comments? Resolution: see below Revised Text: Add a sub-bullet to the second bullet in Section 13.8: If this is not successful and the first two components of the Java class name are "omg.org", then reverse the order of these components to be "org.omg" and repeat the above step. Actions taken: September 28, 2000: received issue February 27, 2001: closed issue Discussion: In the IDL to Java language mapping the omg.org prefix is reversed to org.omg. Comments? End of Annotations:===== Date: Thu, 28 Sep 2000 14:24:43 -0700 From: Scott Markel Organization: NetGenics, Inc. X-Mailer: Mozilla 4.73 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: java-rtf@omg.org Subject: #pragma prefix issue Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: Jg3e9!*nd9jOid9Unpd9 While implementing the new Biomolecular Sequence Analysis specification, I had trouble with the package location of default value factories. I discussed my difficulties with Jeff Mischkinsky and Simon Nash in Oslo and then again with Jeff in Burlingame. Jeff suggested that I write up my thoughts and get a discussion started on this mailing list. Here's the issue - Section 1.5.3 of the OMG's IDL Style Guide (ab/98-06-03) indicates that #pragma prefix "omg.org" should appear in any IDL file belonging to an OMG-approved specification. With the use of this prefix, the RepositoryID of a valuetype V in module M would be "IDL:omg.org/M/V:1.0" Section 1.13.8 of the IDL to Java Language Mapping Specification (formal/99-07-53) specifies the algorithm to be used in determining the location of a valuetype and its corresponding default factory, where location is in the Java package sense. If an ORB vendor follows this algorithm, the default value factory will be assumed to be in the Java package given by omg.org.M Following the Java convention of reversing a domain name to obtain a package hierarchy, one would expect to have implementation code in org.omg.M This mismatch requires users to register default value factories, which seems to go against the spirit of the second paragraph of section 5.4.3 of the CORBA 2.3.1 Specification (formal/99-10-07) where the term "implicit registration" is used. Proposed resolution: In the IDL to Java language mapping the omg.org prefix is reversed to org.omg. Comments? Scott -- Scott Markel, Ph.D. NetGenics, Inc. smarkel@netgenics.com 4350 Executive Drive Tel: 858 455 5223 Suite 260 FAX: 858 455 1388 San Diego, CA 92121 Date: Fri, 29 Sep 2000 09:43:35 -0700 From: Scott Markel Organization: NetGenics, Inc. X-Mailer: Mozilla 4.73 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: Michi Henning CC: java-rtf@omg.org Subject: Re: #pragma prefix issue References: Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: S:Xd9lPbd9i/ad9/#6!! Michi, Michi Henning wrote: > > On Thu, 28 Sep 2000, Scott Markel wrote: > > > Proposed resolution: > > > > In the IDL to Java language mapping the omg.org prefix is reversed to > > org.omg. > > > > Comments? > > I fear that this would cause endless disaster. I remember that, several > years ago, one ORB vendor accidentally had an "org.omg" prefix for > their naming service instead of an "omg.org" prefix. The result was that > absolutely nothing would interoperate with that naming service... > > I don't think we could just change the prefix. If we did, we would effectively > break all existing code that is compiled from current OMG IDL... Do you have any suggestions for changes that could be made? Having to register default factories works, but seems to somewhat defeat the purpose of having a default. Scott -- Scott Markel, Ph.D. NetGenics, Inc. smarkel@netgenics.com 4350 Executive Drive Tel: 858 455 5223 Suite 260 FAX: 858 455 1388 San Diego, CA 92121 Date: Mon, 02 Oct 2000 12:08:19 -0700 From: "Vijaykumar Natarajan" X-Mailer: Mozilla 4.73 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: Scott Markel CC: Michi Henning , java-rtf@omg.org Subject: Re: #pragma prefix issue References: <39D4C6B7.F3263272@netgenics.com> Content-Type: multipart/mixed; boundary="------------10AC06B13AF1FC8428CF2FFB" X-UIDL: 3b""!ia8e95*n!!"6"!! Given that any solution now has to be backward compatible w/ what exists, I am not sure how we can solve this problem in a general way(for all rep IDs). However, we may want to suggest a conversion rule that is applied when searching for classes whcih should deal w/ the most common pain, ie that of a prefix that is the inverse of the package name. . For example, we search for IDL:omg.org/....:1.0 omg.org...... (default rule) org.omg...... (If the first element(elements being demarcated by /) has . in it, then reverse the components) IDL:a.b.c/.....:1.0 a.b.c...... c.b.a...... Vijay Scott Markel wrote: > Michi, > > Michi Henning wrote: > > > > On Thu, 28 Sep 2000, Scott Markel wrote: > > > > > Proposed resolution: > > > > > > In the IDL to Java language mapping the omg.org prefix is >reversed to > > > org.omg. > > > > > > Comments? > > > > I fear that this would cause endless disaster. I remember that, >several > > years ago, one ORB vendor accidentally had an "org.omg" prefix for > > their naming service instead of an "omg.org" prefix. The result >was that > > absolutely nothing would interoperate with that naming service... > > > > I don't think we could just change the prefix. If we did, we would >effectively > > break all existing code that is compiled from current OMG IDL... > > Do you have any suggestions for changes that could be made? Having >to > register default factories works, but seems to somewhat defeat the > purpose of having a default. > > Scott > > -- > Scott Markel, Ph.D. NetGenics, Inc. > smarkel@netgenics.com 4350 Executive Drive > Tel: 858 455 5223 Suite 260 > FAX: 858 455 1388 San Diego, CA 92121 [] vijayn.vcf Date: Mon, 02 Oct 2000 21:32:26 +0100 From: Simon Nash Organization: IBM X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; I) X-Accept-Language: en MIME-Version: 1.0 To: Scott Markel CC: Michi Henning , java-rtf@omg.org Subject: Re: #pragma prefix issue References: <39D4C6B7.F3263272@netgenics.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: Dk(!!8B+e9UCGe9Q-Yd9 Scott, I agree with Michi that the repids should not change. However, the rule for looking up a default value factory could be changed to treat the prefix "omg.org" as a special case and perform the lookup in the org.omg.* namespace instead of the omg.org.* namespace. This would not cause any incompatibility with current ORBs, compilers, or applications. Simon Scott Markel wrote: > > Michi, > > Michi Henning wrote: > > > > On Thu, 28 Sep 2000, Scott Markel wrote: > > > > > Proposed resolution: > > > > > > In the IDL to Java language mapping the omg.org prefix is reversed to > > > org.omg. > > > > > > Comments? > > > > I fear that this would cause endless disaster. I remember that, several > > years ago, one ORB vendor accidentally had an "org.omg" prefix for > > their naming service instead of an "omg.org" prefix. The result was that > > absolutely nothing would interoperate with that naming service... > > > > I don't think we could just change the prefix. If we did, we would effectively > > break all existing code that is compiled from current OMG IDL... > > Do you have any suggestions for changes that could be made? Having to > register default factories works, but seems to somewhat defeat the > purpose of having a default. > > Scott > > -- > Scott Markel, Ph.D. NetGenics, Inc. > smarkel@netgenics.com 4350 Executive Drive > Tel: 858 455 5223 Suite 260 > FAX: 858 455 1388 San Diego, CA 92121 -- Simon C Nash, Technology Architect, IBM Java Technology Centre Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb Date: Tue, 3 Oct 2000 10:04:17 +1000 (EST) From: Michi Henning To: Simon Nash cc: Scott Markel , java-rtf@omg.org Subject: Re: #pragma prefix issue In-Reply-To: <39D8F0DA.33B3C2D3@hursley.ibm.com> Message-ID: Organization: Object Oriented Concepts MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-UIDL: cbL!!IM Scott, > I agree with Michi that the repids should not change. However, the > rule for > looking up a default value factory could be changed to treat the > prefix > "omg.org" as a special case and perform the lookup in the org.omg.* > namespace > instead of the omg.org.* namespace. This would not cause any > incompatibility > with current ORBs, compilers, or applications. I think that's a nice idea! Cheers, Michi. -- Michi Henning +61 7 3891 5744 Object Oriented Concepts +61 4 1118 2700 (mobile) Suite 4, 904 Stanley St +61 7 3891 5009 (fax) East Brisbane 4169 michi@ooc.com.au AUSTRALIA http://www.ooc.com.au/staff/michi-henning.html Date: Mon, 02 Oct 2000 18:08:00 -0700 From: "Vijaykumar Natarajan" X-Mailer: Mozilla 4.73 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: Simon Nash CC: Scott Markel , Michi Henning , java-rtf@omg.org Subject: Re: #pragma prefix issue References: <39D4C6B7.F3263272@netgenics.com> <39D8F0DA.33B3C2D3@hursley.ibm.com> Content-Type: multipart/mixed; boundary="------------E3D48AFC507656F9B6F8D96D" X-UIDL: HL:!!>Hd!!7V$!!9U8e9 As I said in my earlier mail, I would rather have a generic prefix->package optional conversion rule than special case just "omg.org". This applies the same solution to a more broader scope. Vijay Simon Nash wrote: > Scott, > I agree with Michi that the repids should not change. However, the > rule for > looking up a default value factory could be changed to treat the > prefix > "omg.org" as a special case and perform the lookup in the org.omg.* > namespace > instead of the omg.org.* namespace. This would not cause any > incompatibility > with current ORBs, compilers, or applications. > > Simon > > Scott Markel wrote: > > > > Michi, > > > > Michi Henning wrote: > > > > > > On Thu, 28 Sep 2000, Scott Markel wrote: > > > > > > > Proposed resolution: > > > > > > > > In the IDL to Java language mapping the omg.org prefix is > reversed to > > > > org.omg. > > > > > > > > Comments? > > > > > > I fear that this would cause endless disaster. I remember that, > several > > > years ago, one ORB vendor accidentally had an "org.omg" prefix > for > > > their naming service instead of an "omg.org" prefix. The result > was that > > > absolutely nothing would interoperate with that naming > service... > > > > > > I don't think we could just change the prefix. If we did, we > would effectively > > > break all existing code that is compiled from current OMG IDL... > > > > Do you have any suggestions for changes that could be made? > Having to > > register default factories works, but seems to somewhat defeat the > > purpose of having a default. > > > > Scott > > > > -- > > Scott Markel, Ph.D. NetGenics, Inc. > > smarkel@netgenics.com 4350 Executive Drive > > Tel: 858 455 5223 Suite 260 > > FAX: 858 455 1388 San Diego, CA 92121 > > -- > Simon C Nash, Technology Architect, IBM Java Technology Centre > Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England > Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb [] vijayn9.vcf Date: Tue, 03 Oct 2000 01:37:40 +0100 From: Simon Nash Organization: IBM X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; I) X-Accept-Language: en MIME-Version: 1.0 To: Vijaykumar Natarajan CC: Scott Markel , Michi Henning , java-rtf@omg.org Subject: Re: #pragma prefix issue References: <39D4C6B7.F3263272@netgenics.com> <39D8DD23.EB9A5B33@inprise.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: NKWd9`K`d9Phcd98^%!! Vijay, I would prefer this to be a special rule for omg.org rather than a more general rule for all prefixes. This avoids the performance overhead of doing two searches every time a prefix has a period in it. Also, if we restrict this reordering to the specific case of omg.org, it is only necessary to search for org.omg.*, since there are no classes in the omg.org.* Java packages. For types like com.acme.FooBar, I think it is better for to people to use #pragma prefix "com.acme" rather than #pragma prefix "acme.com" since the latter would propagate the current confusion over the correct ordering to user-defined types as well as the standard CORBA ones, giving rise to endless typing errors. This isn't a problem for the standard CORBA types, since the IDL is provided by OMG and so will have the correctly ordered prefix. Simon Vijaykumar Natarajan wrote: > > Given that any solution now has to be backward compatible w/ what exists, I am not > sure how we can solve this problem in a general way(for all rep IDs). However, we > may want to suggest a conversion rule that is applied when searching for classes > whcih should deal w/ the most common pain, ie that of a prefix that is the inverse > of the package name. . For example, we search for > > IDL:omg.org/....:1.0 > omg.org...... (default rule) > org.omg...... (If the first element(elements being demarcated by /) has . in it, > then reverse the components) > > IDL:a.b.c/.....:1.0 > a.b.c...... > c.b.a...... > > Vijay > > Scott Markel wrote: > > > Michi, > > > > Michi Henning wrote: > > > > > > On Thu, 28 Sep 2000, Scott Markel wrote: > > > > > > > Proposed resolution: > > > > > > > > In the IDL to Java language mapping the omg.org prefix is reversed to > > > > org.omg. > > > > > > > > Comments? > > > > > > I fear that this would cause endless disaster. I remember that, several > > > years ago, one ORB vendor accidentally had an "org.omg" prefix for > > > their naming service instead of an "omg.org" prefix. The result was that > > > absolutely nothing would interoperate with that naming service... > > > > > > I don't think we could just change the prefix. If we did, we would effectively > > > break all existing code that is compiled from current OMG IDL... > > > > Do you have any suggestions for changes that could be made? Having to > > register default factories works, but seems to somewhat defeat the > > purpose of having a default. > > > > Scott > > > > -- > > Scott Markel, Ph.D. NetGenics, Inc. > > smarkel@netgenics.com 4350 Executive Drive > > Tel: 858 455 5223 Suite 260 > > FAX: 858 455 1388 San Diego, CA 92121 -- Simon C Nash, Technology Architect, IBM Java Technology Centre Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb Date: Thu, 26 Oct 2000 16:16:47 +0100 From: Simon Nash Organization: IBM X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; I) X-Accept-Language: en MIME-Version: 1.0 To: Mary Leland CC: java-rtf@omg.org Subject: Re: Valuetype unmarshalling References: <39F5E6B0.D93B4956@hursley.ibm.com> <39F6F20F.457AB4DB@fpk.hp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=iso-8859-1 X-UIDL: "c9e9X0-!!AG$e9B+Vd9 Mary, Mary Leland wrote: > > Simon, > > Issue 3923, the pragma prefix "org.omg" vs. "omg.org" problem, > also requires changes to the algorithm in Section 1.13.8. > A possible resolution to 3923 is > Add a sub-bullet to the second bullet in Section 13.8: > If this is not successful and the first two components of the > Java class name are "omg.org", then reverse the order of these > components to be "org.omg" and repeat the above step. > > Would this resolution interfere with your proposal for the new issue? > Not at all. They go together very nicely :-) > Should your proposed resolution include a similar rule for your 2nd > change (the new bullet to be inserted before the existing 3rd > bullet)? > Yes, good catch. Here's the revised new bullet: If this is not successful and the RepositoryId is a standard > repository id that starts wit h, then attempt to generate the boxed value helper > class name to use by stripping off th e header an d version information trailer, and replacing th es that separate the module > names wit hs and appending components of the Java class name are "omg.org", > then reverse the order of these components to be "org.omg" and repeat the above step. One more comment on the omg.org change: Your proposed wording requires the omg.org.* Java name to be looked up unsuccessfully first before trying the org.omg.* name. Is this a useful step, since there are no legal Java class names that start with omg.org.*? Simon > Thanks, > -- Mary > > Simon Nash wrote: > > > > The rules for valuetype unmarshalling in section 1.13.8 of the IDL to > > Java mapping spec need to be expanded. There are two issues with the > > algorithm currently described: > > > > 1. The algorithm described is based purely on the repository ID, > > which may either be read off the wire or passed as an argument on > > the read_value() call. However, if the expected type is passed > > as an argument on the read_value() call, then this should be taken > > into account in the unmarshalling algorithm. > > 2. In some cases, the unmarshaller does not have enough information > > to distinguish between a boxed valuetype (which is unmarshalled > > using a helper object) and a regular valuetype (which is unmarshalled > > using a value factory). An additional step in the unmarshalling > > algorithm is needed to cover these cases. > > > > Proposed resolution: > > > > In section 1.13.8, add a new bullet before the existing second bullet > > as follows: > > If this is not successful and an expected type clz was passed on the > > read_value call, and if clz implements IDLEntity but not ValueBase, then > > unmarshal the valuetype as a boxed IDL type by calling the read method > > of Helper. > > > > In section 1.13.8, add a new bullet before the existing third bullet > > as follows: > > If this is not successful and the RepositoryId is a standard repository id that starts > > wit h, then attempt to generate the boxed value helper class name to use by > > stripping off th e header an d version information > > trailer, and replacing th es that separate the module names wit hs and > > appendin g > > > > In section 1.13.8, add a new bullet before the existing fourth bullet > > as follows: > > If this is not successful and an expected type clz was passed on the > > read_value call, and if clz does not implement IDLEntity, then use the > > ValueHandler interface to read in the value (see the Java to IDL Language > > Mapping document, Section 1.5.1.3 , on page 1-40). > > > > Simon > > -- > > Simon C Nash, Technology Architect, IBM Java Technology Centre > > Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England > > Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb -- Simon C Nash, Technology Architect, IBM Java Technology Centre Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb