on 05-03-2012 8:18 AM
data dd type ref to cl_wd_uielement_container .
.
dd ?= view->get_element('ROOTUIELEMENTCONTAINER') .
help me what is the meaning of dd ?= view->get_element('ROOTUIELEMENTCONTAINER') .
Hi,
Here the method Get_element( ) returns a reference to interface IF_WD_VIEW_ELEMENT which is being implemented in CL_WD_UIELEMENT_CONTAINER.
So you are assigning this object reference to dd which is reference to CL_WD_UIELEMENT_CONTAINER, So you are going up in terms of inheritance, So this is called UP CAST or WIDENING CAST and the casting operator(?=) is not required for Up cast.
Only when you come downwards in terms of inheritance while assigning references this casting operator would be required, Suppose in your case if you are assigning in reverse way then the ? operator would be needed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This indicates Widening Casting. Assigning the instance of super class to sub class instance is called widening casting,
Here view->get_element( ) returns the reference of root ui element container class which is assigned to reference dd of cl_wd_uielement_container class
For more information search for "Widening Casting"
Thanks & Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi,
This concept is used in Dynamic Coding..
and "?=" is used for type casting. You can refer for type casting concepts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.