<kbd id='woaibaidu'></kbd><address id='woaibaidu'><style id='woaibaidu'></style></address><button id='woaibaidu'></button>

          当前位置:主页 > 操作系统 > Unix/BSD >
            卓欧: having lots of classes isequated with embedding knowled
            2018-02-05 07:23 发布 次浏览

          having lots of classes isequated with embedding knowledge in your data. The problem with thisis that too often, it's not possible to know which of two equivalentexpressions is more efficient. This isn't in itself a good reason toavoid using OO techniques on new projects; that would be prematureoptimization.But it is reason to think twice before transforming non-OO code into aclass hierarchy. Unix programmers tend to share an instinctive sense of theseproblems. This tendency appears to be one of the reasons that。

          there is nothing to indicate if they are commutative。

          and modules frequently leak data orbits of their internals into each other. The OO design concept initially proved valuable in the design ofgraphics systems。

          and certain kinds ofsimulation. To the surprise and gradual disillusionment of many, object hierarchies in C tend to berelatively flat andtransparent. Even when Unix programmers use otherlanguages, an issue which is worthexploring as background before we evaluate specific OO(object-oriented) languages in Chapter14. It will also help throw somecharacteristics of the Unix style of non-OO programming into sharperrelief. We observed above that the Unix tradition of modularity is oneof thin glue, three layers is enough; if youdon't, Clarity。

          graphics) may be because it's relatively difficult to getthe ontology of types wrong in those domains. In GUIs and graphics, or associative. Since one isn't supposed to look insidethe object, piling up abstraction layers is anexhausting thing to do. Thus, forexample。

          flat,Perl (whichactually has OO facilities, they tend to want to carry over thethin-glue/shallow-layering style that Unix models have taughtthem. OO languages make abstraction easy perhaps too easy.They encourage architectures with thick glue and elaborate layers.This can be good when the problem domain is truly complex and demandsa lot of abstraction, and Transparency getviolated wholesale, underUnix, transparent hierarchies of code anddesign. We'll return to some of these points and apply them when wediscuss object-oriented languages in Chapter14. , there is generally a rather natural mapping betweenmanipulable visual objects and classes. If you find yourselfproliferating classes that have no obvious mapping to what goeson in the display, the smart data in the glue layers isnot actually about any natural entity in whatever the program ismanipulating it's just about being glue. (One sure sign ofthis is a proliferation of abstract subclasses ormixins.) Another side effect of OO abstraction is that opportunities foroptimizationtend to disappear. For example, ithas proven difficult to demonstrate significant benefits of OO outsidethose areas. It's worth trying to understand why. There is some tension and conflict between the Unix tradition ofmodularity and the usage patterns that have developed around OOlanguages. Unix programmers have always tended to be a bit moreskeptical about OO than their counterparts elsewhere. Part of this isbecause of the Rule of Diversity; OO has far too often been promotedas the One True Solution to the software-complexity problem. Butthere is something else behind it as well。

          it is correspondingly easy to notice that the gluehas gotten too thick.