terminology question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

terminology question

Howard Oh
Masters,

Is there a name for the two overriding style exampled below?
A: Superclass version of method called first then mine
B: My version of method called first then superclass'

example A:
MyObject>>someMethod

    super someMethod
    ................
    ................
    ^aRespose

example B:
MyObject>>someMethod

    ................
    ................
    super someMethod
    ^aResponse

Just curios
Hwa Jong Oh


Reply | Threaded
Open this post in threaded view
|

Re: terminology question

Peter van Rooijen
"Hwa Jong Oh" <[hidden email]> wrote in message
news:91mov7$4nl4k$[hidden email]...

> Masters,
>
> Is there a name for the two overriding style exampled below?
> A: Superclass version of method called first then mine
> B: My version of method called first then superclass'
>
> example A:
> MyObject>>someMethod
>
>     super someMethod
>     ................
>     ................
>     ^aRespose
>
> example B:
> MyObject>>someMethod
>
>     ................
>     ................
>     super someMethod
>     ^aResponse

Student,

No, there is no name for it known to man.

It is a pattern, though (be it an obscure one). There are certain cases
where you want to do B. Make sure you have a very good reason, though, and
no realistic opportunity of using A. Should you find a generalized Good
Reason for using B, I say you could give it a name yourself! Go for it!

Regards,

Peter van Rooijen


Reply | Threaded
Open this post in threaded view
|

Re: terminology question

David Simmons
"Peter van Rooijen" <[hidden email]> wrote in message
news:91n2t7$d9i$[hidden email]...

>
> "Hwa Jong Oh" <[hidden email]> wrote in message
> news:91mov7$4nl4k$[hidden email]...
> > Masters,
> >
> > Is there a name for the two overriding style exampled below?
> > A: Superclass version of method called first then mine
> > B: My version of method called first then superclass'
> >
> > example A:
> > MyObject>>someMethod
> >
> >     super someMethod
> >     ................
> >     ................
> >     ^aRespose
> >
> > example B:
> > MyObject>>someMethod
> >
> >     ................
> >     ................
> >     super someMethod
> >     ^aResponse
>
> Student,
>
> No, there is no name for it known to man.

Well actually this is the common pattern for inner/outer (before/after)
method patterns. Its usage predates Smalltalk, and was a language feature of
Simula. This is common practice in CLOS (common lisp object system) for
composing initialization sequences and is closely related to a number areas
in aspect oriented programming. I've use this pattern numerous times in QKS
Smalltalk. It is the fundamental pattern used for the ui architecture in
initialization, reification (pickle/unpickle), and finalization of component
properties during component lifecycles.

-- Dave Simmons [www.qks.com / www.smallscript.com]
  "Effectively solving a problem begins with how you express it."

>
> It is a pattern, though (be it an obscure one). There are certain cases
> where you want to do B. Make sure you have a very good reason, though, and
> no realistic opportunity of using A. Should you find a generalized Good
> Reason for using B, I say you could give it a name yourself! Go for it!
>
> Regards,
>
> Peter van Rooijen
>
>