mkrause/gx — pull request #44 by Rdebokx (2013-06-17 17:43:28+00:00)
Title: BaseModelEvent refactoring

In this pull request I've refactored the BaseModelEvent to have CollaborativeObject as target. This enables us to simplify the fireEvent(Event) methods in EventTarget and CollaborativeObject. Previously, part of the CollaborativeObject fireEvent functionality was in EventTarget and the other half was in CollaborativeObject, because putting all the functionality in either of them was even more illogical and needed even more type casting.

I thought it would be better to refactor it this way, because I belief that there is a design flaw in the JS lib as it is presented in the Realtime Reference. This is because, as for the current implementation of the JS lib, all BaseModelEvents are fired on CollaborativeObjects (as far as I know). Moreover, alle Events that are not BaseModelEvents (such as CollaboratorJoinedEvent and UndoRedoStateChangedEvent) are not fired on CollaborativeObjects. So in effect, I think BaseModelEvents should only contain CollaborativeObjects as target.

So in short: I think this pull request alters the design slightly in such a way that it more logical and enables us to keep our code maintainable.