It seems that the key problem with modern object-oriented programming languages (OOPL) that they are more programming than modeling ones. And seems this problem cannot be resolved in OOPL.
Object-oriented approach is a way for modeling and decompositions, creating abstractions from a domain. In OOPL there is no clear, strict and explicit modeling criteria, that's some criteria how to decompose a domain and to define object abstractions. OOPL provide such features like encapsulation/inheritance/polymorphism, which don't contribute to model a domain.
Object-oriented modeling is not a data model.
The fundamental principle "everything is an object" seems logically correct but in practice is not useful, and even possibly wrong. Why anything should be an object? In practice, we have different kinds of abstractions: objects, DTO, entities, controllers, factories, views and much more. In OOPL all these abstractions are defined usually via classes. As result, conventions are required how to interpret a class.
OOPL define very abstract and simple syntax/semantics, and this is declared as a feature. But in practice such abstracting results to conventions on project level. Simplicity of a language syntax usually means mnemonic syntax, short words etc., but simplicity should be reached by higher level abstractions.
The classical problem with two kinds of complexity, domain and technological, seems cannot be resolved in OOPL. OOPL don't provide ability to separate domain models from technological terms. OOPL provide very general features, and in modern projects this becomes a problem. Domains are complex enough, and technologies are complex too. OOPL provide for developers a single concept of a class to describe abstractions for both, domain and technological, areas.
OOPL look like object-oriented assembler languages. We can write working applications and services with them, but the writing requires a lot of patterns, idioms, guidelines, conventions etc. Some (and may be most) of them are result of over-generalization of syntax and semantics in modern OOPL.
Nevertheless, OOPL are required to be exactly object-oriented assembler languages. Modeling languages like Paml (with higher level abstractions) are translated into OOPL to make concrete high level abstractions into concrete elements of source code.
Write a comment