According to the code below, could you please tell me how (and if it possible to) refer to the array defined inside the class ComputationUnit from the class Service?
class ComputationUnit {
contains Method[1..*] methods
}
class Method {
String name
String signature
Object sourceCode
contains Parameter[1..*] parameters
}
class Servic e {
contains Comment comment
contains Parameter[1..*] parameters
contains Contract[0..*] contracts
refers Method[] methods //How can I refer to the array defined inside the ComputationUnit class?
}
You can't. It doesn't make sense. There isn't just one array defined inside the
ComputationUnitclass, there's an array defined inside each instance ofComputationUnit. Which instance do you want?Instead, you should write:
and then access the array as needed from the reference to the unit.