Re: Object Constraint Language and Inheritance
- From: "H. S. Lahman" <h.lahman@xxxxxxxxxxx>
- Date: Wed, 29 Mar 2006 17:38:36 GMT
Responding to Frank...
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.
I never use OCL with UML, so I don't know enough about the syntax to help. However, if you do not get an answer here, a better forum to try might be the Yahoo group [umlforum].
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.
Just out of curiosity, what sort of problem context do you have where a constraint of no further subclasses would be needed?
Subclassing is a static structure so one either needs the specialization or not to solve the problem in hand. I would think such a constraint can only affect future maintenance to the application. But then such a constraint would need to be prescient about future requirements changes.
*************
There is nothing wrong with me that could
not be cured by a capful of Drano.
H. S. Lahman
hsl@xxxxxxxxxxxxxxxxx
Pathfinder Solutions -- Put MDA to Work
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
(888)OOA-PATH
.
- References:
- Object Constraint Language and Inheritance
- From: Ulrich Frank
- Object Constraint Language and Inheritance
- Prev by Date: Re: Storing data and code in a Db with LISP-like interface
- Next by Date: Re: Object Orientation in VB.NET
- Previous by thread: Re: Object Constraint Language and Inheritance
- Next by thread: Re: Object Constraint Language and Inheritance
- Index(es):