Extending OB metagraphs

Colin Putney cputney at wiresong.ca
Mon May 7 22:00:16 UTC 2007


On May 7, 2007, at 5:18 AM, Daniel Vainsencher wrote:

> Seems to me that extending browsers by adding commands (such as  
> "find Trait" in addition to "find class") and "fake" elements like   
> DynamicCategories provide, can be done by having registries for  
> them like the Services framework provides for dynamic menus and  
> Browsers (don't know if Services can be reused, or we need to apply  
> some of the same patterns again).
>
> Then the standard browsers can simply add all the relevant extras  
> dynamically, and maybe allow a user to hide some of them.
>
> This dodges the more general question of making the actual graphs  
> extensible. I had an idea about this involving graph rewrite rules,  
> but the solution above sounds simpler, and might work (at least for  
> the current cases), so...

You've brought up two separate issues here.

One is adding commands like "find Trait." Right now that's easy. I  
did quite a bit of work to separate the command discovery mechanism  
from the metagraph, so that it can be easily extended. To implement  
"find trait" would mean creating a class with a few methods, and  
adding a method to OBCodeBrowser.

The other is adding "content" to the browser. That *does* require  
extending the metagraph, no way around it. The purpose of the  
metagraph is to describe how the browser navigates that graph of  
objects that form the domain model. In the stock OB system browser,  
for example, the meta node representing classes has two children -  
one for normal protocols, and one for the synthetic '-- all --'  
protocol. DyanmicProtocols extends the browser by adding children for  
it's own synthetic protocols.

I suppose one thing to do would be to provide an adaptor between the  
abstract domain model and the concrete implementation via a  
metagraph. Then it would be possible to implement the kind of  
registries you mention above. It's not very satisfying though,  
because it wouldn't be a general solution for OmniBrowser, but just  
those that show Smalltalk code.

Colin



More information about the Squeak-dev mailing list