事件驱动的CMS - 优点和缺点优点、缺点、事件、CMS

2023-09-08 11:24:53 作者:七味流苏

我试图找出一些优点,并具有CMS是事件驱动的利弊。

事件驱动的情况并不少见。你看它像ActionScript中,JavaScript的,jQuery的许多脚本语言,涉及的客户端。怎么样在一个CMS所在的事件及其应对发生在服务器上。也许这种做法有哪些优势和劣势,以及什么其他的方法都存在,人们可能preFER更多。

P.S。请注意,我使用ActionScript,JQ和JS仅作为示例。你知道,当说起CMS这样,事件的答复都是服务器端的东西。

  

修改:我看到很多人说,这是没有意义的使用事件驱动的,因为他们不明白那是什么。一位已经使用这种方法Drupal的,所以相信我,这是一种存在方式,我不拉出出主意我答了它只​​是意味着CMS(所有的服务器端的东西)的内部的CMS系统是事件驱动的。核心做的事情,并定义事件。插件可以响应这些事件来增加自己的逻辑。我mentione动作脚本,例如,因为客户端就是这个概念是最知名的,但它可以在服务器端也是如此,只是也许没有相关的正常应用,因此没有已知的。但它是有道理的,像一个CMS更复杂的东西,而其他开发商想增加自己的插件甚至改变了pre-建于CMS的逻辑。

解决方案

您确定事件驱动是正确的术语吗?

我想你所谈论的是一个插件,挂钩的基础设施,可以让插件来当一个事件发生(钩被触发)采取行动。

我所知道的是事件驱动是当用户界面元素的桌面应用程序商店的事件,就像JavaScript可以为HTML元素做。桌面应用程序是完全建立的方式。这是无法实现的基于Web的PHP,因为它完全是面向请求。

不管怎样,我明白你的意思了。有迹象表明,这个在一定程度上的CMS和框架 - 字preSS例如和的Dokuwiki

在Word中preSS,这些事件被称为行动。你可以看到一个完整的列表中道preSS插件API 。

在DokuWiki的,他们确实是被称为事件: DokuWiki的事件系统

另外:

  

我试图找出一些具有被事件驱动的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.