- Design Patterns and Best Practices in Java
- Kamalmeet Singh Adrian Ianculescu LUCIAN PAUL TORJE
- 116字
- 2021-06-25 20:52:36
The command pattern
One of the most important things to do in object-oriented programming is to adopt a design that lets us decouple the code. For example, let's imagine that we need to develop a complex application in which we can draw graphic shapes: points, lines, segments, circles, rectangles, and many more.
Along with the code to draw all kinds of shapes, we need to implement many operations to handle the menu operations. In order to make our application maintainable, we are going to create a unified way to define all those commands in such a way that it will hide the implementation details from the rest of the application (which plays the client role).
推薦閱讀
- LabVIEW Graphical Programming Cookbook
- OpenCV for Secret Agents
- C#程序設(shè)計(慕課版)
- RTC程序設(shè)計:實時音視頻權(quán)威指南
- 零基礎(chǔ)學(xué)Python數(shù)據(jù)分析(升級版)
- Corona SDK Mobile Game Development:Beginner's Guide(Second Edition)
- Cybersecurity Attacks:Red Team Strategies
- 圖數(shù)據(jù)庫實戰(zhàn)
- Learning Apache Cassandra
- Mastering Akka
- Access 2010數(shù)據(jù)庫應(yīng)用技術(shù)實驗指導(dǎo)與習(xí)題選解(第2版)
- 實戰(zhàn)Java高并發(fā)程序設(shè)計(第2版)
- 微課學(xué)人工智能Python編程
- Learning Splunk Web Framework
- Julia數(shù)據(jù)科學(xué)應(yīng)用