Intermodular message transmission mechanism based on event bus

2014 
The invention relates to the programming technology, in particular to a message transmission method for different functional modules, with an aim of solving the problem of serious intermodular coupling during the prior software programming. The invention provides an intermodular message transmission mechanism based on an event bus. The intermodular message transmission mechanism comprises the following steps: firstly, subscription functions for various events are obtained and labeled in subscriber categories, and a subscriber registers an event with the event bus; secondly, after the event bus performs the event registration, a labeled subscription function in a registered object is found through a reflex mechanism, and a subscriber object is generated; thirdly, a subscription event is considered as a key, a map is used for maintaining subscriber information, and the subscriber information includes the subscriber object, a callback event function and an event type; finally, the subscriber object is analyzed through the reflex mechanism, an event execution mode is determined according to a Method name called back by the callback event function, and the map is traversed for event dispatch. The invention applies to the programming field.
    • Correction
    • Source
    • Cite
    • Save
    • Machine Reading By IdeaReader
    0
    References
    0
    Citations
    NaN
    KQI
    []