That should work. What I imagined was somewhat the same, but with no
additional duplicate methods in the parent class, and an extra method
in the child:
ClassMethod OnPreHTTP() As %Boolean [ServerOnly=1] {
@me->OnPreHTTPParent() ;* in your scenario this method is in the
parent class, and you need to know the parent name, but in mine it is
in this child class
}
ClassMethod OnPreHTTPParent() As %Boolean [ServerOnly=1,
language=cache] {
do ##super()
}
Your plan has the advantage of limiting the number of extra methods--
the helpers are all in the parent class with none in the children. But
when you create each of the children, you need to know the parent's
name (which admitedly isn't too likely to change). In my scenario, you
don't need to know the parent classes name--OnPreHTTPParent is the
literal method name. ##super in a cos method does the work of
resolving the parent's name.
In my scenario, if there ever is a ##super equivalent added to
mvbasic, you only need to change the child class. In your scenario,
you need to change both the parent and child (to get rid of the extra
method in the parent, and to call the base method in the child). But I
don't know that either really has a big advantage over the other.