cancel
Showing results for 
Search instead for 
Did you mean: 

Event Vs method

Former Member
0 Kudos

Hi Friends,

Is there any difference between WD event and Method or it is same?

Accepted Solutions (1)

Accepted Solutions (1)

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Event will be in Component Controller not in view controller.

U can handle this event at runtime using Event-handler in any view.

This is not possible in an method.

This can be used to write a seperate code i.e. Funtionality and used where ever required.

Regards,

Vijayakhanna Raman

Answers (2)

Answers (2)

Former Member
0 Kudos

Nav,

WD is irrelevant here. The same concepts are applied in many (if not all) frameworks/libraries.

Methods are "active" -- you explicitly know sole traget and "actively" execute method on it.

With events you do not know target or targets, and just brodcast away a notification. Anyone interested may subscribe to event and handle it in its own way.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

Hi VS,

Can we say that these events are asynchronous?

Former Member
0 Kudos

Nav,

Yes and no.

In fact, they are one-way -- typically you do not get reply from receivers. Technically, they may be implemented as asynhronous, but in WD control is returned back after all event handlers are completed.

VS

Former Member
0 Kudos

Hi Valery Silaev,

Thanks!

Former Member
0 Kudos

Hi,

I assume that WD Event is a Event Handler.

Basically, a Event Handler is a method.

But, the difference is that Event Handler is invoked on an

Event of the developer or the end user where as a method you need to invoke in your code. You need to call the method explicitly.

Hope it helps you.

Regards,

Maheswaran.B

Former Member
0 Kudos

Thanks VijayaKhanna Raman and Maheswaran B !