What does “monolithic” mean?

前端 未结 6 2293
抹茶落季
抹茶落季 2021-02-13 00:23

I\'ve seen it in the context of classes. I suspect it means that the class could use being broken down into logical subunits, but I can\'t find a good definition. Could you give

6条回答
  •  渐次进展
    2021-02-13 01:18

    It means something is the opposite of modular. A modular application can have parts, referred to as modules, replaced without requiring replacement of the entire application. Whereas a monolithic application, after having a part fixed or upgraded, must be replaced in it's entirety.

    From Wikipedia: "Modularity is desirable, in general, as it supports reuse of parts of the application logic and also facilitates maintenance by allowing repair or replacement of parts of the application without requiring wholesale replacement."

    So in the context of a monolithic class, all its features are self-contained and if you want to add or alter a feature to the class you would need to alter/add code in the class and recompile it. Conversely a modular class exposes access to functionality which is implemented externally. For example a "Calculator" class may use a separate "Add" class for actually adding numbers; call a "Multiply" function from a separate library; or even call an "Amortize" function from a web service. As long as the each of these functional parts can be altered externally from the class, it is modular.

提交回复
热议问题