--All 23 patterns that a smart person named GoF thought --Target is an object-oriented language --There are several other types ――We are trying to improve extensibility (mainly) by utilizing Java functions. --Inheritance --Polymorphism --Encapsulation, etc. --The excellent veteran thinks like this! A collection of ideas --Not a concrete implementation method --Understand the idea and apply it to your own program
--Apply the idea and reflect it in your source -≠ Implement according to the pattern --Use only when the effect can be expected -≠ Apply as much as possible -≠ Delusion of the effectiveness of the design pattern --If you use it forcibly, it will have the opposite effect. ――Flexibly decide the application according to the situation -≠ Since the application decision was made at the time of design, it will definitely be reflected in the program.
--At the time of class design --At the time of refactoring --At the time of review --Reduced explanation time to reviewers --Only if both sides know the pattern --At the time of programming investigation --Reduced reading time --Improved prediction accuracy --Only if you know the pattern --When modifying programming
--Pickup from the following viewpoints --Easy to understand --Easy to use --A certain effect can be expected --There is an example around you
--Create a class that handles the complicated processing flow on behalf of the client --The client side can perform complicated processing just by calling the Facade class. --Simplified client-side processing --The most commonly used pattern, unknowingly specified to some extent --Very useful for refactoring
--It is necessary to call various classes in a series of processes --It is a general process called by many clients.
--Collect complicated processing in one class --Easy to add processing on the client side ――It is relatively easy to apply --If you do not narrow down the usage, useless classes will increase and it will have the opposite effect.
--Subclass the part where processing is switched by conditional branching --Minimum addition to existing source when conditions increase --Very similar to the State pattern
--Similar processing is called by conditional branching --Conditions are expected to increase or decrease in the future
--Used when similar processing runs in conditional branching --The range of influence of existing sources can be narrowed down --Slightly more cumbersome and complicated than Facade --If no additional processing is expected, the effort is greater
--Leverage object orientation for extensibility and reusability --Improves readability (sometimes) ――Apply the idea instead of using it as it is --Combination is also possible ――With 〇〇 pattern! Communication is quick and easy if you can communicate with just ――Since the original is rough, there is a difference in interpretation ――Some of the books I read this time had different interpretations. --If you overdo it, it is a waste of labor and man-hours.
--Design patterns learned in Java language --Author: Hiroshi Yuki --Thorough capture of Java design patterns --Author: Japan Software Engineering Co., Ltd. --Refactoring Safely improve existing code --Author: Martin Fowler --Translation: Kiminobu Kodama, Masao Tomono, Akira Hirasawa, Takashi Umezawa --Design patterns learned from case studies --Author: Naoki Fukuda
Recommended Posts