You got it .... let's discuss a bit more on design patterns here.....😁
For further actions, you may consider blocking this person and/or reporting abuse
You got it .... let's discuss a bit more on design patterns here.....😁
For further actions, you may consider blocking this person and/or reporting abuse
Saurabh Rai -
Rohrig -
ndesmic -
Cruip -
Once suspended, sharadcodes will not be able to comment or publish posts until their suspension is removed.
Once unsuspended, sharadcodes will be able to comment and publish posts again.
Once unpublished, all posts by sharadcodes will become hidden and only accessible to themselves.
If sharadcodes is not suspended, they can still re-publish their posts from their dashboard.
Once unpublished, this post will become invisible to the public and only accessible to Sharad Raj (He/Him).
They can still re-publish the post if they are not suspended.
Thanks for keeping DEV Community safe. Here is what you can do to flag sharadcodes:
Unflagging sharadcodes will restore default visibility to their posts.
Top comments (7)
I... Love the observer pattern.
I just find it so satisfying and elegant...
I don't use it with React because it's not needed, but with vanilla JavaScript when something needs an active "watcher" relationship to something else. Or in C# with events and delegates (which are basically the observer pattern).
Sidenote: I find it different to the pubsub pattern. For me pubsub is more like "I'll broadcast something and I don't care who is listening or why". Whereas observer seems like a more cohesive relationship to me. "This event is important, someone is exclusively interested. I'll notify them directly."
Cool
Null object is definitely really cool!
I usually try to avoid using too many patterns - they can be really handy in a pinch, but most of my projects are pretty small, so I usually just try to pay attention to SRP and make sure things are small and composable. I've been slowly adopting more functional patterns, too, and I find that helps simplify things quite a lot.
I suppose the big one I tend to use is the façade pattern (helps with SRP). Others I've used a fair bit are Observable, along with a slightly-modified Service Locator (to get rid of the need to cast the results).
That's nice
I haven't had much opportunity to use it, but I think the state pattern is really cool. Has anyone here ever used it?
Not me
My personal favourite is NULL PATTERN cause it saves me from writing extra code for handling exceptions and errors... What about u ?