Presenter<<name:as: , Development vs Deployed Image Nuance...

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

Presenter<<name:as: , Development vs Deployed Image Nuance...

Christopher J. Demers
I noticed a development image vs a deployed image nuance in the method
Presenter<<name:as: a week ago, and I wanted to mention it here for further
consideration.  I suppose it could be considered a bug.  I encountered the
issue described bellow in Dolphin 5, but it looks like the same code is used
in Dolphin 6 and the same issue seems to apply.

The method (Presenter<<name:as:) endeavors to ensure that the same name is
not used for multiple sub-presenters.  However because the message
#keyAtValue:ifAbsent: is used instead of the message
#keyAtEqualValue:ifAbsent: equivilent, but not identical strings will not be
considered to be duplicates.  The effect of this is that a duplicate
presenter name will not raise an error when the presenter is opened in the
development environment, because the strings are probably not identical.
However, when one deploys the application and enables duplicate string
folding the duplication is detected because the strings are now identical
and an error is raised.  This is exactly what happened to me.  I had a
dialog that worked in my development image, but raise this error after I
deployed it.

If this is deemed to be a bug then one fix would be to use
#keyAtEqualValue:ifAbsent:, however I am not sure if this would be
considered too slow.  I will leave this for OA to ponder.

Here is a workspace example of this issue.
=====
s := Shell show.
tpname := 'tpname'.
"First time, should not complain."
s add: TextPresenter new name: tpname.
"This time it does complain since the names are identical."
s add: TextPresenter new name: tpname.
"This does not complain even though the names are equal because they are not
identical."
s add: TextPresenter new name: tpname copy.
=====

Chris


Reply | Threaded
Open this post in threaded view
|

Re: Presenter<<name:as: , Development vs Deployed Image Nuance...

Andy Bower-3
Christopher,

> I noticed a development image vs a deployed image nuance in the
> method Presenter<<name:as: a week ago, and I wanted to mention it
> here for further consideration.  I suppose it could be considered a
> bug.  I encountered the issue described bellow in Dolphin 5, but it
> looks like the same code is used in Dolphin 6 and the same issue
> seems to apply.
>
> The method (Presenter<<name:as:) endeavors to ensure that the same
> name is not used for multiple sub-presenters.  However because the
> message #keyAtValue:ifAbsent: is used instead of the message
> #keyAtEqualValue:ifAbsent: equivilent, but not identical strings will
> not be considered to be duplicates.  The effect of this is that a
> duplicate presenter name will not raise an error when the presenter
> is opened in the development environment, because the strings are
> probably not identical.  However, when one deploys the application
> and enables duplicate string folding the duplication is detected
> because the strings are now identical and an error is raised.  This
> is exactly what happened to me.  I had a dialog that worked in my
> development image, but raise this error after I deployed it.
>
> If this is deemed to be a bug then one fix would be to use
> #keyAtEqualValue:ifAbsent:, however I am not sure if this would be
> considered too slow.  I will leave this for OA to ponder.
>
> Here is a workspace example of this issue.
> =====
> s := Shell show.
> tpname := 'tpname'.
> "First time, should not complain."
> s add: TextPresenter new name: tpname.
> "This time it does complain since the names are identical."
> s add: TextPresenter new name: tpname.
> "This does not complain even though the names are equal because they
> are not identical."
> s add: TextPresenter new name: tpname copy.
> =====

Hmm.. sounds like a bug to me. I've recorded this as #2073 which should
be fixed for the next patch level. YOu fix seems ok, BTW.

Best regards,

--
Andy Bower
Dolphin Support
www.object-arts.com