MVC and OOP are the same? Explain, please.
- fourThe short answer is no . - u_mulder
- OOP is a way of organizing and structuring data, MVC is part of an application that each plays its own role, one for visualizing data, the other for managing this data, etc. - Ni55aN
- 2meta-comment: the question looks comprehensive, but you should not close it. A brief overview response with links for further reading is sufficient. Here is a discussion on Meta . - jfs
2 answers
Not
MVC is a design pattern that distributes responsibility between sections of code. The model deals with data, the presentation deals with the display, the controller deals with the control. MVC can be implemented on anything - a function, an object - it does not matter, it matters who does what in the hierarchy.
OOP is a common programming paradigm. OOP implies that the tasks will be implemented, presented and solved with the help and in the form of objects, that when calculating the bill in a restaurant we will operate with objects that are dishes. Functional programming, at the same time, would use a different approach, operating with a list of dishes.
MVC can be implemented in the OOP paradigm, as well as in any other programming paradigm.
- 2The teacher, mvc, is not a template, but a multi-template. OOP is an abstraction, the best implementations of which are illustrated by patterns. For this reason, the question is not so stupid as to minus, because mvc is one of the best illustrations of aop. Forgive me for interfering with me, but it is not the first time that I read your posts about mvc and it seems to me that you are talking about one of the worst implementations where business logic is contained in the controller .. This is how it seems to me, where your logic is ? - vas
- 2@shatal is the most classic example - Lisp, C, there is also Haskell, for example; in PHP, Python, Ruby can be written within the OP paradigm. The PLO is much more than good, but the resources are really only on the road, so the demand for FC is not only academic. - etki
- one@shatal I don’t really understand the question, but there really isn’t any objects in the sishka There is no entity in the Sishka that has a behavior (methods). Lisp touched only in connection with the SICP, Haskell did not touch at all, but I am sure that there is not. And yes, the presence of objects in the language does not mean that it can only be written in the OOP paradigm. - etki
- one@shatal, no. First, it is not clear where the statement that patterns are necessarily associated with OOP is taken from, secondly, “the ability to realize something object-oriented” is not proof of the OOP orientation of the language. - etki
- one@shatal, I said everything I wanted, and in these words I am confident ninety percent. I do have probes in the description of the paradigm, let's say, but otherwise, I am sure that I will not change my point of view and do not want to write again. You can consider me a robot, if you want. - etki
NOT
OOP (Object Oriented Paradigm) is a model for describing a subject domain, that is, how you describe a subject domain with a computer. For example, we can simulate a certain area as a system of functions (FP), or as some actions (procedures) changing the states of some variables (PP), or as certain objects exchanging messages and interacting with each other (OOP itself). These models are embodied in specific programming languages.
MVC (Model-View-Controler) is a model for describing a software product (or if you want a template), it dictates what "details" your program should contain.