Object Constraint Language and Inheritance
- From: "Ulrich Frank" <franku@xxxxxxxxxxxxxxxxx>
- Date: 29 Mar 2006 06:52:01 -0800
Hallo NG,
I've a problem to express a constraint in OCL. I have already googled
and read in several papers but found no solution which satisfy me.
Perhaps you can help me.
Namely I have an UML class diagram with an inheritance hierarchie. The
root class is RootClass. For another class, say A, I want to express,
that it is not allowed to have subclasses. My first approach was to use
the ocl method allSupertypes() to forbid subclasses, but in that case I
would have to write it in every class which means I would have to place
it in the RootClass and from there it would be inherited to all other
classes.
context RootClass
inv: self.allSupertypes() -> forAll(s | s <> A)
Is this right or is there a better way? there is no construct like
allSubclasses(), right?!
Regards,
Uli
.
- Follow-Ups:
- Re: Object Constraint Language and Inheritance
- From: Juergen Wuest
- Re: Object Constraint Language and Inheritance
- From: H. S. Lahman
- Re: Object Constraint Language and Inheritance
- From: Achim D. Brucker
- Re: Object Constraint Language and Inheritance
- Prev by Date: Final Call for Papers: IMECS 2006 (the multiconference of 14 engineering & computer science conferences)
- Next by Date: Re: Object Constraint Language and Inheritance
- Previous by thread: Final Call for Papers: IMECS 2006 (the multiconference of 14 engineering & computer science conferences)
- Next by thread: Re: Object Constraint Language and Inheritance
- Index(es):