pharo-project / pharo

Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
http://pharo.org
Other
1.21k stars 356 forks source link

StSettingsBrowserTest are all broken so may be the Browser too. #17389

Closed Ducasse closed 4 days ago

Ducasse commented 4 days ago
KeyNotFound
key #settingsTree not found in SmallDictionary
SmallDictionary>>errorKeyNotFound:
[self errorKeyNotFound: key] in SmallDictionary>>at:
SmallDictionary>>at:ifAbsent:
SmallDictionary>>at:
StPharoApplication(SpApplication)>>propertyAt:
StSettingsCategoriesPresenter(StSettingsAbstractPresenter)>>settingsTree
StSettingsCategoriesPresenter>>defaultSettingsCategories
StSettingsCategoriesPresenter>>settingsCategories
StSettingsCategoriesPresenter>>categoriesAsPresenters
StSettingsCategoriesPresenter>>initializePresenters
StSettingsCategoriesPresenter(SpPresenter)>>initializePrivateHooks
StSettingsCategoriesPresenter(SpPresenter)>>initialize
StSettingsCategoriesPresenter class(SpPresenter class)>>newApplication:owner:model:
StSettingsCategoriesPresenter class(StPresenter class)>>owner:on:
StSettingsMainPresenter(SpPresenter)>>instantiate:on:
StSettingsMainPresenter>>initializePresenters
StSettingsMainPresenter(SpPresenter)>>initializePrivateHooks
StSettingsMainPresenter(SpPresenter)>>initialize
StSettingsMainPresenter>>initialize
StSettingsMainPresenter class(SpPresenter class)>>newApplication:
StSettingsBrowserTest(SpBasePresenterTest)>>setUp
StSettingsBrowserTest>>setUp
Ducasse commented 4 days ago

Why putting the model in the currentApplication property. We could just put the presenter and the presenter should know its model.

We should clarified this architecture.

settingsTree
    "Answer the receiver's <StSettingsTree>, the settings model"

    ^ self currentApplication propertyAt: #settingsTree.

@estebanlm @tesonep what is the vision for the way application manages their tools?

Ducasse commented 4 days ago

The SettingsMainPresenter should then register itself or its model to the current application. I could not find where it is doing this.

estebanlm commented 4 days ago

because then application will start to have too many concerns and it will start being itself a mud ball... instead, StPharoApplication have now a method:

tools

    ^ Smalltalk tools

for now it just answers Smalltalk tools, but there is no reason why it cannot get it from a property (or an instance variable) in the future (which is the intended usage, in fact... just transitions take time).

No complains if we do that (the registry in a separated instance), and then we add convenience methods to access the tools (methods that delegate to the registry).

Ducasse commented 4 days ago

Hernan fix it and I proposed a registration in StPharoApplication and I will migrate to it.