0

I know how to write a package in OCL but what exactly is the meaning of this construct? Why and when do we have to use packages?


As an example for a package in my script they write

package MeetingExample

context Meeting::isConfirmed : Boolean
init: false
context TeamMember:meeting : Set(Meetings)
init: Set{}

endpackage

But what is the difference to if I write only

context Meeting::isConfirmed : Boolean
init: false
context TeamMember:meeting : Set(Meetings)
init: Set{}
stg
  • 2,757
  • 2
  • 28
  • 55

1 Answers1

0

According to the complete tutorial:

"A package context declaration may bracket declarations that complement model elements within the complemented package."

"The classifier context is terminated by a context or an endpackage."

The sense of these packages is the same as of namespaces:

  • For make it possible to use some very useful name (index, name, parent, children,...) several times in the same project. That could be extremely important when you are joining some large pieces of code.

  • Another, secondary sense is to organize elements in groups.

Gangnus
  • 24,044
  • 16
  • 90
  • 149