11

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.

Charles
  • 50,943
  • 13
  • 104
  • 142
dave
  • 1,043
  • 1
  • 10
  • 18
  • 1
    What advantage are you looking for in such an approach? When you say CMS, I assume you mean a web based CMS. Regardless of the server side software, your CMS would still respond to HTTP requests, generate html and return that to the client, right? So how would an event driven CMS help in that process? – marcvangend Sep 14 '10 at 12:16
  • I took the liberty of putting your update into a quote block and un-bolding it. Feel free to roll back if you don't like it. – Pekka Sep 15 '10 at 09:16
  • What language would you use then? @Georg, how perceptive of you!!! :) I find it reasonable to ask when all the examples given are client side languages and I far as I know PHP doesn't dispatch events, without the help of any additional library. Furthermore, with a reputation of 17k & over , you should be able to bring some answers to the question yourself, shouldn't you? So, Georg, what language do you think Dave should use? – PatrickS Sep 14 '10 at 10:47
  • First of all, the OP clearly indicates that his question is language independent, so your question is not really relevant. Second, I think Georg meant to say that your question should have been a comment to the original post, not an answer. – marcvangend Sep 14 '10 at 12:48
  • I still feel it is a fair question. Had the OP given examples of server side languages using event dispatching , my question would have been totally irrelevant. I'm genuinely interested in getting an answer & I think it may have been far more interesting for Dave to read about answers to my question , rather than read the current comments, wouldn't you agree? – PatrickS Sep 14 '10 at 13:06
  • Hi, Let's say I use PHP. Also please read the edit in my question for additional clarifications. Also, I hope you guys don't mind deleting your comments, just for the sake of future readers. Patrick already got your point. Just so future readers can read through the meat more easily. I'll delete this one eventually too. – dave Sep 14 '10 at 17:36

2 Answers2

6

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 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.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • +1. Plugin (hook) infrastructure sounds good and self-explanatory. The wiki is quite clear on what "event-driven": http://en.wikipedia.org/wiki/Event_driven_programming . And there's no main loop in PHP :) – back2dos Sep 15 '10 at 08:21
  • I concur, Drupal and Wordpress easily become big slow fat elephants as you add more and more modules/plugins. I've seen sites with hundreds of modules/plugins that have to be scaled with multiple servers, load balancers and front caches because the CMS can't keep up with just a few visitors. Adding features is so easy for website designers and for developers is so easy to leverage other modules (I've seen very simple drupal modules with dozen of dependencies, now imagine you install a dozen of those). – MV. Oct 12 '13 at 12:52
1

What exactly do you mean by "event driven"? Does it mean, that clients can watch content and will be notified, when it is updated?

If so, than this is really a great idea, but the implementation is an ambitous undergoing. The clear disadvantage is, that there are tons of things, that can go wrong, while a request based model is much simpler and thus more robust.

back2dos
  • 15,588
  • 34
  • 50
  • It means the "internals" of the CMS are event-driven, just like Drupal does it. The core defines events and plugins can respond to them to add their own logic. – dave Sep 14 '10 at 17:32