[CLOSED] DirectEvent or static DirectMethod?

  1. #1

    [CLOSED] DirectEvent or static DirectMethod?

    Hi,

    I cannot find the posting but somne time ago it was told here (I think Vladimir did) that we should make DirectMethods static if possible, because static DirectMethods are much faster.

    How is the performance compared to a DirectEvent method? DirectEvents are also not static.

    And what are the advantages of a DirectEvent compared to a DirectMethod?

    Shall we use static DirectMethods instead of DirectEvents if possible?


    Regards,

    Martin
    Last edited by Daniil; Nov 25, 2010 at 7:09 AM. Reason: [CLOSED]
  2. #2
    Hi,

    - DirectEvent cannot be static
    - DirectMethod doesn't releated with any control therefore can be used anywhere on the client side (and doesn't required control on the server side)
    - There are no performance advantages between none static DirectMethod and DirectEvent

    Shall we use static DirectMethods instead of DirectEvents if possible?
    Well, if possible then yes because static method much faster (but you have no access to controls and cannot register script, only return some value)

    I suggest always minimize DirectMethod/DirectEvent using. If you can do required action on the client side via javascript (show a window, hide element, show notification and etc) then use javascript code and do not use DirectMethod/DirectEvent

    Investing time to learn about client-side JavaScript API (http://dev.sencha.com/deploy/dev/docs/), it can really helps you in developemnt and improves the quality of you application
    Last edited by geoffrey.mcgill; Nov 23, 2010 at 12:55 PM.
  3. #3
    Hi,

    of course I am using JavaScript as much as possible.
    But sometimes (for DB operations e.g.) its not possible.

    Or is an ashx-handler in that case more useful/ faster than a static DirectMethod?
    I guess even the static DirectMethod should be better than a handler in that case.


    Regards,

    Martin
    Last edited by geoffrey.mcgill; Aug 24, 2012 at 8:02 PM.
  4. #4
    Hi,

    Or is an ashx-handler in that case more useful/ faster than a static DirectMethod?
    I guess even the static DirectMethod should be better than a handler in that case.
    I didn't compare handler and static direct method but I guess that static direct method performance should not be similar to a .ashx handler.
    Last edited by geoffrey.mcgill; Nov 23, 2010 at 12:56 PM.

Similar Threads

  1. [CLOSED] DirectEvent & DirectMethod
    By trieu.tran in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 31, 2012, 11:47 AM
  2. [CLOSED] Calling Static DirectMethod defined in an UserControl
    By ISI in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 05, 2011, 9:16 AM
  3. Replies: 13
    Last Post: May 16, 2011, 1:26 PM
  4. [CLOSED] Difference between DirectMethod , DirectEvent, Static DirectMethod
    By syllabusarq in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 01, 2011, 11:37 AM
  5. [CLOSED] Static DirectMethod
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 21
    Last Post: Jun 03, 2010, 12:42 AM

Tags for this Thread

Posting Permissions