" *****************************************************************************************************
*
*  orb1.txt
*
*   This examples shows how to use an orb to retrieve  types by key
*
*
******************************************************************************************************"


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

anOrb := LPCObjectRequestBroker new.

anOrb driverConnectWindow: aTextDisplay.
 
algebra := anOrb lookUpForKeyValue: #('ALG')  withType: courseType.

aTextDisplay 
      nextPutAll: 'Course: ', algebra course asString; cr
    ; nextPutAll: 'Hours: ', algebra hours asString; cr
    ; nextPutAll: 'Credit: ', algebra credit asString; cr
    ; nextPutAll: 'Description: ' , algebra description asString; cr .

anOrb disconnect.
 
