You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of having a single Event type, with a long conditional chain that decides what properties to add based on the type of event, we could have a bunch of subclasses of Event for different types, with a constructor that would take even JSON data and return an Event instance of the appropriate subtype (or just an instance of Event of the type is unknown).
Because of the number of classes this would add, it might be appropriate to put them in their own chatexchange.events module. But maybe not.
This would be particularly valuable if we ended up implementing an interface as discussed in #43, where different event types would not just have different static attributes but would have different methods as well.
The text was updated successfully, but these errors were encountered:
Instead of having a single Event type, with a long conditional chain that decides what properties to add based on the type of event, we could have a bunch of subclasses of Event for different types, with a constructor that would take even JSON data and return an Event instance of the appropriate subtype (or just an instance of Event of the type is unknown).
Because of the number of classes this would add, it might be appropriate to put them in their own
chatexchange.events
module. But maybe not.This would be particularly valuable if we ended up implementing an interface as discussed in #43, where different event types would not just have different static attributes but would have different methods as well.
The text was updated successfully, but these errors were encountered: