I tried to came up with a cool title for this hot spring day, so I hope this is cool enough ;-)
Event is triggered on a specific occasion. It can be specific timestamp (wildcards are possible) or any kind of manipulation with entity/attrib/relation type or even specific entity/attrib/relation.
Main purpose of an event is to launch associated script (set of commands) in a Cue scripting language, described earlier in this blog.
My first hunger for events was in my early project (2007), where everything was hardcoded. And except nobody has an idea how it actually works, when something was wrong, it was pain to correct it. For the next version I designed (in my head) a way, how to make it editable. Unfortunately there was nobody willing to pay the development, so the idea stayed just in my head.
I don't need any bells or whistles, I just need a tool for designing a list of consecutive commands and some minor evaluating on the way. It's like "when this, do that".
For timing events there will be a cron or a job (mostly every day or every hour), for data manipulation there will be some hooks hardcoded into CRUD methods. Nevertheless, the system has to be detachable, because I want to have system of independent layers (as I hate to execute unnecessary code over and over again).
And what is so cool about those events? I won't have to hardcode specific behavior any more, I'll just set a trigger (event) and write some commands to be executed. And that pays off.
No comments:
Post a Comment