Changes between Version 43 and Version 44 of PRO_LIB_CORE_TUTORIAL


Ignore:
Timestamp:
07/14/09 15:25:56 (16 years ago)
Author:
peko
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PRO_LIB_CORE_TUTORIAL

    v43 v44  
    745745}}} 
    746746 
    747  
     747 ==== Accessing a parent property that has not been initialized (usually set to null) ==== 
     748 
     749 * Suppose one has the following code: 
     750{{{ 
     751 
     752       class Child extends BaseProObject { 
     753 
     754                public Prop<Parent> parent() { 
     755                        return getBean().makeParentProp(Parent.class); 
     756                } 
     757                 
     758        } 
     759         
     760        class Parent extends BaseProObject { 
     761                 
     762                @Own 
     763                public RwProp<Child> child() { 
     764                        return getBean().makeValueProp("child", Child.class); 
     765                }        
     766                 
     767        } 
     768 
     769}}} 
     770   
     771  * If one tries to do the thing below a NotAvailableException will be thrown. 
     772{{{ 
     773                Parent parent = new Parent(); 
     774                Child child = new Child(); 
     775                child.parent().get(); //null at this point. 
     776                parent.child().get(); //throws NotAvailableException 
     777}}} 
     778  In order to use the above relation see... 
     779{{{ 
     780 
     781                Parent parent = new Parent(); 
     782                Child child = new Child(); 
     783                parent.child().set(child); 
     784                child.parent().get(); // child.parent().get() == parent 
     785}}} 
    748786 
    749787== Debugging ProLib ==