For reference: what's aBuilder when you see <worldMenu>

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

For reference: what's aBuilder when you see <worldMenu>

DougEdmunds
 When I got to methods involving menus and using pragmas, i.e., words in pointy brackets, such as <worldMenu>, I ran across most of them using the parameter 'aBuilder'.  

Since there is no class 'Builder' the question becomes what is 'aBuilder'?  Since the core contains somewhere around 60 classes that contain the word 'Builder', this is not easily answered.

Thanks to the CollaborActive Book, there is an answer.
Section 3.4 currently states:
"The class WorldState builds the world menu using a PragmaMenuBuilder passed to all methods defining the <worldMenu> pragma."

So presumably, wherever there is 'aBuilder', mentally change that to 'aPragmaMenuBuilder', and you will be able to start figuring out what things like

(aBuilder item: #System)
                order: 3.0;

are talking about.  For example, since PragmaMenuBuilder does not have a method 'item:' but it inherits from MenuRegistration, which does, you can look at the class MenuRegistration to figure out what 'aBuilder' is doing with #System, before whatever that is does something with order:   :)
 
Reply | Threaded
Open this post in threaded view
|

Re: For reference: what's aBuilder when you see <worldMenu>

Stéphane Ducasse
read the setting chapter :)

On Apr 16, 2011, at 12:22 AM, DougEdmunds wrote:

> When I got to methods involving menus and using pragmas, i.e., words in
> pointy brackets, such as , I ran across most of them using the parameter
> 'aBuilder'.  
>
> Since there is no class 'Builder' the question becomes what is 'aBuilder'?
> Since the core contains somewhere around 60 classes that contain the word
> 'Builder', this is not easily answered.
>
> Thanks to the CollaborActive Book, there is an answer.
> Section 3.4 currently states:
> "The class WorldState builds the world menu using a PragmaMenuBuilder passed
> to all methods defining the  pragma."
>
> So presumably, wherever there is 'aBuilder', mentally change that to
> 'aPragmaMenuBuilder', and you will be able to start figuring out what things
> like
>
> (aBuilder item: #System)
> order: 3.0;
>
> are talking about.  For example, since PragmaMenuBuilder does not have a
> method 'item:' but it inherits from MenuRegistration, which does, you can
> look at the class MenuRegistration to figure out what 'aBuilder' is doing
> with #System, before whatever that is does something with order:   :)
>
>
> --
> View this message in context: http://forum.world.st/For-reference-what-s-aBuilder-when-you-see-worldMenu-tp3453120p3453120.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>