Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions for maintaining the Event class #66

Merged
merged 7 commits into from
Jul 26, 2018
Merged

Suggestions for maintaining the Event class #66

merged 7 commits into from
Jul 26, 2018

Conversation

hwonyo
Copy link
Contributor

@hwonyo hwonyo commented Jun 11, 2018

I suggest Maintain Event Class separately

  • This separation makes code more suitable for object-oriented.
  • This is more efficient way to maintain and expand code for new webhook event
  • And modify features in each class efficiently.

With this separation we can clarify what we have to do for a new Event class from the facebook.
Only 3 steps are required

  1. Add new event class.
  2. Add new event handler.
  3. Add new logic in event_parser & handle_webhook
    + test code

Here is an example of adding a new class.

  • target class: messaging_game_plays
  • reference: link
  1. step1: Add new event class for messaging_game_plays. --> GamePlayEvent
  2. step2: Add a event handler for the GamePlayEvent. --> handle_game_play
  3. step3: Add elif for the game_play handler. --> in event_parser & in hadle_webhook

@coveralls
Copy link

coveralls commented Jun 11, 2018

Coverage Status

Coverage increased (+2.8%) to 92.458% when pulling c4e7090 on HwangWonYo:modify_event into 4209c19 on conbus:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+2.8%) to 92.458% when pulling c4e7090 on HwangWonYo:modify_event into 4209c19 on conbus:master.

@hwonyo hwonyo changed the title Modify event Suggestions for maintaining the Event class Jun 11, 2018
@kimwz kimwz merged commit 8ff3fa4 into conbus:master Jul 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants