Fwd: [Vm-dev] Once upon time representsSameBrowseeAs: was moved out of Morphic

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

Fwd: [Vm-dev] Once upon time representsSameBrowseeAs: was moved out of Morphic

Eliot Miranda-2
(forgive the delay, better this is seen twice than not at all)

Begin forwarded message:

From: Nicolas Cellier <[hidden email]>
Date: May 4, 2016 at 1:23:53 PM PDT
To: Squeak Virtual Machine Development Discussion <[hidden email]>
Subject: [Vm-dev] Once upon time representsSameBrowseeAs: was moved out of Morphic
Reply-To: Squeak Virtual Machine Development Discussion <[hidden email]>

Hi,
If you take a look at Morphic-ar.375, you'll see this:

"Move a few methods between various packages to make unload easier."

This commit moved representsSameBrowseeAs: out of Morphic for Lexicon and PreferenceBrowser.

Of course, this message is used exclusively by Morphic so far, but if we classify it in Morphic package, then we can't easily remove Lexicon or PreferencesBrowser.

Indeed, since Morphic would extend Lexicon, it would depend on Lexicon, and we could not unload Lexicon without first unloading Morphic...

Recently, the same message crept in Morphic again, breaking one of the PackageDependencyTest.
IMO, this is a bad thing.

If we do not remove the message representsSameBrowseeAs: when we remove Morphic, then it's not a drama.
And representsSameBrowseeAs: does not depend on Morphic.
It's a general query that could be used by another framework.

OK to move it back to respective packages? (Tools & co).

Nicolas


Reply | Threaded
Open this post in threaded view
|

Re: Fwd: [Vm-dev] Once upon time representsSameBrowseeAs: was moved out of Morphic

marcel.taeumel
Hi Eliot,

this is similar to Shout's #aboutToStyle:, which also cannot be an extension because of the unwanted dependencies.

In general, #representsSameBrowseeAs: is kind of a model comparison that could also come handy in non-morphic scenarios. It's not like #= or #== but a third, tool-specific kind. I have a similar pattern in Vivide: https://github.com/hpi-swa/vivide/search?utf8=%E2%9C%93&q=isObject%3A&type=Code

I use that ViArtifactContainer >> #isObject:, for example, to make instances of CompiledMethod and MethodReference equal on a code editing (= tool) level: https://github.com/hpi-swa/vivide/blob/019606e18670e389a845e46cb384436940cc58bf/repository/Vivide.package/ViMethodEditor.class/instance/isObject..st

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: [Vm-dev] Once upon time representsSameBrowseeAs: was moved out of Morphic

Eliot Miranda-2
Hi Marcel,

    the message is from Nicolas, not me :)

_,,,^..^,,,_ (phone)

> On May 8, 2016, at 9:56 AM, marcel.taeumel <[hidden email]> wrote:
>
> Hi Eliot,
>
> this is similar to Shout's #aboutToStyle:, which also cannot be an extension
> because of the unwanted dependencies.
>
> In general, #representsSameBrowseeAs: is kind of a model comparison that
> could also come handy in non-morphic scenarios. It's not like #= or #== but
> a third, tool-specific kind. I have a similar pattern in Vivide:
> https://github.com/hpi-swa/vivide/search?utf8=%E2%9C%93&q=isObject%3A&type=Code
>
> I use that ViArtifactContainer >> #isObject:, for example, to make instances
> of CompiledMethod and MethodReference equal on a code editing (= tool)
> level:
> https://github.com/hpi-swa/vivide/blob/019606e18670e389a845e46cb384436940cc58bf/repository/Vivide.package/ViMethodEditor.class/instance/isObject..st
>
> Best,
> Marcel
>
>
>
> --
> View this message in context: http://forum.world.st/Fwd-Vm-dev-Once-upon-time-representsSameBrowseeAs-was-moved-out-of-Morphic-tp4893915p4893949.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: Fwd: [Vm-dev] Once upon time representsSameBrowseeAs: was moved out of Morphic

marcel.taeumel
Hi Eliot,

okay. I am sure that Nicolas will read it also. :-D

I found another interesting pattern:

SomeCoolMorph class >> #initialize
   self registerInFlapsRegistry.

SomeCoolMorph class >> #registerInFlapsRegistry
   ... flapsRegistry registerQuad: ...

SomeCoolMorph class >> #unload
   ... flapsRegistry unregisterQuadsWithReceiver: self ...

Now, we cannot put #registerInFlapsRegistry in a Morphic extension because of the same dilemma. However, Flaps and Morphs need morphic anyway. So we are fine here.

Can't we use our ServiceRegistry for such things in the future? (Me, *not* wanting to change flaps registration. *g*)

Best,
Marcel