What is the disadvantage of DWR?

前端 未结 6 788
栀梦
栀梦 2021-02-13 21:34

While using DWR in a intranet, will disadvantages like perfomance or security issues occur? Direct web remoting is a tool which uses Ajax request to contact a server from a js f

6条回答
  •  清酒与你
    2021-02-13 21:50

    The biggest difference among other solutions to transfer objects (marshaling) is object references.

    For instance, if you use it to transfer a tree:

    A

    |-B

    |-C

    in a list {A,B,C}:

    B.parent = A C.parent= A

    then A is the same object in Javascrit!

    On the bad side, if you have complex structures with circular dependencies and lot of objects: A<-B, B<-C, C<-B, C<.A,... it could crash.

    Anyway, I use it in a real project used by many hundreds of companies in production to transfer thousands of objects to a single html page in order to draw a complex graph and it works nicely with a good performance.

提交回复
热议问题