创建、批准、编辑、批准网站内容模式
我正在修改一个网站以允许用户输入内容。但是,一旦他们创建了该内容,就需要先获得批准才能发布。通过在该内容的记录中设置“中等”位,可以很容易地实现这一点,并且只需要一个表。
现在我还想允许用户像 StackOverflow 上一样编辑内容。但是,每次编辑都需要经过批准并存储,以便可以查看编辑历史记录。
在编辑等待批准时阻止对“实时”记录进行编辑是可以接受的,因此等待编辑的冲突不是问题。
我的目的是将每个项目的先前版本的集合保留在一个单独的表中,并将待处理的编辑放在该表中,直到批准/拒绝,然后如果批准则与主表中的记录交换。
谁能看出这个模式有什么缺陷吗?你能想出更好的方法来做到这一点吗?
虽然我认为这不相关,但我使用 C# 和 ASP.NET MVC 和 SQL Server 作为数据存储。
I'm working on a modification to a site to allowing users to enter content. However, once they've created that content it needs to be approved before it can be published. This is fairly easy to achieve by having a "moderate" bit set in the record for that content and only one table is needed.
Now I also want to allow users to edit the content much like here on StackOverflow. However, each edit needs to be approved as well as being stored so that a history of edits can be viewed.
It is acceptable to prevent editing to the "live" record while an edit is pending approval so conflict of pending edits is not an issue.
My intention is to keep the collection of previous versions of each item in a separate table and have the pending edit sit in this table until approved/rejected and then if approved swapped with the record in the main table.
Can anyone see any flaws in this pattern? Can you think of a better way to do this?
Although I don't think that it's relevant I'm using C# with ASP.NET MVC and SQL Server as the data store.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我脑子里唯一想到的就是时机。
如果编辑时间紧迫,例如促销或优惠,那么审批流程也需要非常迅速。
您可能需要考虑构建电子邮件功能或优先级标志,以便及时批准编辑。
另一个考虑因素(我不知道时间是否允许)可能是合并 Windows Workflow Foundation。您可以将编辑记录 ID 附加到工作流程项目,然后由该工作流程项目处理审批的及时性。
这还意味着,如果审批者不在,其他人可以接听它,因为它是一个具有队列的工作流程项目,如果您是队列成员,您将看到它。
我知道这需要做很多工作,但我认为比仅仅依靠某人来批准变更更好的解决方案。
About the only things that springs to my mind is timing.
If the edit is time critical, like a promotion or offer, then the approval process will need to be pretty snappy also.
You may want to consider building in an email function, or priority flag, so that edits can be approved in a timely manner.
One other consideration, and I don't know if time allows for this, is to maybe incorporate Windows Workflow Foundation. You could attach the edit record id to a workflow item that then handles the timeliness of the approval.
It also means that if an approver is away, that someone else could pick it up as it's a workflow item that has a queue and if you are a member of the queue you'll see it.
I know that's a heck of a lot more work but I think a better solution than just relying on someone to come along and approve the change.
怎么样:
我知道有一个网站是做这个的。我个人觉得很烦人。我希望他们这样做:
What about something like this:
I know a website that does this. I personally find it very annoying. I wish they'd do it like this:
我曾与一些主要的商业 CMS 合作过,我不记得他们的任何工作流程在批准后创建内容的物理副本。不过,我认为这是一个诱人的想法。您希望防止未经批准的内容泄露到公开场合等,但我认为这样做没有很好的技术理由(除非您期望内容如此之多,以至于将其划分为已发布和未发布的集合具有性能优势) 。
我不认为你的方法有什么特别错误的地方。但你无缘无故地复制数据。
I have worked with a few of the major commercial CMS, and I don't remember any of their workflows creating a physical copy of the content when it is approved. I can see that it is a tempting idea, though. You want to prevent unapproved content from leaking out into the open, etc, but I don't think there is a good technical reason for doing that (unless you expect so much content that partitioning it into published and unpublished sets has a performance benefit).
I don't think that there is anything particularly wrong with your approach. But you are duplicating data for no good reason.