Issue 2647: Modification of Constant Mapping (java-rtf) Source: (, ) Nature: Uncategorized Issue Severity: Summary: Summary: When we split the mapping of interfaces into the operations and signature interfaces, we had to make a decision what to do with constants that are declared within interfaces. At the time it seemed that most analogous thing to do was to leave it on the signature interface. Upon further consideration it would probably be better if it were on the operations interface. This would make it available on the server side. This is a backwards compatible change because operations is inherited by the signature interface so the contstant would still be visible to clients without changing their code. It only involves a small change to the generated code. Resolution: Revised Text: An Interface: Para 1: change "in either the Java signature interface" to "in either the Java operations interface" Add a new para following para 1: "Note that because the signature interface extends the operations interface for non-abstract IDL interfaces, the constant is available in all the mapped Java interfaces." In the example: Move the declaration: int aLongerOne = (int) (-321L) from interface Face to interface FaceOperations Actions taken: May 10, 1999: received issue January 9, 2001: closed issue Discussion: End of Annotations:===== X-Sender: jmischkinsky@mail.inprise.com Date: Sun, 09 May 1999 08:33:52 -0700 To: issues@omg.org, java-rtf@omg.org From: "Jeff Mischkinsky" Subject: Modification of Contant Mapping When we split the mapping of interfaces into the operations and signature interfaces, we had to make a decision what to do with constants that are declared within interfaces. At the time it seemed that most analogous thing to do was to leave it on the signature interface. Upon further consideration it would probably be better if it were on the operations interface. This would make it available on the server side. This is a backwards compatible change because operations is inherited by the signature interface so the contstant would still be visible to clients without changing their code. It only involves a small change to the generated code. Proposed change: In section 25.6.1 Constants Within An Interface: Para 1: change "in either the Java signature inteface" to "in either the Java operations interface" Add a new para following para 1: "Note that because the signature interface extends the operations interface for non-abstract IDL interfaces, the constant is available in all the mapped Java interfaces." In the example: Move the declaration: int aLongerOne = (int) (-321L) from interface Face to interface FaceOperations jeff Jeff Mischkinsky email: jeffm@inprise.com INPRISE Corporation voice: (650) 358-3049 951 Mariner's Island Blvd fax: (650) 286-2464 San Mateo, CA 94404 web: http://www.inprise.com Date: Tue, 28 Nov 2000 17:31:57 -0800 From: "Vijaykumar Natarajan" X-Mailer: Mozilla 4.51 [en]C-CCK-MCD (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: java-rtf@omg.org, issues@omg.org Subject: Issue 2647: Mapping constants to Operations interface is broken Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: CImd9SH!e9X], java-rtf@omg.org From: Mark Spruiell Subject: Re: Issue 2647: Mapping constants to Operations interface is broken In-Reply-To: <3A245C8D.67C4156D@inprise.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-UIDL: /)"e9liI!!JW"e9OoV!! Hi Vijay, Here's a friendly re-wording of your proposal, which I think makes it clearer that the constants will be mapped to fields in *both* the operations and signature interfaces: "Constants declared within an IDL abstract interface are mapped to fields in the Java interface corresponding to the IDL abstract interface (see Section 1.12, "Mapping for Interface", on page 1-28). Constants declared within a non-abstract IDL interface are mapped to fields in both the signature and operations interfaces corresponding to the IDL interface." Take care, Mark -- Mark E. Spruiell Object Oriented Concepts, Inc. mes@ooc.com * http://www.ooc.com At 05:31 PM 11/28/2000 -0800, Vijaykumar Natarajan wrote: >Hi all, > >The resolution for Issue 2647 which passed earlier during this RTF is >partially broken. >The resolution moved constant definition from the signature interface to >the operations interface >however, when there is inheritance like the following > >interface foo { > const string x ="hello"; >}; > >interface bar : foo { > const string x="goodbye"; >}; > >And code is written as bar.x, there is ambiguity because x exists both >from barOperations and foo through fooOperations and hence code is not >compilable. > >Proposal: > >Change section 1.6.1 to read: >Constants declared within an IDL interface are mapped to fields in >either the Java >**signature and **operations interfaces for non-abstract or the sole >Java interface for abstract (see Section >1.12, "Mapping for Interface", on page 1-28) corresponding to the IDL >interface. > >Delete paragraph: > >Note that because the signature interface extends the operations >interface for non-abstract >IDL interfaces, the constant is available in all the mapped Java >interfaces. > > >The above change disambiguates the defined constant for uses where the >signature interface is referred to. > > >Thanks, >Vijay Date: Tue, 05 Dec 2000 14:48:13 -0800 From: "Vijaykumar Natarajan" X-Mailer: Mozilla 4.51 [en]C-CCK-MCD (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: Mark Spruiell CC: Vijaykumar Natarajan , java-rtf@omg.org Subject: Re: Issue 2647: Mapping constants to Operations interface isbroken References: <4.3.2.7.2.20001205134311.0284cef0@192.168.1.2> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: ,;Z!!UPd!!F1&e9IV,e9 I agree, this is definitely clearer. Thanks, Vijay Mark Spruiell wrote: > Hi Vijay, > > Here's a friendly re-wording of your proposal, which I think makes >it > clearer that the constants will be mapped to fields in *both* the > operations and signature interfaces: > > "Constants declared within an IDL abstract interface are mapped to > fields in the Java interface corresponding to the IDL abstract >interface > (see Section 1.12, "Mapping for Interface", on page 1-28). Constants > declared within a non-abstract IDL interface are mapped to fields in >both > the signature and operations interfaces corresponding to the IDL >interface." > > Take care, > > Mark > -- > Mark E. Spruiell > Object Oriented Concepts, Inc. > mes@ooc.com * http://www.ooc.com > > At 05:31 PM 11/28/2000 -0800, Vijaykumar Natarajan wrote: > >Hi all, > > > >The resolution for Issue 2647 which passed earlier during this RTF >is > >partially broken. > >The resolution moved constant definition from the signature >interface to > >the operations interface > >however, when there is inheritance like the following > > > >interface foo { > > const string x ="hello"; > >}; > > > >interface bar : foo { > > const string x="goodbye"; > >}; > > > >And code is written as bar.x, there is ambiguity because x exists >both > >from barOperations and foo through fooOperations and hence code is >not > >compilable. > > > >Proposal: > > > >Change section 1.6.1 to read: > >Constants declared within an IDL interface are mapped to fields in > >either the Java > >**signature and **operations interfaces for non-abstract or the >sole > >Java interface for abstract (see Section > >1.12, "Mapping for Interface", on page 1-28) corresponding to the >IDL > >interface. > > > >Delete paragraph: > > > >Note that because the signature interface extends the operations > >interface for non-abstract > >IDL interfaces, the constant is available in all the mapped Java > >interfaces. > > > > > >The above change disambiguates the defined constant for uses where >the > >signature interface is referred to. > > > > > >Thanks, > >Vijay