If I have an object with a related file folder and I delete the object, I want its file folder deleted too. So if I need to do these steps:
- Dispatch event to delete folder with the object parameter
- Delete object from DB
Will the event handler run and complete its code before step 2 and return to start step 2 or in parallel with it?
And are events worth the effort and resources in such cases? The code is cleaner but that’s about it. On the other hand I have to write 5 times more code for all event classes and their instantiators and event handlers. To write a single method in the object class to delete the folder is much quicker to me.