简体   繁体   中英

Which are the difficult patterns?

通过参考设计模式,这些模式在您的体验中最难掌握,从某种意义上说,它们相对不那么直观。

For me, The most difficult pattern is the pattern by which you know when to apply a given pattern or not to a particular situation.

Regards,

As far as individual patterns go, probably Interpreter.

That said, I think the most difficult thing with design patterns is really understanding the programming model behind them. Many people treat them like data structures, which is a misunderstanding of how to use them. The key to understanding design patterns, as a whole, is understanding the concept of multiple objects communicating with each other rather than being "manipulated" from above.

Once you grasp that, and the overall concept of building and arranging these objects in a graph, most of the patterns become relatively obvious and just kind of fall out by necessity.

You need to follow

  1. Understand why to follow a design pattern for your project.
  2. What is that you are trying to achieve by following a pattern.

Once you get a clear understanding about these 2 you can start following the OOPS concepts which will fit into the correct design pattern.

Any design pattern is nothing but an actual implementation of OOPS concept in real time scenario.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM