From: itsme213 Date: 2004-12-06T23:42:43+09:00 Subject: Re: Freezing Variable Assignment > >>It's in the same vein that I think Observable should target a > >>instance variable (an attribute, more generally) of an object, > >>rather than an entire object. > > > > > > Why? > > It's useful in GUI code, where each control, field, etc. is wired up to > one or more attrs in the window instance, and other related windows can > be wired up to those attrs too, to keep their state synchronized. See, > for instance, foxtails on raa, which uses FXRuby and observable (also on > raa). That observable lib (which should have been called > observable-attr) is just what Nicholas described: it makes attrs observable. GUIs are a good example, including wiring up attributes of controls (e.g. theTemperatureIndicator.color) to attributes of domain objects (e.g. theFurnace.temperature). I'd go further and say that almost any place one registers interest in an object, what is really intended is an interest in some attribute (or, equivalently, some set of attributes) of that object. Which is why I think the freeze proposal is a Good Thing.