Decorator vs Class-based Namespaces #903
-
Its a bit unclear from the documentation what are the pros and cons of using decorator-based vs using class-based namespaces; I would love to hear what usecases and contexts warrant one over the other, if any. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
It's just a matter of preference, really, because both methods are equivalent. |
Beta Was this translation helpful? Give feedback.
-
@miguelgrinberg - a followup question - is it correct that in the decorator approach, registration occurs by the prefix of the decorator, i.e. if I want to attach two events to different servers I would do something like:
|
Beta Was this translation helpful? Give feedback.
It's just a matter of preference, really, because both methods are equivalent.