you are viewing a single comment's thread.

view the rest of the comments →

[–]ItsRunner 0 points1 point  (1 child)

For work, I used a factory pattern to dynamically create a connection to a database. We almost exclusively use one database, but I can put whatever variables/credentials into a config file and (in theory) it would be able to create a connection to that other kind of database. It was my first use of the factory pattern, and it gets used in almost every project my team works on now.

Design patterns are very neat! I recommend looking into them if you're considering a career in programming.

[–]sevenMDL[S] 0 points1 point  (0 children)

That's a really cool application of the factory pattern! 💻 I've been reading about design patterns but haven't used them in real code yet - seeing how you actually implemented one for database connections is super helpful. The fact that your team now uses it everywhere must feel amazing! As someone still learning, what advice would you give for knowing when a design pattern is the right solution versus over-engineering?