[Newbies] Using same class names
K. K. Subramaniam
subbukk at gmail.com
Mon Feb 1 03:55:15 UTC 2010
On Monday 01 February 2010 06:09:35 am lanas wrote:
> Hello all,
>
> Is there a way to have several classes with the same names and having
> their scope limited to the current selected category ? Eg. I'd like to
> experiment with the Abstract factory pattern and thus I would like to
> make several tests, each in a category, like:
AFAIK, classes are variables in global scope in Squeak. Try inspecting:
#Integer
and
Smalltalk at: #Integer
> In other words, is there a way to quickly switch from one experiment
> to the other when each of these experiments would use the same class
> names and probably many of the same method names ?
You may want to use facade class and subclass your variant classes from it.
E.g if you have classes Factory1, Factory2 etc. with the same methods, create
a facade superclass and invoke methods using current method. e.g.
Factory current myownmethod
See senders and implementors of "current" method for examples.
> By the way, in the System Browser, the row of buttons labeled browse,
> senders, implementors, version, inheritance and such has
> somehow disappeared. Any new System Browser does not have that row of
> buttons anymore. Is there a way to bring them back short of reverting
> to the original image. This is Squeak 3.10.2.
See optionalButtons in Preferences.
HTH .. Subbu
More information about the Beginners
mailing list