Book a Demo

Author Topic: Meaning of scope inn attributes definition  (Read 3730 times)

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Meaning of scope inn attributes definition
« on: January 15, 2013, 10:53:25 am »
When defining an attribute you can "Define the attribute as Public, Protected, Private or Package. "

Can someone please point me to a good definition of 'protected' and 'package'

tia

PS or confirm it is based on Controlling Access to Members of a Class
Also helpful was http://en.wikipedia.org/wiki/Class_diagram
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Meaning of scope inn attributes definition
« Reply #1 on: January 15, 2013, 11:01:37 am »
The UML spec says (UML 2.4.1 Superstructure, section 7.3.56 VisibilityKind):

Quote
  • A public element is visible to all elements that can access the contents of the namespace that owns it.
  • A private element is only visible inside the namespace that owns it.
  • A protected element is visible to elements that have a generalization relationship to the namespace that owns it.
  • A package element is owned by a namespace that is not a package, and is visible to elements that are in the same package as its owning namespace. Only named elements that are not owned by packages can be marked as having package visibility. Any element marked as having package visibility is visible to all elements within the nearest enclosing package (given that other owning elements have proper visibility). Outside the nearest enclosing package, an element marked as having package visibility is not visible.
The Sparx Team
[email protected]

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Meaning of scope inn attributes definition
« Reply #2 on: January 15, 2013, 12:59:17 pm »
Thankyou
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.