我应该将图像的字节数组与实体一起带来吗? - 里亚尔服务

发布于 2024-10-24 19:12:42 字数 144 浏览 3 评论 0原文

我有近 100 个实体,每个实体都有 byteArray 的自定义属性,它是图像的实际字节数组。我的问题是我应该将字节数组也与实体一起带来,还是应该发出 100 个请求(每个实体的每个请求),以便用户在下载其他字节数组时至少可以看到一些内容。

提前致谢 :)

I have near about 100 entities and each entity has custom property of byteArray which is the actual byte array of the image. My question is should i bring the byte array also along with the entities or should i make 100 requests(each request for each entity) so that the user can atleast see something while the other bytearrays are being downloaded.

Thanks in advance :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

想你只要分分秒秒 2024-10-31 19:12:42

仔细考虑应用程序的要求并据此做出决定。 byte[] 有多大?接收应用程序实际上会用这些做什么?一次全部显示还是按需显示?它们最初会显示为缩略图吗?

您的决定不仅仅是是否包含 byte[]...根据实际要求,您可以将 byte[] 作为单独的实体,可以通过在用户滚动时向该集合发出分页请求来检索这些实体通过一些清单。或者您可以决定创建单独的实体来表示图像的缩略图。有很多选择...

Think through the application requirements and make a decision based on that. How big are the byte[]s? What will the receiving app actually do with these? Display them all at once or on-demand? Will they be displayed initially just as thumbnails?

Your decision isn't just whether or not to include the byte[]... depending on the actual requirements, you could put the byte[]s as seperate entities which can be retrieved by making paged requests to that collection as the user scrolls through some list. Or you could decide to create seperate entities to represent thumbnails of the images. Lots of options...

财迷小姐 2024-10-31 19:12:42

我不建议将图像与数据一起加载。您应该将其分成多个负载。首先显示信息,然后根据需要异步加载图像。

I wouldn't recommend loading the images along with the data. You should break it apart into multiple loads. Display the information first and then have the images load asynchronously as they are needed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文