" *****************************************************************************************************
*
* rel1.txt
*
*   This examples shows how to retrieve the related types of an instance
*
*
******************************************************************************************************"

| aModel aTextDisplay sectionType courseType courseSections anOrb|
aTextDisplay := TextWindow  windowLabeled: 'LPC Brokers - handling relationships'
                           frame: (0 @ 0 corner: 500 @ 500).
aTextDisplay cr. 
 
" let's get our model"
aModel := LPCModel getName: #LpcSample.
 
"let's retrieve our Course type"
courseType := aModel typeNamed: #Course.

"let's retrieve our section type"
courseType := aModel typeNamed: #Course.

anOrb := LPCObjectRequestBroker new.

anOrb driverConnectWindow: aTextDisplay.

courses := anOrb lookUpAllWithType: courseType.

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

anOrb disconnect.
                        
                        
                        
                                                                  


    

 
