RequestFactory theory: Why is Locator<>.find() being called so often?

前端 未结 1 635
孤城傲影
孤城傲影 2020-12-28 22:52

I\'m new to RequestFactory but with generous help of Thomas Broyer and after reviewing documents below it\'s getting much better :)

  • Getting Started with Reques
相关标签:
1条回答
  • 2020-12-28 23:27

    The pairs of getId and find at the end are the default implementation of Locator#isLive: it assumes an object is live (i.e. still exists in the data store) if finding it by its ID returns a non-null value.

    RF checks each EntityProxy it ever seen during the request/response for their liveness when constructing the response, to tell the client when an entity has been deleted (on the client side, it'd then fire an EntityProxyChange event with a DELETE write operation.

    You can of course override isLive in your Locator with a more optimized implementation if you can provide one.

    0 讨论(0)
提交回复
热议问题