MVCは何ですか???
MVCは、ユーザーインタフェースをもつアプリケーションソフトウェアを実装するためのデザインパターンである。
(Ref:https://bit.ly/2GQbO6V)
M(Model):入力や表示に関連しない処理、システムのビジネスロジックを処理する
V(VIEW):入力や表示に関連する処理
C(Controller):モデルとビューの橋渡して制御する
具体の例
Model:データの処理する。(DBからデータの取得、DBへの保存)
View:ユーザーが実際に見る画面を示す。
Controller:Viewからリクエストを受け取り、Modelへ処理の命令を出す。(Modelから処理の結果を受け取り、レスポンスとしてViewへ返す)
メリット
各機能が分割されている為、変更・修正があった場合にその影響を受けにくい。