[ENH] browseObject

Masashi Umezawa umejava at mars.dti.ne.jp
Wed Mar 10 08:02:17 CET 2004


Hi,

> I was wondering why you introduced browseClass: in SystemNavigation.
> This is more a question than a critic. 

The idea is to aggregate browse protocols in one place.
It is a kind of facade (or adapter). And I think other Smalltalks 
take a similar approach.

For example:

In VW, Object>>browse is implemented as:

browse
    SmalltalkWorkbench browseClass: self class instanceBehavior


SmalltalkWorkbench delegates browse methods to actual development tools.
It has #browseClass:,#browseNameSpace:,#browseBindingReference:, etc.

In Dolphin, Object>>browse is like:

browse
    Smalltalk developmentSystem browseClass: self class

Smalltalk developmentSystem returns a singleton of SmalltalkSystem.
It has #browseClass:, #browseHierarchy:, #browseGlobalReferences:, etc.

SmalltalkSystem has variables, systemBrowserClass, methodBrowserClass..,
so you can change the actual browser implementations.
(RefactoringBrowser, etc).

Since SystemNaviagtion has many browse methods, I think it can be a facade.
Other candidates are Utilities, SmalltalkImage. But SystemNaviagtion seems
to be best for now.

> Could you use self environment or self class environment instead of
> Smalltalk
> because this means that the code will work in different environments? we
> should slowly get rid of Smalltalk hardcoded everywhere.

OK. If my design is not an overkill, I'll change the source and resubmit it.

---
[:masashi | ^umezawa]



More information about the Squeak-harvest mailing list