Issue 15248: Initialization of complex fields (uml2-rtf) Source: Change Vision (Mr. Michael Jesse Chonoles, mjchonoles(at)yahoo.com) Nature: Uncategorized Issue Severity: Summary: Is there a standard UML way of initializing complex fields. Several examples below A: Integer (3,2) = (1,2,3,4,5,6) A: Integer (3,2) = ((1,2,3), (4,5,6)) A: Integer (3,2) = ((1,2), (3,4), (5,6)) And are they all the same? A: Integer (2,3) = (1,2,3,4,5,6) A: Integer (2,3) = ((1,2,3), (4,5,6)) A: Integer (2,3) = ((1,2), (3,4), (5,6)) And are these the same? And what’s the difference. And here another set Measurement (a Type) Value: Real Unit : String Experiment:Measurement(3) = (1.0, “ft”, 2.0,”ft”,3,”ft”) = ((1.0,”ft”), (2.0,”ft”), (3,”ft”)) Experiment:Measurement(3,2)) = (1.0, “ft”, 2.0,”ft”,3,”ft”, 4,”ft”, 5,”ft”,6,”ft”) ((1.0,”ft”), (2.0,”ft”), (3,”ft”), (4,”ft”), (5,”ft”), (6,”ft”)) (((1.0,”ft”), (2.0,”ft”), (3,”ft”)), ((4.0,”ft”), (5.0,”ft”), (6,”ft”))) My preferences are for the last one above (the one with the extra set of parenthesis), because is better support composition e.g. NullResults:Measurement = (0.0,”ft”) StartingResults:Measurement(3) = (NullResults, NullResults, NullResults) Experiment:Measurement(3,2) = (StartingResults, ((4.0,”ft”),(5.0,”ft”),(6.0,”ft”))) The UML spec is silent about the correct way of doing this. I’d like to have a language independent way of doing this. Resolution: Revised Text: Actions taken: April 6, 2010: received issue Discussion: End of Annotations:===== te: Tue, 06 Apr 2010 16:10:37 -0400 From: "Chonoles, Michael J" Subject: Initialization of complex fields To: Bran Selic Cc: "uml2-rtf@omg.org" , "sysml-rtf@omg.org" , "Watson, John" Thread-Topic: Initialization of complex fields Thread-Index: AcrVshN5z5u5wtxDRvycjX/oJIiJqAAEHWSQ Accept-Language: en-US acceptlanguage: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Is there a standard UML way of initializing complex fields. Several examples below A: Integer (3,2) = (1,2,3,4,5,6) A: Integer (3,2) = ((1,2,3), (4,5,6)) A: Integer (3,2) = ((1,2), (3,4), (5,6)) And are they all the same? A: Integer (2,3) = (1,2,3,4,5,6) A: Integer (2,3) = ((1,2,3), (4,5,6)) A: Integer (2,3) = ((1,2), (3,4), (5,6)) And are these the same? And what.s the difference. And here another set Measurement (a Type) Value: Real Unit : String Experiment:Measurement(3) = (1.0, .ft., 2.0,.ft.,3,.ft.) = ((1.0,.ft.), (2.0,.ft.), (3,.ft.)) Experiment:Measurement(3,2)) = (1.0, .ft., 2.0,.ft.,3,.ft., 4,.ft., 5,.ft.,6,.ft.) ((1.0,.ft.), (2.0,.ft.), (3,.ft.), (4,.ft.), (5,.ft.), (6,.ft.)) (((1.0,.ft.), (2.0,.ft.), (3,.ft.)), ((4.0,.ft.), (5.0,.ft.), (6,.ft.))) My preferences are for the last one above (the one with the extra set of parenthesis), because is better support composition e.g. NullResults:Measurement = (0.0,.ft.) StartingResults:Measurement(3) = (NullResults, NullResults, NullResults) Experiment:Measurement(3,2) = (StartingResults, ((4.0,.ft.),(5.0,.ft.),(6.0,.ft.))) The UML spec is silent about the correct way of doing this. I.d like to have a language independent way of doing this. Thanks Michael Jesse Chonoles LMCO From: bran.selic@gmail.com [mailto:bran.selic@gmail.com] On Behalf Of Bran Selic Sent: Tuesday, April 06, 2010 1:51 PM To: Nerijus Jankevicius Cc: uml2-rtf@omg.org Subject: Re: composite tags Good question, Narijus. I hadn't thought of it before. However, once we opened the door for adding meta-associations in a profile, I see no reason to exclude this possibility (at least not on first analysis). Can you explain the reason why you folks thought it should not be possible? Cheers...Bran 2010/4/6 Nerijus Jankevicius Anyone can help on subject? Are composite tag definitions allowed? See attached document with problem statement. Thanks in advance, -- Nerijus Jankevicius SysML Product Manager OMG-Certified UML Professional No Magic Europe Savanoriu pr. 363, LT 49425 Kaunas, Lithuania P.O. box 2166, LT- 3000, Kaunas Phone: +370-37-324032 Fax: +370-37-320670 e-mail: nerijus@magicdraw.com WWW: http://www.magicdraw.com -- MagicDraw - Architecture made simple! Subject: RE: Initialization of complex fields Date: Tue, 6 Apr 2010 17:53:27 -0400 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Initialization of complex fields thread-index: AcrVshN5z5u5wtxDRvycjX/oJIiJqAAEHWSQAAL4P5A= From: "Ed Seidewitz" To: "Chonoles, Michael J" , "Bran Selic" Cc: , , "Watson, John" Michael . I think you answered your own question. At the end of your message you say .The UML spec is silent about the correct way of doing this.. Perhaps you didn.t mean this to apply to everything in your message, but it does . which, of course, means that the answer to your initial question is .No, there is no standard UML way of initializing complex fields.. Indeed, if you mean by .Integer (3,2). to specify a two dimensional array, then this isn.t standard either. Multiplicities only give you the equivalent of one dimensional arrays (that don.t nest). However, you will be able to notate most of your examples using the new Alf action language notation, which can be used to express default value expressions and also will provide a basic collection class library. As it stands, though, some of the notation may still be a bit cumbersome for some of your examples. We probably should work on this as we finalize the submission. If I understand your examples correctly, here is how the final three would be notated in Alf: NullResults: Measurement = new Measurement(0.0, .ft.) StartingResults: List = new List(NullResults, NullResults, NullResults) Experiment: List> = new List>( StartingResults, new List(new Measurement(4.0, .ft.), new Measurement(5.0, .ft.), new Measurement(6.0,.ft.)) ) If we could incorporate a more general tuple notation into Alf, along with the kind of type inference it already has to some extent, we might be able to simplify this to something more like what you were looking for: NullResults: Measurement = (0.0, .ft.) StartingResults: List = (NullResults, NullResults, NullResults) Experiment: List> = (StartingResults, ((4.0, .ft.), (5.0, .ft.), (6.0,.ft.))) I.ll have to think about that. -- Ed -------------------------------------------------------------------------------- From: Chonoles, Michael J [mailto:michael.j.chonoles@lmco.com] Sent: Tuesday, April 06, 2010 4:11 PM To: Bran Selic Cc: uml2-rtf@omg.org; sysml-rtf@omg.org; Watson, John Subject: Initialization of complex fields Is there a standard UML way of initializing complex fields. Several examples below A: Integer (3,2) = (1,2,3,4,5,6) A: Integer (3,2) = ((1,2,3), (4,5,6)) A: Integer (3,2) = ((1,2), (3,4), (5,6)) And are they all the same? A: Integer (2,3) = (1,2,3,4,5,6) A: Integer (2,3) = ((1,2,3), (4,5,6)) A: Integer (2,3) = ((1,2), (3,4), (5,6)) And are these the same? And what.s the difference. And here another set Measurement (a Type) Value: Real Unit : String Experiment:Measurement(3) = (1.0, .ft., 2.0,.ft.,3,.ft.) = ((1.0,.ft.), (2.0,.ft.), (3,.ft.)) Experiment:Measurement(3,2)) = (1.0, .ft., 2.0,.ft.,3,.ft., 4,.ft., 5,.ft.,6,.ft.) ((1.0,.ft.), (2.0,.ft.), (3,.ft.), (4,.ft.), (5,.ft.), (6,.ft.)) (((1.0,.ft.), (2.0,.ft.), (3,.ft.)), ((4.0,.ft.), (5.0,.ft.), (6,.ft.))) My preferences are for the last one above (the one with the extra set of parenthesis), because is better support composition e.g. NullResults:Measurement = (0.0,.ft.) StartingResults:Measurement(3) = (NullResults, NullResults, NullResults) Experiment:Measurement(3,2) = (StartingResults, ((4.0,.ft.),(5.0,.ft.),(6.0,.ft.))) The UML spec is silent about the correct way of doing this. I.d like to have a language independent way of doing this. Thanks Michael Jesse Chonoles LMCO From: bran.selic@gmail.com [mailto:bran.selic@gmail.com] On Behalf Of Bran Selic Sent: Tuesday, April 06, 2010 1:51 PM To: Nerijus Jankevicius Cc: uml2-rtf@omg.org Subject: Re: composite tags Good question, Narijus. I hadn't thought of it before. However, once we opened the door for adding meta-associations in a profile, I see no reason to exclude this possibility (at least not on first analysis). Can you explain the reason why you folks thought it should not be possible? Cheers...Bran 2010/4/6 Nerijus Jankevicius Anyone can help on subject? Are composite tag definitions allowed? See attached document with problem statement. Thanks in advance, -- Nerijus Jankevicius SysML Product Manager OMG-Certified UML Professional No Magic Europe Savanoriu pr. 363, LT 49425 Kaunas, Lithuania P.O. box 2166, LT- 3000, Kaunas Phone: +370-37-324032 Fax: +370-37-320670 e-mail: nerijus@magicdraw.com WWW: http://www.magicdraw.com -- MagicDraw - Architecture made simple! Date: Tue, 06 Apr 2010 19:43:51 -0400 From: "Chonoles, Michael J" Subject: RE: Initialization of complex fields To: Ed Seidewitz , Bran Selic , "Friedenthal, Sanford" Cc: "uml2-rtf@omg.org" , "sysml-rtf@omg.org" , "Watson, John" Thread-Topic: Initialization of complex fields Thread-Index: AcrVshN5z5u5wtxDRvycjX/oJIiJqAAEHWSQAAL4P5AABNMaYA== Accept-Language: en-US acceptlanguage: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: I.m afraid you.re right. But anything like the Alf will also need to fix the UML spec which talks about arrays in the higher-level activity diagrams. In addition there is a size attribute in one the examples (figure 7.28) that is +size: Array = (100, 100) which appears to mean nothing. In addition, while I greatly like your last suggested solution, there.s a big problem with using List and any basic collection class library. We need this solution in SysML as well as UML, and for the basic purposes of initializing arrays (e.g., of constants), the System Engineers should not need (nor will want) to be thinking about things like .List., .new., etc. The System Engineers are System Engineers because they don.t want to do programming. If you need, we can talk about this more. Thanks Michael From: Ed Seidewitz [mailto:ed-s@modeldriven.com] Sent: Tuesday, April 06, 2010 5:53 PM To: Chonoles, Michael J; Bran Selic Cc: uml2-rtf@omg.org; sysml-rtf@omg.org; Watson, John Subject: RE: Initialization of complex fields Michael . I think you answered your own question. At the end of your message you say .The UML spec is silent about the correct way of doing this.. Perhaps you didn.t mean this to apply to everything in your message, but it does . which, of course, means that the answer to your initial question is .No, there is no standard UML way of initializing complex fields.. Indeed, if you mean by .Integer (3,2). to specify a two dimensional array, then this isn.t standard either. Multiplicities only give you the equivalent of one dimensional arrays (that don.t nest). However, you will be able to notate most of your examples using the new Alf action language notation, which can be used to express default value expressions and also will provide a basic collection class library. As it stands, though, some of the notation may still be a bit cumbersome for some of your examples. We probably should work on this as we finalize the submission. If I understand your examples correctly, here is how the final three would be notated in Alf: NullResults: Measurement = new Measurement(0.0, .ft.) StartingResults: List = new List(NullResults, NullResults, NullResults) Experiment: List> = new List>( StartingResults, new List(new Measurement(4.0, .ft.), new Measurement(5.0, .ft.), new Measurement(6.0,.ft.)) ) If we could incorporate a more general tuple notation into Alf, along with the kind of type inference it already has to some extent, we might be able to simplify this to something more like what you were looking for: NullResults: Measurement = (0.0, .ft.) StartingResults: List = (NullResults, NullResults, NullResults) Experiment: List> = (StartingResults, ((4.0, .ft.), (5.0, .ft.), (6.0,.ft.))) I.ll have to think about that. -- Ed -------------------------------------------------------------------------------- From: Chonoles, Michael J [mailto:michael.j.chonoles@lmco.com] Sent: Tuesday, April 06, 2010 4:11 PM To: Bran Selic Cc: uml2-rtf@omg.org; sysml-rtf@omg.org; Watson, John Subject: Initialization of complex fields Is there a standard UML way of initializing complex fields. Several examples below A: Integer (3,2) = (1,2,3,4,5,6) A: Integer (3,2) = ((1,2,3), (4,5,6)) A: Integer (3,2) = ((1,2), (3,4), (5,6)) And are they all the same? A: Integer (2,3) = (1,2,3,4,5,6) A: Integer (2,3) = ((1,2,3), (4,5,6)) A: Integer (2,3) = ((1,2), (3,4), (5,6)) And are these the same? And what.s the difference. And here another set Measurement (a Type) Value: Real Unit : String Experiment:Measurement(3) = (1.0, .ft., 2.0,.ft.,3,.ft.) = ((1.0,.ft.), (2.0,.ft.), (3,.ft.)) Experiment:Measurement(3,2)) = (1.0, .ft., 2.0,.ft.,3,.ft., 4,.ft., 5,.ft.,6,.ft.) ((1.0,.ft.), (2.0,.ft.), (3,.ft.), (4,.ft.), (5,.ft.), (6,.ft.)) (((1.0,.ft.), (2.0,.ft.), (3,.ft.)), ((4.0,.ft.), (5.0,.ft.), (6,.ft.))) My preferences are for the last one above (the one with the extra set of parenthesis), because is better support composition e.g. NullResults:Measurement = (0.0,.ft.) StartingResults:Measurement(3) = (NullResults, NullResults, NullResults) Experiment:Measurement(3,2) = (StartingResults, ((4.0,.ft.),(5.0,.ft.),(6.0,.ft.))) The UML spec is silent about the correct way of doing this. I.d like to have a language independent way of doing this. Thanks Michael Jesse Chonoles LMCO From: bran.selic@gmail.com [mailto:bran.selic@gmail.com] On Behalf Of Bran Selic Sent: Tuesday, April 06, 2010 1:51 PM To: Nerijus Jankevicius Cc: uml2-rtf@omg.org Subject: Re: composite tags Good question, Narijus. I hadn't thought of it before. However, once we opened the door for adding meta-associations in a profile, I see no reason to exclude this possibility (at least not on first analysis). Can you explain the reason why you folks thought it should not be possible? Cheers...Bran 2010/4/6 Nerijus Jankevicius Anyone can help on subject? Are composite tag definitions allowed? See attached document with problem statement. Thanks in advance, -- Nerijus Jankevicius SysML Product Manager OMG-Certified UML Professional No Magic Europe Savanoriu pr. 363, LT 49425 Kaunas, Lithuania P.O. box 2166, LT- 3000, Kaunas Phone: +370-37-324032 Fax: +370-37-320670 e-mail: nerijus@magicdraw.com WWW: http://www.magicdraw.com -- MagicDraw - Architecture made simple! DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:received:message-id :subject:to:cc:content-type; bh=8glCtoNWeAKfMZL6Y0XCx/jfoUu8Wjfc3sJ0AQuuA1Y=; b=sekixYbL4d+FutU8gzlKMw6fnsbuWmlryD9vmVa/Z0tPBD/SrVYv066HG653huENoR M7kDjZUWbXLyxZQ2VQnyynBUWqYhQK3xq4mUi8xWmoEiApqv7vjkXibfNIct7H/e2l/y 1MNZg5QYxAAS9LaHNJF4lP3ZeuvWQDw4iC9Gk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=gG3Qt7EJCsqEb+zGFiqLXDAnfjRQ65H4lxdzHViorIklglC3HmpwtodJLMv3caDuvB uqZwo8Qe0qQm08Xc6B0urKTIYDD0cMFMll1jyFHfj4V3+MKmqwfZrA7z16NGqZXky/AA 3hJ2y78xMcJyyIbIrduhCxRLFEIJbyljqe5IY= Sender: bran.selic@gmail.com From: Bran Selic Date: Wed, 7 Apr 2010 07:58:20 +0200 X-Google-Sender-Auth: 4839ea50e2f968a0 Subject: Re: Initialization of complex fields To: "Chonoles, Michael J" Cc: Ed Seidewitz , "Friedenthal, Sanford" , "uml2-rtf@omg.org" , "sysml-rtf@omg.org" , "Watson, John" Michael, Please note that MARTE has a very flexible language, called VSL, which can be used for this purpose. Furthermore, it is an OMG standard. Cheers...Bran On Wed, Apr 7, 2010 at 1:43 AM, Chonoles, Michael J wrote: I.m afraid you.re right. But anything like the Alf will also need to fix the UML spec which talks about arrays in the higher-level activity diagrams. In addition there is a size attribute in one the examples (figure 7.28) that is +size: Array = (100, 100) which appears to mean nothing. In addition, while I greatly like your last suggested solution, there.s a big problem with using List and any basic collection class library. We need this solution in SysML as well as UML, and for the basic purposes of initializing arrays (e.g., of constants), the System Engineers should not need (nor will want) to be thinking about things like .List., .new., etc. The System Engineers are System Engineers because they don.t want to do programming. If you need, we can talk about this more. Thanks Michael From: Ed Seidewitz [mailto:ed-s@modeldriven.com] Sent: Tuesday, April 06, 2010 5:53 PM To: Chonoles, Michael J; Bran Selic Cc: uml2-rtf@omg.org; sysml-rtf@omg.org; Watson, John Subject: RE: Initialization of complex fields Michael . I think you answered your own question. At the end of your message you say .The UML spec is silent about the correct way of doing this.. Perhaps you didn.t mean this to apply to everything in your message, but it does . which, of course, means that the answer to your initial question is .No, there is no standard UML way of initializing complex fields.. Indeed, if you mean by .Integer (3,2). to specify a two dimensional array, then this isn.t standard either. Multiplicities only give you the equivalent of one dimensional arrays (that don.t nest). However, you will be able to notate most of your examples using the new Alf action language notation, which can be used to express default value expressions and also will provide a basic collection class library. As it stands, though, some of the notation may still be a bit cumbersome for some of your examples. We probably should work on this as we finalize the submission. If I understand your examples correctly, here is how the final three would be notated in Alf: NullResults: Measurement = new Measurement(0.0, .ft.) StartingResults: List = new List(NullResults, NullResults, NullResults) Experiment: List> = new List>( StartingResults, new List(new Measurement(4.0, .ft.), new Measurement(5.0, .ft.), new Measurement(6.0,.ft.)) ) If we could incorporate a more general tuple notation into Alf, along with the kind of type inference it already has to some extent, we might be able to simplify this to something more like what you were looking for: NullResults: Measurement = (0.0, .ft.) StartingResults: List = (NullResults, NullResults, NullResults) Experiment: List> = (StartingResults, ((4.0, .ft.), (5.0, .ft.), (6.0,.ft.))) I.ll have to think about that. -- Ed -------------------------------------------------------------------------------- From: Chonoles, Michael J [mailto:michael.j.chonoles@lmco.com] Sent: Tuesday, April 06, 2010 4:11 PM To: Bran Selic Cc: uml2-rtf@omg.org; sysml-rtf@omg.org; Watson, John Subject: Initialization of complex fields Is there a standard UML way of initializing complex fields. Several examples below A: Integer (3,2) = (1,2,3,4,5,6) A: Integer (3,2) = ((1,2,3), (4,5,6)) A: Integer (3,2) = ((1,2), (3,4), (5,6)) And are they all the same? A: Integer (2,3) = (1,2,3,4,5,6) A: Integer (2,3) = ((1,2,3), (4,5,6)) A: Integer (2,3) = ((1,2), (3,4), (5,6)) And are these the same? And what.s the difference. And here another set Measurement (a Type) Value: Real Unit : String Experiment:Measurement(3) = (1.0, .ft., 2.0,.ft.,3,.ft.) = ((1.0,.ft.), (2.0,.ft.), (3,.ft.)) Experiment:Measurement(3,2)) = (1.0, .ft., 2.0,.ft.,3,.ft., 4,.ft., 5,.ft.,6,.ft.) ((1.0,.ft.), (2.0,.ft.), (3,.ft.), (4,.ft.), (5,.ft.), (6,.ft.)) (((1.0,.ft.), (2.0,.ft.), (3,.ft.)), ((4.0,.ft.), (5.0,.ft.), (6,.ft.))) My preferences are for the last one above (the one with the extra set of parenthesis), because is better support composition e.g. NullResults:Measurement = (0.0,.ft.) StartingResults:Measurement(3) = (NullResults, NullResults, NullResults) Experiment:Measurement(3,2) = (StartingResults, ((4.0,.ft.),(5.0,.ft.),(6.0,.ft.))) The UML spec is silent about the correct way of doing this. I.d like to have a language independent way of doing this. Thanks Michael Jesse Chonoles LMCO From: bran.selic@gmail.com [mailto:bran.selic@gmail.com] On Behalf Of Bran Selic Sent: Tuesday, April 06, 2010 1:51 PM To: Nerijus Jankevicius Cc: uml2-rtf@omg.org Subject: Re: composite tags Good question, Narijus. I hadn't thought of it before. However, once we opened the door for adding meta-associations in a profile, I see no reason to exclude this possibility (at least not on first analysis). Can you explain the reason why you folks thought it should not be possible? Cheers...Bran 2010/4/6 Nerijus Jankevicius Anyone can help on subject? Are composite tag definitions allowed? See attached document with problem statement. Thanks in advance, -- Nerijus Jankevicius SysML Product Manager OMG-Certified UML Professional No Magic Europe Savanoriu pr. 363, LT 49425 Kaunas, Lithuania P.O. box 2166, LT- 3000, Kaunas Phone: +370-37-324032 Fax: +370-37-320670 e-mail: nerijus@magicdraw.com WWW: http://www.magicdraw.com -- MagicDraw - Architecture made simple!