Do you use design patterns?

后端 未结 15 2209
盖世英雄少女心
盖世英雄少女心 2020-12-23 09:56

What\'s the penetration of design patterns in the real world? Do you use them in your day to day job - discussing how and where to apply them with your coworkers - or do the

15条回答
  •  醉话见心
    2020-12-23 10:51

    I find the MVC pattern really useful to isolate your model logic, which can than be reused or worked on without too much trouble. It also helps de-coupling your classes and makes unit testing easier. I wrote about it recently (yes, shameless plug here...)

    Also, I've recently used a factory pattern from a base class to generate and return the proper DataContext class that I needed on the fly, using LINQ.

    Bridges are used when trying when trying to glue together two different technologies (like Cocoa and Ruby on the Mac, for example)

    I find, however, that whenever I implement a pattern, it's because I knew about it before hand. Some extra thought generally goes into it as I find I must modify the original pattern slightly to accommodate my needs.

    You just need to be careful not to become and architecture astronaut!

提交回复
热议问题