DEV Community

Cover image for Design Patterns for Web Development

Design Patterns for Web Development

May on November 03, 2020

There are times where building a design structure for your project might seem daunting when you don't know how to start. Knowing design patterns ca...
Collapse
 
weasnerb profile image
Brian Weasner

If you want to use observers and need more than just a simple publish and subscribe, I highly recommend #rxjs. It's heavily used by #angular folks, but it can be used in vanilla js projects as well.

Collapse
 
geni94 profile image
geni94

Well if you want to build a "simple" web app, you simply don't use Angular lol.

Collapse
 
meyruiz profile image
May

Hi Brian, thanks for the recommendation! Will definitely give it a try

Collapse
 
kvstepanov profile image
Kirill Stepanov • Edited

Great article, thanks! Would be nice to extend the list with something like Facade, Factory, Adapter, for example. Maybe we could use the thread to post useful patterns?

UPD: I overlooked the link at the end of the article.

Collapse
 
aalphaindia profile image
Pawan Pawar

Thanks for the information!!

Collapse
 
yurieastwood profile image
Yuri Eastwood

Nice article! Cool introduction to some heavily used patterns.
Thanks for sharing!

Collapse
 
jmaicaaan profile image
JM Santos

Thanks for the great article! I wonder how we can apply these patterns without using some classes so I can apply it to some of my React code. :)

Collapse
 
avinash8847 profile image
Avinash

I have tried to implement pub-sub pattern in react in this article dev.to/avinash8847/publisher-subsc...

Collapse
 
nirbhayparmar profile image
Nirbhay Parmar

Can you explain about iterative design pattern?

Collapse
 
meyruiz profile image
May

Hi Nirbhay! The iterative pattern lets you traverse a collection of items without specifically exposing how this collection is structured. Imagine this collection being a tree that you could traverse either using a depth-first or breadth-first approach. The "getNext()" function iterator will work differently depending on the approach. This is not exposed, so the objects calling the iterator just care about getting the next element but they don't know which structure is used or how it is traversed.

I hope I can work on other design patterns next, but for now, you can check this resource: refactoring.guru/design-patterns/i...
And also I recommend Christopher Okhravi's explanations since they are very good and complete: youtube.com/watch?v=uNTNEfwYXhI

Collapse
 
nirbhayparmar profile image
Nirbhay Parmar

Thank you @may for this answer, very useful.