Hi Ben

When igor integrated his textEditor with Spec we saw that the relation between
a model and its adapter is not direct but via another interpretation.
For example

MorphicButtonAdapter class>> defaultSpec

^ {#PluggableButtonMorph.
            #color:. Color white.
#on:getState:action:label:menu:. #model. #state. #action. #label. nil.
            #getEnabledSelector:.                 #enabled.
            #getMenuSelector:.                #menu:.
            #hResizing:.                         #spaceFill.
            #vResizing:.                         #spaceFill.
            #borderWidth:.                        #(model borderWidth).
            #borderColor:.                        #(model borderColor).
            #askBeforeChanging:.                #(model askBeforeChanging).
            #setBalloonText:.                    { #model . #help}.
            #dragEnabled:.                        #(model dragEnabled).
            #dropEnabled:.                        #(model dropEnabled).
#eventHandler:. { #EventHandler. #on:send:to:. #keyStroke. #keyStroke:fromMorph:. #model }}

We do not understand why it is needed. Because the adapter is specific to a platform and to a model so
For example why do we have

    #borderWidth:.                        #(model borderWidth).

while we could have
MorphiButtonAdapter>>borderWitdh

     ^ self model borderWidth

Having this extra interpretation loop
    - is costly
- blur the API of the class (as a programmer I do not see the exact API) the cross navigation gets
    confused.
    - makes the code more complex to understand
for example
#eventHandler:. { #EventHandler. #on:send:to:. #keyStroke. #keyStroke:fromMorph:. #model }}

In addition is not a kind of static meta description so we will always need interpretation.

So I would really like to see if we can avoid this second interpretation.

Stef

Reply via email to