本地或临时数据可以用URL表示吗? [英] can local or transient data be represented by URLs?

查看:130
本文介绍了本地或临时数据可以用URL表示吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一点理论问题,虽然它来自一个现实世界的问题,当在单一的页面应用程序中创建各种对象而不立即坚持(见下面的链接)。

A bit of a theoretical questions, although it comes from a real world problem when creating various objects in a single page app without immediately persisting them (see link below).

我的问题是本地或非空白数据是否可以有一个URL。我认为它可以,因为在创建对象时(不一定保持),它确实存在,因此可以导航到。因此,只要输入数据就可以输入URL。后退和Fwd按钮也应该工作。如果您刷新浏览器并再次输入URL,您将获得404,这实际上是有意义的:找不到资源(不再)。

My question is whether local or unpersisted data can have a URL. I think it can, because at the time the object is created (not necessarily persisted) it does exist and thus can be navigated to. So, entering the URL for it should display it as long as the data is there. Back and Fwd buttons should also work. If you refresh the browser and enter the URL again, you will get a 404, which actually makes sense: "resource not (no longer) found".

真实世界这里的例子是,您应该能够在记分应用程序中输入完整的分数列表,并能够在持续存在之前导航个人分数。 EmberJS Fixtures是一个例子,其中新对象永远不会被写入磁盘,但是它们被创建并且具有URL。所以,在这种情况下,我正在谈论纯内存对象/资源,而不是本地存储。

The real world example here is that you should be able to enter a whole list of scores in a scorekeeping app and be able to navigate the individual scores before persisting them. EmberJS Fixtures are an example where new objects are never really written to disk but they are created and they do have URLs. So, in this case I'm talking about purely in-memory objects/resources, not local storage.

相关问题此处

推荐答案

认为创建的本地数据实体,但 isDirty 仍然可以具有任何UUID的URL,只要控制器真的需要路由类似 / flowers_tmp /:flowers_id 。不持续的数据属于控制器?

I think a local data entity that was created, but isDirty still, could have URL with any UUID, considering that only controller is really needed to route something like /flowers_tmp/:flowers_id. Non-persisting data belongs to controller?

这篇关于本地或临时数据可以用URL表示吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆