MathewWi / umple

Automatically exported from code.google.com/p/umple
0 stars 0 forks source link

The ability to to declare one *end* of an association as immutable #647

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In the following

class Passenger {
  name;
}

class Booking {
  * -- 1 Passenger;
  * -- 1 Flight;
  seat;
}

class Passenger {
  id;
}

If I instead say

  immutable * -- 1 Passenger;

Then I get the error. Immutability means I can't change the passenger of a 
booking, nor the booking set of a passenger, which is wrong.

what I want to be able to do is to declare one *end* of an association as 
immutable. In this case, I want to be able to say that a passenger can't be 
changed in a booking but I can still change the bookings of a passenger, by 
adding new bookings.

So perhaps what is needed here is to be able to say

  * -- 1 immutable Passenger;

to limit immutability to just that end.

For completeness,

  * immutable -- 1 immutable Passenger;

  would mean the same thing as the original.

This would require allowing the word immutable to follow the multiplicities in 
these contexts.

Original issue reported on code.google.com by EmailMarkGalloway@gmail.com on 19 Oct 2014 at 4:20

GoogleCodeExporter commented 9 years ago

Original comment by TimothyCLethbridge on 7 Nov 2014 at 10:47

GoogleCodeExporter commented 9 years ago

Original comment by EmailMarkGalloway@gmail.com on 3 Dec 2014 at 10:47

GoogleCodeExporter commented 9 years ago

Original comment by EmailMarkGalloway@gmail.com on 3 Dec 2014 at 10:49