<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>devkuma – MVC</title>
    <link>https://www.devkuma.com/en/tags/mvc/</link>
    <image>
      <url>https://www.devkuma.com/en/tags/mvc/logo/180x180.jpg</url>
      <title>MVC</title>
      <link>https://www.devkuma.com/en/tags/mvc/</link>
    </image>
    <description>Recent content in MVC on devkuma</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <managingEditor>kc@example.com (kc kim)</managingEditor>
    <webMaster>kc@example.com (kc kim)</webMaster>
    <copyright>The devkuma</copyright>
    
	  <atom:link href="https://www.devkuma.com/en/tags/mvc/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>MVC(Model-View-Controller) Pattern</title>
      <link>https://www.devkuma.com/en/docs/mvc/</link>
      <pubDate>Sat, 03 Dec 2022 06:32:00 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/mvc/</guid>
      <description>
        
        
        &lt;h2 id=&#34;what-is-the-mvc-pattern&#34;&gt;What Is the MVC Pattern?&lt;/h2&gt;
&lt;p&gt;Model-view-controller(MVC) is a software design pattern used in software engineering. The MVC pattern is often used in web system development with the idea that program processing should be divided by role.&lt;br&gt;
The MVC pattern combines the initials of &lt;strong&gt;Model&lt;/strong&gt;, which is the core of system processing, &lt;strong&gt;View&lt;/strong&gt;, which handles screen display and input/output, and &lt;strong&gt;Controller&lt;/strong&gt;, which receives user input and controls the Model and View according to that input.&lt;br&gt;
Dividing a system into &amp;ldquo;&lt;strong&gt;M&lt;/strong&gt;odel&amp;rdquo;, &amp;ldquo;&lt;strong&gt;V&lt;/strong&gt;iew&amp;rdquo;, and &amp;ldquo;&lt;strong&gt;C&lt;/strong&gt;ontroller&amp;rdquo; organizes system development and improves development efficiency. Therefore, it is an appropriate development method when efficiency is the top priority or when the burden on development staff needs to be reduced.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;model-view-controller-light-blue.png&#34; alt=&#34;MVC&#34;&gt;&lt;br&gt;
&lt;em&gt;Image source: &lt;a href=&#34;https://developer.mozilla.org/ko/docs/Glossary/MVC&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://developer.mozilla.org/ko/docs/Glossary/MVC&lt;i class=&#34;fas fa-external-link-alt&#34;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h3 id=&#34;model-passing-data-to-and-from-the-database&#34;&gt;Model: Passing Data to and from the Database&lt;/h3&gt;
&lt;p&gt;The Model is the part responsible for the system&amp;rsquo;s business logic. In other words, it is the body and foundation of the system. It handles data exchange with the database, including internal system data processing and persistence, so it is a very important part.&lt;/p&gt;
&lt;p&gt;In particular, when the Controller receives a request from the client, it instructs the Model to search for data. The Model searches the database and sends the data to the Controller.&lt;br&gt;
In addition to retrieving data from the database, the Model can save, update, and delete retrieved data in the database.&lt;br&gt;
It may also transform data received from the database into a format that the Controller can handle easily. For example, a database may store a date as &amp;ldquo;2022-12-03&amp;rdquo;, but the Model can convert it into an easier-to-read form such as &amp;ldquo;December 03, 2022&amp;rdquo; before sending it to the Controller, making later work easier to understand.&lt;/p&gt;
&lt;h3 id=&#34;view-displaying-screens-based-on-dynamically-generated-html&#34;&gt;View: Displaying Screens Based on Dynamically Generated HTML&lt;/h3&gt;
&lt;p&gt;The View handles the user interface that users see on a PC, smartphone, and so on. It is also responsible not only for screen display but also for layout, menus, button usability, design, and operability.&lt;/p&gt;
&lt;p&gt;Specifically, the Controller receives data from the Model, controls it, and then sends the data to the View. At this point, the data is not displayed directly in the web browser; HTML, CSS, JavaScript, and similar processing are performed to render the screen.&lt;/p&gt;
&lt;h3 id=&#34;controller-controlling-the-view-and-model&#34;&gt;Controller: Controlling the View and Model&lt;/h3&gt;
&lt;p&gt;The Controller controls the behavior of the View and the Model. The Controller itself does not display screens or execute logic. Instead, it instructs the Model to execute the necessary logic according to client input and instructs the View to display the result, so it plays an important mediating role.&lt;/p&gt;
&lt;p&gt;Specifically, it processes requests received from the client according to predefined rules(routing), instructs the Model to query data, receives the queried data, and sends it to the View.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Flow&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The Controller receives the request sent by the client. (Request)&lt;/li&gt;
&lt;li&gt;The Controller instructs the Model to execute processing.&lt;/li&gt;
&lt;li&gt;The Model sends the processing result to the Controller.&lt;/li&gt;
&lt;li&gt;The Controller instructs the View to display it.&lt;/li&gt;
&lt;li&gt;The View displays the screen. (Response)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In this way, the MVC pattern is a development approach that separates roles into the Model, which handles business logic, the View, which handles screen display and input/output, and the Controller, which mediates between Model and View. Many frameworks adopt this approach. Representative examples include the Java framework Spring, the Ruby framework Ruby on Rails, and the Python framework Django.&lt;/p&gt;
&lt;h2 id=&#34;history-of-the-mvc-pattern&#34;&gt;History of the MVC Pattern&lt;/h2&gt;
&lt;p&gt;The MVC pattern began in 1979 when Trygve Reenskaug devised it at Xerox Palo Alto Research Center. It was originally created as a design guideline for window program development in Smalltalk, an object-oriented programming language and integrated development environment. Later, as GUI software structures became more complex, the versatility of the MVC pattern drew attention and it spread rapidly. It is said to have become widely used in web systems after being adopted by JavaServer Pages(JSP).&lt;/p&gt;
&lt;h2 id=&#34;advantages-of-the-mvc-pattern&#34;&gt;Advantages of the MVC Pattern&lt;/h2&gt;
&lt;p&gt;Because roles are independent in the MVC pattern, work boundaries become clear, parallel development becomes possible, development efficiency improves, and maintainability also increases. For example, if a problem occurs in the UI, it can be inferred that the cause lies in the View, which is responsible for displaying the screen to the client. This keeps the effort required to solve such issues to a minimum. It also has the advantage of reducing impact on the Controller and Model. In this way, dependencies between components are minimized in the MVC pattern, so code reusability is also high.&lt;/p&gt;
&lt;h2 id=&#34;disadvantages-of-the-mvc-pattern&#34;&gt;Disadvantages of the MVC Pattern&lt;/h2&gt;
&lt;p&gt;Although the MVC pattern can improve development efficiency, it also has disadvantages that may reduce efficiency.&lt;br&gt;
Because the MVC pattern divides development by function, each function must be separated. However, this also increases restrictions on how code is written, and depending on the case, it may take more time. Because of these characteristics, it may not be suitable for small-scale development.&lt;br&gt;
Also, enhanced functionality can place a burden on the Model, which interacts with the database and transforms data, and on the Controller, which mediates that process, potentially slowing processing speed. If Controller support for the Model becomes too large, the Model&amp;rsquo;s dependency on the Controller may increase, making it difficult to maintain the functional independence that is an advantage of MVC. Therefore, when developing a system, it is necessary to understand the development scale in advance.&lt;/p&gt;
&lt;h2 id=&#34;avoiding-the-disadvantages&#34;&gt;Avoiding the Disadvantages&lt;/h2&gt;
&lt;p&gt;To avoid disadvantages caused by functional expansion in system development, it is necessary not to expand the Controller and Model excessively.&lt;br&gt;
By reducing the load on the Controller and Model, system development can proceed smoothly.&lt;br&gt;
It is also possible to check whether the model is appropriate, carefully select only the necessary processing, and reduce the load as much as possible.&lt;/p&gt;
&lt;h2 id=&#34;to-improve-work-efficiency-further&#34;&gt;To Improve Work Efficiency Further&lt;/h2&gt;
&lt;p&gt;Because the MVC pattern allows work to be divided by function, assigning specialists to each area can further improve work efficiency. The MVC pattern is a concept of system development, but it is also used to describe a company&amp;rsquo;s structure and organization outside development. It is worth remembering for smoother work.&lt;/p&gt;
&lt;h2 id=&#34;references&#34;&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://ko.wikipedia.org/wiki/%EB%AA%A8%EB%8D%B8-%EB%B7%B0-%EC%BB%A8%ED%8A%B8%EB%A1%A4%EB%9F%AC&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Model-view-controller | Wiki&lt;i class=&#34;fas fa-external-link-alt&#34;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

      </description>
      
      <category>MVC</category>
      
    </item>
    
  </channel>
</rss>
