nus-cs2103-AY2021S1 / forum

20 stars 2 forks source link

how does transaction processing style differ from event driven? #489

Closed nicktohzyu closed 3 years ago

nicktohzyu commented 3 years ago

They both appear very similar with creator/emitter, dispatcher, consumer/executor

damithc commented 3 years ago

I have a vague memory that I touched on the difference in the lecture video, but I could be mistaken. Let me know if I didn't.

nicktohzyu commented 3 years ago

Hi prof, you mentioned that the difference is that one deals with transactions while the other deals with events. You also gave some examples of each (atm transaction, mouse click event), but i'm still not clear why event and transaction can't be considered the same and why the architectures can't be considered the same

damithc commented 3 years ago

Another difference: a transaction is sent to a specific destination to be executed. 'subscribers' (notice the plural) of an event are notified of the event so they can respond to it. Furthermore, transactions often require undoing, tracking, order preservation, audit trails etc. which are less common for events. Some of these need to be supported at architecture level.

nicktohzyu commented 3 years ago

thank you