事件驱动的CMS - 优点和缺点 [英] Event-driven CMS - advantages and disadvantages
问题描述
我试图找出一些CMS的事件驱动的优点和缺点。
事件驱动并不罕见。你可以在许多脚本语言中看到它,例如涉及客户端的Actionscript,javascript,jquery。如何在CMS中的事件及其响应发生在服务器上。这种方法有什么优点或缺点,还有什么其他方法,人们可能更喜欢更多。
请注意,我使用Actionscript,JQ和JS作为示例。您认识到,当以这种方式谈论CMS时,其响应都是服务器端的东西。
你确定事件驱动是正确的术语吗?
我想你在说的是一个插件钩子基础设施,允许插件在事件发生时触发(钩子被触发)。
我所知道的事件驱动是桌面应用程序在UI元素中存储事件,就像Javascript可以为HTML元素一样。桌面应用程序完全是这样构建的。这是永远不可能实现基于Web的PHP,因为它是完全面向请求。
无论如何,我看到你的意思。在某种程度上有CMS和框架 - 例如Wordpress和Dokuwiki。
-
在Wordpress中,这些事件被称为动作。您可以在 Wordpress插件API 中查看完整列表。
-
在DokuWiki,他们的确被称为事件: DokuWiki的活动系统< a>
此外:
我试图找出一个由事件驱动的CMS的优点和缺点。
是显而易见的:它变得更加容易钩入系统,而不必攻击核心。可以编写真正的插件。
一个大的优点是,系统趋向于变慢,长期来说有更多的钩子,并且注册的插件越多到钩子。我看到一个巨大的门户维护操作 - 删除几百个Drupal节点 - 在超快速生产服务器上占用小时,主要是因为钩子系统。
I'm trying to identify some of the pros and cons of having a CMS that is event driven.
Event driven is not uncommon. You see it in many scripting languages like Actionscript, javascript, jquery that involve a client. How about in a CMS where the events and their responses happen on the server. What advantages or disadvantages might this approach have, and what other approaches are there that people may prefer more.
P.S. Please note that I use Actionscript, JQ, and JS as an example only. You realize that when talking about a CMS this way, the events an their responses are all server side stuff.
Edit: I see a lot of people saying that it makes no sense to use event-driven as they don't get what it is. One of the CMS systems that already use this approach is Drupal, so trust me it's an existing way, I'm not pulling ideas out of my A. It just means the "internals" of the CMS (all the server-side stuff) are event-driven. The core does its thing AND defines events. Plugins can respond to those events to add their own logic. I mentione Actionscript as an example because client-side is where this concept is most known, but it can be on the server-side too, just maybe not as relevant for normal applications and so not as known. But it makes sense for something more complex like a CMS where other developers want to add their own plugins or even change the pre-built in logic of the CMS.
Are you sure "event-driven" is the correct term for this?
I think what you are talking about is a plugin hook infrastructure that allows plugins to act when an event takes place (a hook is triggered).
What I know as "event driven" is when desktop applications store events in UI elements, just as Javascript can do for HTML elements. Desktop apps are built entirely that way. That can never be achieved in Web-based PHP because it is entirely request oriented.
Anyway, I see what you mean now. There are CMSs and frameworks that have this to some extent - Wordpress for example and Dokuwiki.
In Wordpress, these events are called actions. You can see a full list in the Wordpress Plugin API.
In DokuWiki, they are indeed called events: DokuWiki's event system
In addition:
I'm trying to identify some of the pros and cons of having a CMS that is event driven.
The pros are obvious: It becomes much, much easier to hook into the system without having to hack the core. It becomes possible to write real plugins.
One big con is that the system tends to become slower on the long term the more hooks there are, and the more plugins are registered to the hooks. I've seen a huge portal's maintenance operation - the deletion of several hundred Drupal nodes - take hours on a ultra-fast production server, mainly because of the hook system.
这篇关于事件驱动的CMS - 优点和缺点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!