Issue 8982: Circular imports (ocl2-rtf) Source: NIST (Dr. Conrad Bock, conrad.bock(at)nist.gov) Nature: Uncategorized Issue Severity: Summary: Are two packages allowed to mutually import each other? I can't find anything preventing this in the spec, but was wondering if it causes some kind of "infinite" import loop. Resolution: Revised Text: Actions taken: August 27, 2005: received issue October 16, 2009: closed issue Discussion: This is a UML issue that has is already solved. In principle an implementation can avoid infinite import loop even in presence of cycles. Disposition: Close, no change End of Annotations:===== eply-To: From: "Conrad Bock" To: "uml2rtf" Cc: "Evan Wallace" Subject: Circular imports Date: Sat, 27 Aug 2005 11:38:54 -0400 X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) RTFers, Are two packages allowed to mutually import each other? I can't find anything preventing this in the spec, but was wondering if it causes some kind of "infinite" import loop. Conrad To: Cc: "Evan Wallace" , "uml2rtf" Subject: Re: Circular imports X-Mailer: Lotus Notes Release 6.0.1CF1 March 04, 2003 From: Branislav Selic Date: Mon, 29 Aug 2005 08:27:59 -0400 X-MIMETrack: Serialize by Router on D25ML01/25/M/IBM(Release 6.5.4|March 27, 2005) at 08/29/2005 08:28:01, Serialize complete at 08/29/2005 08:28:01 Good point. Please raise an issue, Conrad. In the definition of package merge, circular merges are explicilty prevented. The same should be done for imports. This should probably extend to element import as well. Bran "Conrad Bock" 08/27/2005 11:38 AM Please respond to conrad.bock To "uml2rtf" cc "Evan Wallace" Subject Circular imports RTFers, Are two packages allowed to mutually import each other? I can't find anything preventing this in the spec, but was wondering if it causes some kind of "infinite" import loop. Conrad To: Branislav Selic Cc: conrad.bock@nist.gov, "Evan Wallace" , "uml2rtf" Subject: Re: Circular imports X-Mailer: Lotus Notes Release 6.0.1CF1 March 04, 2003 From: Kenneth Hussey Date: Mon, 29 Aug 2005 09:20:47 -0400 X-MIMETrack: Serialize by Router on D25ML03/25/M/IBM(Release 6.5.4|March 27, 2005) at 08/29/2005 09:20:52, Serialize complete at 08/29/2005 09:20:52 Bran, I'm not so sure about this... import cycles occur quite commonly in programming languages like Java. A restriction like this would limit the ability to model such code using UML... Cheers, Kenn Hussey Eclipse UML2 Project Lead Rational Software, IBM Software Group 770 Palladium Drive Kanata, Ontario, K2V 1C8 T: (613) 599-3980 F: (613) 599-3912 Branislav Selic/Ottawa/IBM@IBMCA 08/29/2005 08:27 AM To cc "Evan Wallace" , "uml2rtf" Subject Re: Circular imports Good point. Please raise an issue, Conrad. In the definition of package merge, circular merges are explicilty prevented. The same should be done for imports. This should probably extend to element import as well. Bran "Conrad Bock" 08/27/2005 11:38 AM Please respond to conrad.bock To "uml2rtf" cc "Evan Wallace" Subject Circular imports RTFers, Are two packages allowed to mutually import each other? I can't find anything preventing this in the spec, but was wondering if it causes some kind of "infinite" import loop. Conrad Reply-To: From: "Desfray" To: "'Branislav Selic'" , Cc: "'Evan Wallace'" , "'uml2rtf'" Subject: RE: Circular imports Date: Mon, 29 Aug 2005 15:29:30 +0200 X-Mailer: Microsoft Outlook CWS, Build 9.0.6604 (9.0.2911.0) X-Virus-Scanned: by amavisd-new at softeam.com I am not 100% sure that we should insert such strict rule in the spec. In the generalization or package merge case, it is mechanically forbidden to introduce circular dependency. Circular import is frequently used. For example, if you reverse engineer existing applications, you may be surprised how many you may get. Obviously, it is a good modeling practice that shall be encouraged, but it is not something forbidden "by construction or semantics", as having association without an end or an initial state with an entry transition. I beleive that there is room for "model checkers" that help getting a clean model, but that the spec is not an appropriate place. ==================================== Philippe Desfray VP for R&D - SOFTEAM Tel: (33) 01 53968400 Fax: (33) 01 53968401 144 Av. des champs Elysées 75008 PARIS www.softeam.com www.objecteering.com -----Message d'origine----- De : Branislav Selic [mailto:bselic@ca.ibm.com] Envoyé : lundi 29 août 2005 14:28 À : conrad.bock@nist.gov Cc : Evan Wallace; uml2rtf Objet : Re: Circular imports Good point. Please raise an issue, Conrad. In the definition of package merge, circular merges are explicilty prevented. The same should be done for imports. This should probably extend to element import as well. Bran "Conrad Bock" 08/27/2005 11:38 AM Please respond to conrad.bock To "uml2rtf" cc "Evan Wallace" Subject Circular imports RTFers, Are two packages allowed to mutually import each other? I can't find anything preventing this in the spec, but was wondering if it causes some kind of "infinite" import loop. Conrad Subject: RE: Circular imports Date: Mon, 29 Aug 2005 07:03:35 -0700 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Circular imports Thread-Index: AcWslVTI2mYT2PlRTwK+XWFsyM2S0wAC+F3w From: "Pete Rivett" To: "Branislav Selic" , Cc: "Evan Wallace" , "uml2rtf" I'm not sure it is a problem to have circular imports (where A imports B and B imports A). I believe most programming languages allow it, as does XML Schema. I know that MOF 1.x disallowed it - but that was due to a the old version of CORBA used at the time. It might not be good practice but I do not think it should be generally prohibited. Pete -------------------------------------------------------------------------------- From: Branislav Selic [mailto:bselic@ca.ibm.com] Sent: Monday, August 29, 2005 1:28 PM To: conrad.bock@nist.gov Cc: Evan Wallace; uml2rtf Subject: Re: Circular imports Good point. Please raise an issue, Conrad. In the definition of package merge, circular merges are explicilty prevented. The same should be done for imports. This should probably extend to element import as well. Bran "Conrad Bock" 08/27/2005 11:38 AM Please respond to conrad.bock To "uml2rtf" cc "Evan Wallace" Subject Circular imports RTFers, Are two packages allowed to mutually import each other? I can't find anything preventing this in the spec, but was wondering if it causes some kind of "infinite" import loop. Conrad To: "Pete Rivett" Cc: conrad.bock@nist.gov, "Evan Wallace" , "uml2rtf" Subject: RE: Circular imports X-Mailer: Lotus Notes Release 6.0.1CF1 March 04, 2003 From: Branislav Selic Date: Mon, 29 Aug 2005 10:25:13 -0400 X-MIMETrack: Serialize by Router on D25ML01/25/M/IBM(Release 6.5.4|March 27, 2005) at 08/29/2005 10:25:14, Serialize complete at 08/29/2005 10:25:14 I stand corrected by Pete, Kenn, and Philippe. We must retain the ability to model programs written with standard programming languages with UML 2.0 (no matter how sloppy they are). Ergo, we should not impose any restrictions on circular imports. Bran "Pete Rivett" 08/29/2005 10:03 AM To Branislav Selic/Ottawa/IBM@IBMCA, cc "Evan Wallace" , "uml2rtf" Subject RE: Circular imports I'm not sure it is a problem to have circular imports (where A imports B and B imports A). I believe most programming languages allow it, as does XML Schema. I know that MOF 1.x disallowed it - but that was due to a the old version of CORBA used at the time. It might not be good practice but I do not think it should be generally prohibited. Pete -------------------------------------------------------------------------------- From: Branislav Selic [mailto:bselic@ca.ibm.com] Sent: Monday, August 29, 2005 1:28 PM To: conrad.bock@nist.gov Cc: Evan Wallace; uml2rtf Subject: Re: Circular imports Good point. Please raise an issue, Conrad. In the definition of package merge, circular merges are explicilty prevented. The same should be done for imports. This should probably extend to element import as well. Bran "Conrad Bock" 08/27/2005 11:38 AM Please respond to conrad.bock To "uml2rtf" cc "Evan Wallace" Subject Circular imports RTFers, Are two packages allowed to mutually import each other? I can't find anything preventing this in the spec, but was wondering if it causes some kind of "infinite" import loop. Conrad To: Branislav Selic Cc: conrad.bock@nist.gov, "Evan Wallace" , "Pete Rivett" , "uml2rtf" Subject: RE: Circular imports X-Mailer: Lotus Notes Release 6.5 September 18, 2003 From: "Richard Vermillion" Date: Mon, 29 Aug 2005 10:43:31 -0400 X-MIMETrack: Serialize by Router on notes.ny.cyberdialogue.com/CyberDialogue(Release 5.0.12 |February 13, 2003) at 08/29/2005 10:43:44 AM, Serialize complete at 08/29/2005 10:43:44 AM This does beg the question of whether the current OCL for importedMember correctly handles circular imports without "infinite" loops -- if there's no constraint against it, we should be sure that it works. The current OCL looks like it will fail if the packages are imported with public visibility. It doesn't look like there's an easy fix without introducing more operations (although I could be wrong here). If the PackageImport is private then the package's members won't be propagated through the visibleMembers() query. Perhaps there needs to be a constraint that says that circular imports can't be public? -rv Richard Vermillion Fulcrum Analytics, Inc. Branislav Selic 08/29/05 10:25 AM To: "Pete Rivett" cc: conrad.bock@nist.gov, "Evan Wallace" , "uml2rtf" Subject: RE: Circular imports I stand corrected by Pete, Kenn, and Philippe. We must retain the ability to model programs written with standard programming languages with UML 2.0 (no matter how sloppy they are). Ergo, we should not impose any restrictions on circular imports. Bran "Pete Rivett" 08/29/2005 10:03 AM To Branislav Selic/Ottawa/IBM@IBMCA, cc "Evan Wallace" , "uml2rtf" Subject RE: Circular imports I'm not sure it is a problem to have circular imports (where A imports B and B imports A). I believe most programming languages allow it, as does XML Schema. I know that MOF 1.x disallowed it - but that was due to a the old version of CORBA used at the time. It might not be good practice but I do not think it should be generally prohibited. Pete -------------------------------------------------------------------------------- From: Branislav Selic [mailto:bselic@ca.ibm.com] Sent: Monday, August 29, 2005 1:28 PM To: conrad.bock@nist.gov Cc: Evan Wallace; uml2rtf Subject: Re: Circular imports Good point. Please raise an issue, Conrad. In the definition of package merge, circular merges are explicilty prevented. The same should be done for imports. This should probably extend to element import as well. Bran "Conrad Bock" 08/27/2005 11:38 AM Please respond to conrad.bock To "uml2rtf" cc "Evan Wallace" Subject Circular imports RTFers, Are two packages allowed to mutually import each other? I can't find anything preventing this in the spec, but was wondering if it causes some kind of "infinite" import loop. Conrad Reply-To: From: "Conrad Bock" To: "Richard Vermillion" , "Branislav Selic" Cc: "Evan Wallace" , "Pete Rivett" , "uml2rtf" Subject: RE: Circular imports Date: Mon, 29 Aug 2005 16:17:23 -0400 X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) > This does beg the question of whether the current OCL for > importedMember correctly handles circular imports without > "infinite" loops -- if there's no constraint against it, we > should be sure that it works. Would depend on the detailed semantics of OCL. Since it is declarative, it might be possible for it work. It uses asSet and union, so would eliminate duplicates. > The current OCL looks like it will fail if the packages are > imported with public visibility. It doesn't look like there's > an easy fix without introducing more operations (although I > could be wrong here). > > If the PackageImport is private then the package's members won't > be propagated through the visibleMembers() query. > > Perhaps there needs to be a constraint that says that circular > imports can't be public? Given the dicussion, the issue to be filed is to check that the OCL handles circular import, and change it if it doesn't. Conrad To: Cc: Branislav Selic , "Evan Wallace" , "Pete Rivett" , "Richard Vermillion" , "uml2rtf" Subject: RE: Circular imports X-Mailer: Lotus Notes Release 6.0.1CF1 March 04, 2003 From: Kenneth Hussey Date: Tue, 30 Aug 2005 08:45:10 -0400 X-MIMETrack: Serialize by Router on D25ML03/25/M/IBM(Release 6.5.4|March 27, 2005) at 08/30/2005 08:44:59, Serialize complete at 08/30/2005 08:44:59 Note that there are several constraints in the specification that result in infinite recursion if interpreted literally. If we're going to file an issue, perhaps it would be to check for such recursion in all constraints. Cheers, Kenn Hussey Eclipse UML2 Project Lead Rational Software, IBM Software Group 770 Palladium Drive Kanata, Ontario, K2V 1C8 T: (613) 599-3980 F: (613) 599-3912 "Conrad Bock" 08/29/2005 04:17 PM Please respond to conrad.bock To "Richard Vermillion" , Branislav Selic/Ottawa/IBM@IBMCA cc "Evan Wallace" , "Pete Rivett" , "uml2rtf" Subject RE: Circular imports > This does beg the question of whether the current OCL for > importedMember correctly handles circular imports without > "infinite" loops -- if there's no constraint against it, we > should be sure that it works. Would depend on the detailed semantics of OCL. Since it is declarative, it might be possible for it work. It uses asSet and union, so would eliminate duplicates. > The current OCL looks like it will fail if the packages are > imported with public visibility. It doesn't look like there's > an easy fix without introducing more operations (although I > could be wrong here). > > If the PackageImport is private then the package's members won't > be propagated through the visibleMembers() query. > > Perhaps there needs to be a constraint that says that circular > imports can't be public? Given the dicussion, the issue to be filed is to check that the OCL handles circular import, and change it if it doesn't. Conrad To: Cc: "Evan Wallace" , "Pete Rivett" , "Richard Vermillion" , "uml2rtf" Subject: RE: Circular imports X-Mailer: Lotus Notes Release 6.0.1CF1 March 04, 2003 From: Branislav Selic Date: Tue, 30 Aug 2005 09:25:02 -0400 X-MIMETrack: Serialize by Router on D25ML01/25/M/IBM(Release 6.5.4|March 27, 2005) at 08/30/2005 09:25:02, Serialize complete at 08/30/2005 09:25:02 > Given the dicussion, the issue to be filed is to check that the OCL > handles circular import, and change it if it doesn't. And, to be sure, the issue should be filed against the OCL FTF and not against UML 2. Bran