I don't understand how to implement event system different from event receiver version

Started by
-1 comments, last by AlexanderAntonov 11 years, 4 months ago
Hi, i'm new here, and to programming too.
I hope someone could give me dangling pointer.

I've seen implementations of event system of two types:
based on event receiver, and based on event/subscriber method.

Althrough i clearly see the benefits from the last, i can't create complete
understanding of it.

Wait,wait, i must begin from different angle.
I must say why i don't like the idea of centralized receiver, where every change must be recompiled.

So i begin (if you're already bored, that's right, i'm quite boring person([s]and messed up in the head[/s]), please sorry for that).
I'm fan of dwarf fortress for a long time. But our relations are very unstable though. Doesn't matter.
Dwarf fortress imprinted in my mind the concept of tokens. If you're not familiar with it, ill describe:
figure a text file containing roughly the next:

[human]
[head]
[left hand]
[right hand]
and so on..
[giant]
[tough]
[slow]
[low intelligence]
etc

now imagine you change this file

[mutant_human]
[head]
[head]
[blind]
[3 legs(just shorter)]
etc

The thing is, this (most of the times) will work in game. You really can add or reduce amount of different tokens,
and game will eat this and produce some great amounts of [s]death[/s] fun.

Impressed with such flexible system i decided to use something very similiar, firstly because of independence.
And as every [s]noob[/s] genius, i ran into the wall of misunderstanding of concepts.
As topic says - i don't understand how to implement event system different from event receiver version.

I don't understand, for example, can i minimize the use of mediums in messages?
Can i directly send a message to another object, without making it heavy class?
Can such system be implemented using absract class derivation?

I know, that this is too much questions, but it's really a matter of one string to point me.
I know there are many others who run in same kind of problem, and they can help just by saying
something smart beyond reason.

This topic is closed to new replies.

Advertisement