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

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

主站蜘蛛池模板: 修武县| 内黄县| 丁青县| 比如县| 通辽市| 新田县| 海安县| 洛扎县| 广昌县| 类乌齐县| 额尔古纳市| 扬州市| 苗栗市| 开阳县| 大渡口区| 建始县| 息烽县| 毕节市| 洛南县| 镇雄县| 平江县| 扶绥县| 福贡县| 宜兰市| 海盐县| 天津市| 灵丘县| 开阳县| 铁岭市| 浦北县| 宁乡县| 泰宁县| 墨竹工卡县| 岱山县| 工布江达县| 全南县| 庐江县| 上饶县| 金门县| 永嘉县| 曲阳县|