" *****************************************************************************************************
*
*  orb.txt
*
*   This examples shows how to use an orb to retrive all instances of a type
*
*
******************************************************************************************************"


| aModel aTextDisplay anOrb courses courseType|
aTextDisplay := TextWindow  windowLabeled: 'LPC Brokers - retrieving all instances of a type'
                           frame: (0 @ 0 corner: 500 @ 500).
aTextDisplay cr. 
 
aModel := LPCModel getName: #LpcSample.
courseType :=aModel typeNamed: #Course.

anOrb := LPCObjectRequestBroker new.

anOrb driverConnectWindow: aTextDisplay.
 
courses := anOrb lookUpAllWithType: courseType.

courses do: [ :each | aTextDisplay nextPutAll: each asString ; cr ].

anOrb disconnect.
 
