MVC design pattern, mvc
The MVC design pattern is the most suitable method in the interface framework. Why? M is short for model, which means model meaning. A model is an algorithm, business logic, and Business representation. This often changes. For example, if a bank develops a supermarket credit system and gives different credits to people who swipe cards from different stores, this will change with time, for example, if you buy mooncakes during the Mid-Autumn Festival, you can add more credits. This change is shown in the model. V is the abbreviation of view, that is, view, which is the interface for users. The interface is stable for a certain period of time, but as user requirements change, more interfaces will be generated. For example, users can see that the data list display is quite satisfactory at the beginning. After a period of time, they will wonder if they can provide a graphic to describe the data? This is the requirement for the interface, that is, multiple views. That is to say, a piece of data corresponds to multiple views, and multiple views learn data from different perspectives. With the model and view, data can be displayed in the view after being processed by the business logic, which basically meets the needs of the entire software. However, the user's requirements for the software are not only visible, but also interactive. For example, if you want to see more details when you see a curve, you need to control it. The control part is abstracted as Controller and abbreviated as C. At this point, the responsibilities of MVC are very clear. M describes data logic processing, V indicates the data display after processing, and C receives user control, and pass different controls to M or V. Among them, M has no direct connection with V, and business logic processing does not care about how the interface is presented. It is just an optimization algorithm, or the most complex business logic. On the contrary, the interface does not need to care about how the data is processed. It is displayed only according to the user's needs. At the same time, multiple views all come from the same data, therefore, the display of multiple views must be consistent.
With the above concepts, we need to practice. Only practice can understand the theory and understand it in depth. Especially in software development, if you don't write code, just look at the theory, just like standing on the shore and learning to swim, you will never learn to swim. Because people feel very different between water and shore, the density of water is not an order of magnitude larger than that of air, and the difference is particularly large. Therefore, it is impossible to imagine what you actually feel. The same is true in programming. If you do not hand-write the code, it is difficult to understand the gap between imagination and implementation. It is often said that it takes two or three days to make a product for a few lines of code like this function. In fact, the product he mentioned is only a demo product for the current situation, rather than a product that is actually available, maintainable, reusable, and testable. In their eyes, a software product focuses only on availability, regardless of maintenance, reusability, and testing. Maintenance is an important indicator. If it cannot be maintained, it is difficult for a software product to succeed, because a software product has a long service period and 10 years is short, in the past 10 years, upgrading software products has become a common occurrence for different users and competitors. It is difficult to make software products updated faster and compatible with old users. If the Code does not consider maintainability, it becomes more impossible to complete the task. Reusability is to save software development costs. This is critical because the efficiency of software development determines the product pricing. That is to say, it determines whether or not your product is marked as a key factor during the bidding process. Generally, the price is more than 50%. Testing is an indicator of software quality and maintenance. Because a software product has been developed for 10 years and updated every month and must be compatible with old products and users, how can we ensure compatibility with old products? Only regression tests can be conducted for old products. This regression test is not comprehensive or practical if it is manual. Therefore, automated testing is an inevitable choice, and only automated testing can be more comprehensive, to ensure that all aspects of the product have met the original rules. In addition, automated testing is more efficient than manual testing, which is enough to reduce costs.
Is MVC a design pattern?
The MVC mentioned here is actually a model (or a development model). We design a program based on this model. In general, it is a model. They have different concepts.
MVC is the Model-View-controller (MVC ). it was initially applied in Smalltalk. The main idea is to use an object-oriented design method to separate the user interface design from the business logic of the program. with this mode, you can develop software systems that are scalable, easy to expand, and easy to maintain. MVC consists of three parts: Model, View, and Controller. The three parts are divided and cooperated to complete the functions of the system.
Java has 23 design modes, common Singleton mode, value object mode, factory mode, simple factory mode, etc. These are the modes.
The design pattern refers to a summary of successful experiences in solving a series of identical problems. The model applies to all the places where this model is needed.
Is MVC a design pattern?
The MVC mentioned here is actually a model (or a development model). We design a program based on this model. In general, it is a model. They have different concepts.
MVC is the Model-View-controller (MVC ). it was initially applied in Smalltalk. The main idea is to use an object-oriented design method to separate the user interface design from the business logic of the program. with this mode, you can develop software systems that are scalable, easy to expand, and easy to maintain. MVC consists of three parts: Model, View, and Controller. The three parts are divided and cooperated to complete the functions of the system.
Java has 23 design modes, common Singleton mode, value object mode, factory mode, simple factory mode, etc. These are the modes.
The design pattern refers to a summary of successful experiences in solving a series of identical problems. The model applies to all the places where this model is needed.