Hi,
I am browsing OB to understand the design of the Requests and the commands. In particular, I am interested to understand why OBRequests are Notifications and how they link with the commands. Is there anywhere I can read about it? Cheers, Doru -- www.tudorgirba.com "What we can governs what we wish." |
> I am browsing OB to understand the design of the Requests and the commands. In particular, I am interested to understand why OBRequests are Notifications and how they link with the commands.
> > Is there anywhere I can read about it? Please check the class comments of OBInteractionRequest and subclasses. "OBInteractionRequest is an abstract superclass for notifications that request some interaction with the user. It's useful for catching such notifications in an exception handler, while allowing other notifications to operate normally." So all these requests are interacting in some way with the user, e.g. they open a new browser, they close a browser, they refresh a browser, they show a specific dialog, they change the mouse cursor, etc. And depending on the current view these requests are handled differently. In OB-Morphic the respective morphic actions are performed, in OB-Web the request is serialized to JSON and performed on the client side, ... and in the tests the events are silently captured and verified using assertions. OBCommand is something entirely different. It represents the first-class actions (menu items, buttons) in a browser. The only way an OBCommand can interact with the user and for example request additional information is through OBInteractionRequests that might be triggered at any point. Lukas -- Lukas Renggli www.lukas-renggli.ch |
Thanks, Lukas.
I did read the comments. I understand why Commands and Requests are first class entities, and what they do individually. In Glamour, we have Actions which are similar to OB Commands. However, now we do not have explicit Requests, and I wanted to learn from OB. My main current question is what are the reasons for OBInteractionRequest to subclass Notification? Cheers, Doru On 23 Jan 2011, at 23:34, Lukas Renggli wrote: >> I am browsing OB to understand the design of the Requests and the commands. In particular, I am interested to understand why OBRequests are Notifications and how they link with the commands. >> >> Is there anywhere I can read about it? > > Please check the class comments of OBInteractionRequest and subclasses. > > "OBInteractionRequest is an abstract superclass for notifications that > request some interaction with the user. It's useful for catching such > notifications in an exception handler, while allowing other > notifications to operate normally." > > So all these requests are interacting in some way with the user, e.g. > they open a new browser, they close a browser, they refresh a browser, > they show a specific dialog, they change the mouse cursor, etc. And > depending on the current view these requests are handled differently. > In OB-Morphic the respective morphic actions are performed, in OB-Web > the request is serialized to JSON and performed on the client side, > ... and in the tests the events are silently captured and verified > using assertions. > > OBCommand is something entirely different. It represents the > first-class actions (menu items, buttons) in a browser. The only way > an OBCommand can interact with the user and for example request > additional information is through OBInteractionRequests that might be > triggered at any point. > > Lukas > > -- > Lukas Renggli > www.lukas-renggli.ch > -- www.tudorgirba.com "Being happy is a matter of choice." |
> My main current question is what are the reasons for OBInteractionRequest to subclass Notification?
To be able to perform user interactions anywhere without having a global OBPlatform instance, and without having to pass OBPlatform in or store OBPlatform anywhere. There can be multiple UI platforms active at the same time and they can even change over the lifetime of a single browser window. Lukas -- Lukas Renggli www.lukas-renggli.ch |
Hi Lukas,
On 24 Jan 2011, at 15:57, Lukas Renggli wrote: >> My main current question is what are the reasons for OBInteractionRequest to subclass Notification? > > To be able to perform user interactions anywhere without having a > global OBPlatform instance, and without having to pass OBPlatform in > or store OBPlatform anywhere. There can be multiple UI platforms > active at the same time and they can even change over the lifetime of > a single browser window. I am not sure I understand. Why did it have to be a subclass of Notification? Would it not be enough to have it as a subclass of Object? Cheers, Doru > Lukas > > -- > Lukas Renggli > www.lukas-renggli.ch > -- www.tudorgirba.com "The coherence of a trip is given by the clearness of the goal." |
On 01/24/2011 01:07 PM, Tudor Girba wrote:
> Hi Lukas, > > On 24 Jan 2011, at 15:57, Lukas Renggli wrote: > >>> My main current question is what are the reasons for OBInteractionRequest to subclass Notification? >> >> To be able to perform user interactions anywhere without having a >> global OBPlatform instance, and without having to pass OBPlatform in >> or store OBPlatform anywhere. There can be multiple UI platforms >> active at the same time and they can even change over the lifetime of >> a single browser window. > > I am not sure I understand. Why did it have to be a subclass of Notification? Would it not be enough to have it as a subclass of Object? > > Cheers, > Doru Doru, They are subclasses of Notification so that exception handlers can be used to intercept the notification and do something different than prompt the user for the request ... the defaultAction of the exception triggers the UI to prompt the user with an appropriate dialog box... Dale |
In reply to this post by Tudor Girba
Performing a user interaction always goes through signaling the
notification. For example to request a text input: expression := OBTextRequest new prompt: 'Enter a matching expression'; signal Or to open the completion dialog: category := OBCompletionRequest new assisted: true; collection: categories; prompt: 'Add Category'; signal Or to open a new browser: view := OBBrowseRequest new browser: OBSystemBrowser new; signal Note that Morphic raises some interaction notifications in a very hackish too (with information stuffed into arrays and dictionaries) when opening some (of course not all) of the user interactions. OB implemented its own user interaction mechanism long before Morphic was improved and also to remain independent of the platform/view. Lukas On 24 January 2011 13:07, Tudor Girba <[hidden email]> wrote: > Hi Lukas, > > On 24 Jan 2011, at 15:57, Lukas Renggli wrote: > >>> My main current question is what are the reasons for OBInteractionRequest to subclass Notification? >> >> To be able to perform user interactions anywhere without having a >> global OBPlatform instance, and without having to pass OBPlatform in >> or store OBPlatform anywhere. There can be multiple UI platforms >> active at the same time and they can even change over the lifetime of >> a single browser window. > > I am not sure I understand. Why did it have to be a subclass of Notification? Would it not be enough to have it as a subclass of Object? > > Cheers, > Doru > > > >> Lukas >> >> -- >> Lukas Renggli >> www.lukas-renggli.ch >> > > -- > www.tudorgirba.com > > "The coherence of a trip is given by the clearness of the goal." > > > > > > -- Lukas Renggli www.lukas-renggli.ch |
Free forum by Nabble | Edit this page |