Continue reading the book, this is a very good book. I suggest you to read it too.
It says:
don’t create a decorator in the first place. Wait until you see the pattern.
Yes, I totally agree. I created a decorator for user login and payload validation after I used it everywhere and found the pattern.Create the decorator if it will be used more than three times.
Okay, that also make senses. Why should I create a decorator if I only use the logic once.
Not sure if it’s twice. But three is a fair number for me.Keep the code in decorator minimum.
Too much line and logic will give me a headache when applying a decorator.
Top comments (0)