[Setools] [OB] Access to browser in node instances?

David Röthlisberger squeak at c3com.ch
Tue Dec 5 09:19:08 UTC 2006


Hello Colin,


> What sort of entities are you talking about? Why do you need to get at 
> them from the nodes?

With entities I'm referring to class categories, classes, method 
protocols and methods.
What I'm doing is a special kind of class browser which only shows 
"some" entities of the image (eg. some classes and methods), namely 
those that make up a certain feature of a software. First I determine a 
feature by tracing a software, then second I render the call graph for 
this feature and third I want to open a browser only containing the 
classes and methods used in this feature. For that the easiest solution 
for me would be to just pass the determined entities to the browser 
during the creation of the browser instance.
So far I statically reference a single feature and display the entities 
of this single feature in the browser. But I want to be able to analyze 
several features at the same time, so a specific browser should just 
show me the entities of the feature I pass to it.

The situation gets a bit more complex because the user should also be 
able to create new entities (classes, methods, etc.) in this "feature 
browser". These newly created entities are not yet part of the feature 
currently being analyzed, so the feature itself cannot answer all 
entities displayed in its feature browser.

 > Why do you need to get at
 > them from the nodes?

Well, actually I just need to know how to create the successor nodes of 
a given node.
In my environment node I display all class categories that are 
containing classes used in a given feature. For every class category 
node I then have to display only those classes in this category that are 
also part of this feature. And so on, up to the method node.
In fact it is enough if I can access the feature object in a node class, 
because this object gives me the entities used in the feature. Hence I 
was thinking that it would be handy to know the browser instance in the 
nodes, because this browser instance knows the feature for which it was 
created.

> There *is* a good reason not to have references to the browser inside 
> the nodes. An early version of OB was designed that way, and it led to 
> too much coupling and inflexibility.  Taking them out simplified things
> quite a bit, and ever since then, nodes have been becoming simpler and 
> simpler. Nodes really should be simple adaptors for domain objects, 
> adapting them to the protocol that OB expects.

yes, I agree.
But how to create nodes for domain objects that do not know themselves 
what their successors are and that are not statically accessible for a 
given browser, but only dependent on a specific instance of a browser?

Extending my domain model to support the navigation from a higher level 
to the lower (eg from classes to method protocols) is also not really 
possible, because I would have to create "shadow" classes and methods 
for every feature.


Kind regards,
David


More information about the Setools mailing list