官术网_书友最值得收藏!

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).

主站蜘蛛池模板: 吕梁市| 盐津县| 晋江市| 杂多县| 天祝| 银川市| 香格里拉县| 勃利县| 策勒县| 辰溪县| 永定县| 巢湖市| 历史| 堆龙德庆县| 惠来县| 贡山| 新化县| 噶尔县| 无为县| 海南省| 石城县| 西藏| 方正县| 晴隆县| 静海县| 平潭县| 甘孜县| 林西县| 新兴县| 白玉县| 大城县| 东宁县| 苏尼特右旗| 枝江市| 泗阳县| 云霄县| 泸溪县| 原阳县| 神农架林区| 西充县| 若尔盖县|