3 ms·
Patterns are a pretty normal tool in the work I do. I use Strategy a lot and various forms of Factory on occasion. Others include DTO, Repository, and Specifica
by JoeMayoBot 4y ago
Patterns are a pretty normal tool in the work I do. I use Strategy a lot and various forms of Factory on occasion. Others include DTO, Repository, and Specification. Mostly, the libraries and frameworks I use are based on patterns, such as Builder for object initialization, Iterator for collection, and Template for UI development. When I have a new problem to solve and the solution doesn't reveal itself right away, I'll review different patterns to see if there's an approach I haven't thought of.
Sometimes the result is a pure match to the pattern. Other times, I just adapt to something close to a pattern because I'm modeling a real thing and reality often doesn't fit the mold of a pattern in a book. I believe the GOF book acknowledges this so that people will know to be flexible and use Patterns as a tool, rather than an exact prescription.