cancel
Showing results for 
Search instead for 
Did you mean: 

wdDoModifyView Static

Murali_Shanmu
Active Contributor
0 Kudos

Hi,

I have a general question. Why is wdDoModifyView Static. I went through the documentation and was not still clear.

Below is the Signature of the method :

public static void wdDoModifyView(IPrivate<viewname> wdThis, IPrivate<viewname>.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

<i> Here it is also used to discourage the a way of programming that routinely stores references to UI elements in instance fields for access by view controller's event handlers and so on..This would violate MVC paradigm.</i>

I understand that Static methods can access the variables of a class without an Instance of a class being created. Since this method is static, wdThis and wdContext are passed to this method. But why to have it Static in first place ?

Can anyone put it in more simple terms !!

Regards,

Murali.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The idea behind this decision was to separate the view from the view controller. Accessing the view and its elements should not be possible from event handlers and other controller methods.

By making this method static, it has at least been made more difficult to workaround this desired programming style.

Armin

Murali_Shanmu
Active Contributor
0 Kudos

Thanks Armin,

So its basically to avoid accessing View elements from the View controller level. I understand that it has been made difficult by declaring it static and thus ensuring it follows MVC paradigm.

Regards,

Murali.

Answers (0)