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

Conclusion to Part One

We have seen that Object-Oriented Programming is indeed, as many detractors suggest, a complex paradigm with many moving parts. We have also seen that this complexity is not essential: at its core is a single idea that a problem can be modeled as lots of distinct, interacting agents, and that each of those agents can be modeled as a small, isolated computer program. The solution to the original problem is found in the interaction between those agents, which is mediated by message passing.

Some of the incidental complexity seems to have been added by people wanting to make their mark: the proliferation in design patterns appears to have occurred because it is always easier to add a new pattern than to consolidate existing ones; however much some people might like to erase Singleton from history. Objects are not "just" decomposition and message-passing, they are that and providing access to a program's data, or that and a hierarchy of classes.

Much of the complexity associated with objects comes from another source: trying to treat object-oriented programming as much like the structured, procedural, imperative processes that came before, and map its terminology onto the thought structures and workflows of the established ways of writing software. This is the "structured on-ramp" of this section's introduction, in which OOP is seen as an extension to existing ideas, and programs are made "better" by adding objects in the same way that food is made "better" by sprinkling paprika on top. Thus, it is that Ann Weintz could say that "A NeXT Object is simply a piece of C code" in Writing NeXT Applications. Thus, object-oriented software engineering is about building complex software systems by careful, top-down analysis of the procedures (or bottom-up analysis of the data and its manipulations), while also as a side activity creating a hierarchy of classes with particular relationships.

If objects are something you do as well as writing software, then no wonder it is harder than not using the objects! OOP seems to have failed, but it may not even have been attempted.

主站蜘蛛池模板: 兰州市| 高雄县| 陕西省| 红桥区| 黔西| 昌江| 哈巴河县| 禄劝| 西宁市| 谷城县| 茌平县| 祁连县| 虞城县| 龙江县| 霍城县| 上犹县| 库尔勒市| 长乐市| 台湾省| 福贡县| 万年县| 正安县| 和林格尔县| 肃南| 伊金霍洛旗| 长沙县| 宜兰市| 怀仁县| 灵璧县| 丰都县| 温泉县| 泗洪县| 正阳县| 彭州市| 阿瓦提县| 海兴县| 内乡县| 肥东县| 婺源县| 沙河市| 福清市|