Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for cloneable #142

Open
Nava2 opened this issue Aug 26, 2015 · 4 comments
Open

Support for cloneable #142

Nava2 opened this issue Aug 26, 2015 · 4 comments
Labels
cloneable Component-SyntaxAndParsing Related to the Umple grammar and the parser that builds the abstract syntax tree and analyses models Diffic-Hard Likely not obvious how to fix or reproduce it and may take many weeks by an experienced person interfaces patterns Priority-VLow This is likely a cosmetic issue or a long-range low-impact wishlist item Status-Accepted ucosp Suitable for 4th year capstone projects

Comments

@Nava2
Copy link
Contributor

Nava2 commented Aug 26, 2015

Originally reported on Google Code with ID 242


We should consider allowing a class in umple to be tagged as

cloneable;

This would generate 'implements clone able' in java, and, more importantly would implement
the clone method directly (or standard copying syntax in other languages).

This would be very straight-forward in classes that don't have associations, or where
there is an incoming unidirectional association. In such cases just the attributes
would need cloning.

The main use case would be to duplicate an object and then change it (using a set method)
so that it is just a little different from the original. This is a bit like the concept
of the exemplar. See the 'self' programming language.

Where there are other kinds of associations, this becomes intrinsically tricky. In
many cases, there would have to be a semantic error raised.

For example

class A {}
class B {
cloneable;
1-- * A;
}

would be illogical, since duplicating the B would force the A to then have two attached
B's which violates the multiplicity.

Cloning an entirely immutable object would also be somewhat illogical, since then you
would have two objects with no way to tell them apart. However it would be useful to
create the ability to clone such an object in all respects except for certain attributes,
which would be given different values. For example to move a complex graphical shape
to a new origin (clone, but change the origin).


Reported by @umple on 2011-10-19 20:10:21

@Nava2
Copy link
Contributor Author

Nava2 commented Aug 26, 2015

Reported by @umple on 2012-09-27 20:07:07

  • Owner removed
  • Labels added: Priority-VLow
  • Labels removed: Priority-Low

@Nava2
Copy link
Contributor Author

Nava2 commented Aug 26, 2015

Reported by @umple on 2013-09-12 15:07:40

  • Labels added: ucosp

@Nava2 Nava2 added Status-Accepted Type-ProjectUG Particularly suitable and right-sized for undergraduate student projects Priority-VLow This is likely a cosmetic issue or a long-range low-impact wishlist item Component-SyntaxAndParsing Related to the Umple grammar and the parser that builds the abstract syntax tree and analyses models ucosp Suitable for 4th year capstone projects Diffic-Hard Likely not obvious how to fix or reproduce it and may take many weeks by an experienced person patterns interfaces cloneable labels Aug 26, 2015
@Nava2
Copy link
Contributor Author

Nava2 commented Aug 26, 2015

Reported by @umple on 2013-09-17 13:30:26

  • Status changed: Accepted
  • Labels added: Type-ProjectUG
  • Labels removed: Type-Enhancement

@Nava2
Copy link
Contributor Author

Nava2 commented Aug 26, 2015

Reported by @umple on 2014-09-05 15:00:37

  • Labels added: Diffic-Hard

@TimLethbridge TimLethbridge removed the Type-ProjectUG Particularly suitable and right-sized for undergraduate student projects label Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloneable Component-SyntaxAndParsing Related to the Umple grammar and the parser that builds the abstract syntax tree and analyses models Diffic-Hard Likely not obvious how to fix or reproduce it and may take many weeks by an experienced person interfaces patterns Priority-VLow This is likely a cosmetic issue or a long-range low-impact wishlist item Status-Accepted ucosp Suitable for 4th year capstone projects
Projects
None yet
Development

No branches or pull requests

2 participants