Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customizing Object>>gtGsVariableValuePairsWithSelfIf: for GemStone #49

Open
dalehenrich opened this issue Apr 18, 2017 · 3 comments
Open

Comments

@dalehenrich
Copy link
Contributor

I find that I want to add some synthetic fields for GemStone: oop and dependencyList are the two most pressing (see #38), but I am curious as to the best way to extend the method Object>>gtGsVariableValuePairsWithSelfIf: ... it is shared between Pharo and GemStone, so it looks like I need to wrap the GemStone-specific code with a #gtGsIsGemstone call ... but then I wonder how to handle competing additions to this method ... ???

Anyway, I think I can add what I need, but it seems that additional customizations can get a bit difficult to do without having different developers stomping on each other ...

@chisandrei
Copy link
Member

chisandrei commented Apr 18, 2017

Currently Object>>gtGsVariableValuePairsWithSelfIf: is only used on the GemStone side. All inspector presentations that use it have a #when block (when: [ self gtGsIsGemstone ]).

Right now, in the inspector the cleanest way would be to add a new custom presentation that displays the state the way you want. For example:

Object>>gtGsInspectorBRawTableWithSyntheticFieldsPresentationIn: aComposite
<gtInspectorPresentationOrder: 10>

   ^ self gtGsInspectorBRawTablePresentationIn: aComposite
        title: 'Raw Custom';
        display: [ 
           "self gtGsVariableValuePairsWithSelfIf: true" 
           "here the list of variables can be constructed by reusing or not gtGsVariableValuePairsWithSelfIf"]

What's not available now for the GemStone inspector is disabling presentations. For example, in Pharo you could add a custom Raw presentation and disable the default one.

But indeed we need a better mechanism for specifying synthetic fields. One solution that I had in mind is to have dedicated methods that construct a depend field start with a predefined name (#gtGsInspectorsyntheticFieldOop, #gtGsInspectorsyntheticDependencyList). The inspector could locate them by name and use then to when creating the 'Raw' view. I'm opened to other suggestions.

@dalehenrich
Copy link
Contributor Author

Yeah, I'll have to think about that ... when I get some time :) ... with tODE I only have to subclass a builder to customize things ... these distributed methods make it somewhat hard for a developer to understand just what goes into making a view for now hard-wiring the synthetic fields will work for me ... THX

@chisandrei
Copy link
Member

Indeed, some kind of builders could also work for the case of more complex presentations, like the Raw view. Need to also find time to look more into this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants