Skip to main content



      Home
Home » Modeling » EMF » HOWTO? Lazily Loading HUGE References(Can I have a Proxy for the reference, not a List of Proxies for the contents?)
HOWTO? Lazily Loading HUGE References [message #1707982] Fri, 11 September 2015 04:11 Go to next message
Eclipse UserFriend
Hi all,
we're aiming at a Client/Server application based on EMF. In this szenario, we would like to view "Contracts" that have a HUGE number of "ContractItems". Fortunatly, in most cases users only want to see "Contract" and don't care about "ContractItems".

In order to reduce system load we decided to lazily load "ContractItems". For this we saw two sollutions:

1) On the server, instantiate Contract and all ContractItems. Put the contract in one resource and the items in the other resource. Serialize the ContractResource and return it to the client.. The client recieves a list with proxies. When resolving the first proxy it loads the resource with all ContractItems into its local ResourceSet. Further proxy resolution uses this resources and does not need server interaction anymore.

2) Make an "intermediate node" in the EMF model that "contains" the ContractItems. On the initial request for the "Contract" data, build this intermediate node, link it to the "Contract" node and put both into seperate resources. Seralilize the ContractResource and return it to the client. The client receives a "Contract" node with a proxy to the "intermediate" Node. When resolving this proxy, the server fills the intermediate node with all ContractItems and returns it to the client.

Solution 1) requires data access for each ContractItem even on the initial request, even when only Contract information is required; this is overhead.

Solution 2) introduces an "intermediate node" just for Client/Server (=ProxyResolving) purpose which should not be part of a Domain Model.
[Solution 2 can be amended by "hiding" the intermediate node using a derived relation on the Contract node into the ContractItems that gets the intermediate node's relation, thereby resolving the intermediate node's proxy. Still, the ecore model has to provide the intermediate node]

The Question

Is there a more satisfying solution?

(It would probably require references to have a URI. If this were the case, the whole list can be proxied (=1 Proxy) instead of being a List of Proxies (=n proxies).

Kind regards
Bernhard
Re: HOWTO? Lazily Loading HUGE References [message #1707991 is a reply to message #1707982] Fri, 11 September 2015 05:33 Go to previous messageGo to next message
Eclipse UserFriend
If you are using the DBStore, you could select only the items that have the type you want.

Bernhard Anzeletti wrote on Fri, 11 September 2015 10:11
Hi all,
we're aiming at a Client/Server application based on EMF. In this szenario, we would like to view "Contracts" that have a HUGE number of "ContractItems". Fortunatly, in most cases users only want to see "Contract" and don't care about "ContractItems".

In order to reduce system load we decided to lazily load "ContractItems". For this we saw two sollutions:

1) On the server, instantiate Contract and all ContractItems. Put the contract in one resource and the items in the other resource. Serialize the ContractResource and return it to the client.. The client recieves a list with proxies. When resolving the first proxy it loads the resource with all ContractItems into its local ResourceSet. Further proxy resolution uses this resources and does not need server interaction anymore.

2) Make an "intermediate node" in the EMF model that "contains" the ContractItems. On the initial request for the "Contract" data, build this intermediate node, link it to the "Contract" node and put both into seperate resources. Seralilize the ContractResource and return it to the client. The client receives a "Contract" node with a proxy to the "intermediate" Node. When resolving this proxy, the server fills the intermediate node with all ContractItems and returns it to the client.

Solution 1) requires data access for each ContractItem even on the initial request, even when only Contract information is required; this is overhead.

Solution 2) introduces an "intermediate node" just for Client/Server (=ProxyResolving) purpose which should not be part of a Domain Model.
[Solution 2 can be amended by "hiding" the intermediate node using a derived relation on the Contract node into the ContractItems that gets the intermediate node's relation, thereby resolving the intermediate node's proxy. Still, the ecore model has to provide the intermediate node]

The Question

Is there a more satisfying solution?

(It would probably require references to have a URI. If this were the case, the whole list can be proxied (=1 Proxy) instead of being a List of Proxies (=n proxies).

Kind regards
Bernhard

Re: HOWTO? Lazily Loading HUGE References [message #1708109 is a reply to message #1707982] Sun, 13 September 2015 10:08 Go to previous message
Eclipse UserFriend
Bernhard,

Have you considered using CDO?


On 11/09/2015 10:11 AM, Bernhard Anzeletti wrote:
> Hi all,
> we're aiming at a Client/Server application based on EMF. In this
> szenario, we would like to view "Contracts" that have a HUGE number of
> "ContractItems". Fortunatly, in most cases users only want to see
> "Contract" and don't care about "ContractItems".
>
> In order to reduce system load we decided to lazily load
> "ContractItems". For this we saw two sollutions:
>
> 1) On the server, instantiate Contract and all ContractItems. Put the
> contract in one resource and the items in the other resource.
> Serialize the ContractResource and return it to the client.. The
> client recieves a list with proxies. When resolving the first proxy it
> loads the resource with all ContractItems into its local ResourceSet.
> Further proxy resolution uses this resources and does not need server
> interaction anymore.
>
> 2) Make an "intermediate node" in the EMF model that "contains" the
> ContractItems. On the initial request for the "Contract" data, build
> this intermediate node, link it to the "Contract" node and put both
> into seperate resources. Seralilize the ContractResource and return it
> to the client. The client receives a "Contract" node with a proxy to
> the "intermediate" Node. When resolving this proxy, the server fills
> the intermediate node with all ContractItems and returns it to the
> client.
>
> Solution 1) requires data access for each ContractItem even on the
> initial request, even when only Contract information is required; this
> is overhead.
>
> Solution 2) introduces an "intermediate node" just for Client/Server
> (=ProxyResolving) purpose which should not be part of a Domain Model.
> [Solution 2 can be amended by "hiding" the intermediate node using a
> derived relation on the Contract node into the ContractItems that gets
> the intermediate node's relation, thereby resolving the intermediate
> node's proxy. Still, the ecore model has to provide the intermediate
> node]
>
> The Question
>
> Is there a more satisfying solution?
> (It would probably require references to have a URI. If this were the
> case, the whole list can be proxied (=1 Proxy) instead of being a List
> of Proxies (=n proxies).
>
> Kind regards
> Bernhard
Previous Topic:Two Packages in Ecore model and their relation
Next Topic:[CDO] CDOResource allowed characters
Goto Forum:
  


Current Time: Tue Jul 08 00:04:42 EDT 2025

Powered by FUDForum. Page generated in 0.04302 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top