Hi Alex,

Thanks for your detailed explanation.
To me,the design of the current UIManger is not good enough. UIManager has too 
much pre-occupations. He is in charge of:
providing different implementation of interactive requests, depending if the 
current UI manager is interactive or not, if the UI is available or not,
provide different way of handling errors, still depending on the interactive/UI 
status,
initialize the current UI.
At some point we should split that but it another story.

For your use case, I think the only behavior missing for you from the old 
startup mechanism is a way to have both morphic and bloc available in the image 
and to stop an image and start with the ui manager in place at shutdown (the 
user can switch from Morphic to bloc and vice-versa).
It think it is a valid use case and we could add a state to the startup ui 
manager to hold the value of the default ui manager. This way, we can restore 
it when we deinstall the startup ui manager.

WDYT?

Cheers,
Christophe

Le 4 févr. 2016 à 09:48, Guille Polito a écrit :

> Hi Alex,
> 
> First, note that the current UIManager selection and the StartupUIManager 
> appears from a cleanup on the old UIManager selection that existed. The idea 
> is that the UIManagerSessionHandler will run in low priority and set a 
> startup UIManager during startup (when you cannot ensure that UI is still 
> operational) and then replace it by a default UIManager to keep backwards 
> compatibility for now. But, Block can have its own startup action that 
> installs it's own world/UIManager in a higher priority than the startup. Is 
> this a possibility? Of course I think morphic should do the same: it should 
> have a startup action that initiates a UI thread, and a corresponding 
> UImanager. But we did not attack that refactor yet, :). We should be able to 
> explicitly recreate the UI process on each startup.
> 
> Then, a second problem is having a different UIManager for each 
> World/Universe, and have co-existing Morphic/Block or even different Block 
> universes. Today's UIManager is global and shared by everybody, as it always 
> was and it never took into account the multiple world possibility...
> 
> So, any proposal in this direction would be nice!
> 
> On 02/04/2016 01:17 AM, Ben Coman wrote:
>> On Thu, Feb 4, 2016 at 5:06 AM, Aliaksei Syrel <alex.sy...@gmail.com> wrote:
>>> Bloc has its own UIManager, UI process, event fetchers and space/worlds.
>>> Because Bloc is not yet a default UI framework in pharo we want to switch to
>>> it manualy. To do this we have a world menu entry (switch to bloc). During
>>> switching process Bloc UIManager should become current default UIManager.
>>> Bloc's root model class is Universe. Universe can have multiple spaces where
>>> each space can have multiple worlds. For each space we assign its own
>>> UIManager with UI process, fetchers and so on to allow running multiple
>>> spaces in "<parallel>". To be able to switch between pharo morphic and bloc
>>> we have by default two running spaces: Bloc Space and Morphic Space. Each of
>>> them has its own UIManager: Bloc UI manager (new one) and Morphic UIManager
>>> (one that is in Pharo without Bloc being set during
>>> UIManagerSessionHandler>>#startup:).
>> Thanks for that description Aex.  I haven't seen much doc on the Bloc
>> architecture, so it is interesting hear of this Universe part.
>> I wonder... even if Bloc is not yet ready for prime time default use,
>> how ready is the Universe sub-part?
>> Could this part be enabled by default prior to the rest of Bloc being
>> ready for default? and would that help your case?
>> 
>> Further along that line of thought, considering the
>> modularisation/minimalisation effort, is it possible the Universe part
>> could be completely separated from Bloc, so we could (for
>> demonstration only) have only Universe+Morphic, but also later if
>> someone was to resurrect MVC, we could be have only Universe+MVC, or
>> only...
>> * Universe+RemoteUI
>> * Universe+Headless
>> * Universe+CommandLineREPL
>> * Universe+EmergencyUI
>> * Universe+SomeOtherExperiment
>> 
>> Or is Universe not an appropriate container for those sorts of things?
>> 
>> cheers -ben
>> 
>> 
>>> In bloc, Space is responsible for starting and stopping itself (stopping
>>> listeners, stopping ui thread and so on). It means that Bloc UIManager can
>>> not exist without Bloc Space. (egg is Space, chicken is UIManager).
>>> 
>>> We want users to be able to switch to bloc manually and allow to save image
>>> within the bloc to be able to get directly to it after startup.
>>> (if user saves in morphic, after start up she gets to morphic. If she saves
>>> in bloc, after startup she gets to bloc).
>>> 
>>> My problem is the following method:
>>> 
>>>> UIManagerSessionHandler>>#startup: isImageStarting
>>>>   "Install the right UIManager"
>>>>   UIManager default: UIManager forCurrentSystemConfiguration.
>>> 
>>> If there is a subclass of MorphicUIManager in the system, a subclass will be
>>> used as default UIManager. (due to forCurrentSystemConfiguration)
>>> Now imagine I create a Bloc UIManager which is a subclass of
>>> MorphicUIManager. Bloc UI Manager as described above can not live without
>>> Bloc Space, because space controls ui manager. Even if I don't want to
>>> switch to bloc - Bloc UI Manager will be used by default, which leads to
>>> NullPointerException (space is undefined).
>>> 
>>> Now Imagine that we just load Bloc as part of build process. During first
>>> image start forCurrentSystemConfiguration selects BlocUIManager and image
>>> crashes.
>>> 
>>> I see that something is broken. Let's find out what and where. And fix asap!
>>> 
>>> Cheers,
>>> Alex
>>> 
>>> On Tue, Feb 2, 2016 at 7:31 PM, Aliaksei Syrel <alex.sy...@gmail.com> wrote:
>>>> UIManagerSessionHandler>>#startup: isImageStarting
>>>> "Install the right UIManager"
>>>> UIManager default: UIManager forCurrentSystemConfiguration.
>>>> 
>>>> Setting (overring current one) default UIManager each time image is
>>>> saved/started up prevents us from having custom UIManagers, for example 
>>>> Bloc
>>>> UI manager
>>>> 
>>>> On Tue, Feb 2, 2016 at 7:04 PM, Aliaksei Syrel <alex.sy...@gmail.com>
>>>> wrote:
>>>>> When deleting a class I get deprecation in #50561 in
>>>>> SystemDictionary>>#forgetClass: aClass logged: aBool  because of
>>>>> removeFromStartUpList:
>>>>> 
>>>>> 
>>>>> Cheers,
>>>>> Alex
> 
> 

Reply via email to