简体   繁体   English

Backoffice Java客户端框架-Deman上的负载

[英]Backoffice java client framework - load on deman

We are building our new Next generation server for a medium sized back office application. 我们正在为中型后台应用程序构建新的下一代服务器。 We already decided we would like to use a java framework for the client side (gwt \\ vaadin \\ zkoss) 我们已经决定要在客户端使用Java框架(gwt \\ vaadin \\ zkoss)

What we would like now is to create a Proof Of Concept example of each technology. 我们现在想要的是为每种技术创建一个概念证明示例。

our back office ui is pretty standard, we have tables \\ grids with filters that should show entries straight from the DB. 我们的后台用户界面非常标准,我们有带有过滤器的表\\网格,这些过滤器应直接显示来自数据库的条目。

Problem is we got huge amount of rows in each table (1M minimum) which mean that we must use a load on demand tables for them. 问题是我们每个表中都有大量的行(最少1M),这意味着我们必须为它们使用按需负载表。

My questions is: how do i implement a load on demand table for my big tables? 我的问题是:如何为大表实现按需负载表? I looked around and saw the following concept again and again: 我环顾四周,一次又一次看到以下概念:

you create a container, you populate it with data, the data is being displayed on the client side. 创建一个容器,然后用数据填充它,数据将显示在客户端。

problem is i tried this naive way to populate the containers with 1M entries and it was awful. 问题是我尝试过这种幼稚的方法来用1M条目填充容器,这太糟糕了。 are there any built in on demand containers?> 有内置的按需容器吗?

any code examples \\ references will be a huge help! 任何代码示例\\引用都会有很大的帮助!

You would want to use GWT Cell Table , which has the AsyncDataProvider , that lets you handle the user's paging and sorting events by grabbing data from your server. 您可能想要使用具有AsyncDataProvider GWT单元表 ,该使您可以通过从服务器中获取数据来处理用户的分页和排序事件。

It also provides an alternative ListDataProvider , which lets you grab your data as a list of objects, then set that data to your table. 它还提供了一个替代的ListDataProvider ,它使您可以将数据作为对象列表获取,然后将其设置到表中。 If you use ListDataProvider , you have to define how to sort your objects with Comparator s, and table will handle sorting and paging against that list. 如果使用ListDataProvider ,则必须定义如何使用Comparator对对象进行排序,并且table将根据该列表进行排序和分页。

Google "gwt celltable asyncdataprovider example" for more examples and tutorials. Google的“ gwt celltable asyncdataprovider示例”提供了更多示例和教程。

Vaadin has a nice concept of lazy loading data in most of the components. Vaadin有一个很好的概念,可以在大多数组件中延迟加载数据。 For example the table, list, dropdown's etc. have that concept. 例如表,列表,下拉列表等具有该概念。

The only thing you realy need to know at start, is the number of total rows. 开始时,您真正需要知道的唯一一件事是总行数。 Everything else can then be handled "ondemand". 然后可以“按需”处理其他所有内容。

For example the Table component initially only loads about 30 rows (can be customized) and then fetches rows as needed. 例如,表组件最初仅加载约30行(可以自定义),然后根据需要获取行。 (Or better they are usually fetched just before the user scrols to the next rows) (或者更好的是,它们通常在用户滚动到下一行之前获取)

A example is this demo 这个演示就是一个例子

http://demo.vaadin.com/dashboard/#!/transactions http://demo.vaadin.com/dashboard/#!/transactions

How you retrieve the data from your backend depends on the technology used. 您如何从后端检索数据取决于所使用的技术。 But vaadin has working concepts where you don't need to load all 1mio. 但是,vaadin具有工作概念,您无需全部加载1mio。 rows into memory, it will handle the "fetch on demand" as the rows need to be displayed. 将行存储到内存中,因为需要显示行,所以它将处理“按需获取”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM