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

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

主站蜘蛛池模板: 建瓯市| 永泰县| 根河市| 隆子县| 九江市| 文昌市| 前郭尔| 敦化市| 定南县| 大邑县| 房产| 长治市| 上高县| 梓潼县| 玉溪市| 宣汉县| 高唐县| 苍梧县| 赫章县| 左贡县| 重庆市| 五莲县| 颍上县| 内黄县| 义乌市| 竹北市| 仲巴县| 福泉市| 许昌市| 凤山市| 家居| 石柱| 堆龙德庆县| 新闻| 环江| 宽城| 黎川县| 克什克腾旗| 莫力| 武城县| 静宁县|