그 저자 : 일반적인 웹 앱. 가장 큰 차이점은 서버 MVC 아키텍처는 요청 범위 만 처리하는 반면 엠버 애플 리케이션은 요청 개념이 없다는 점이다. 전체 앱을 사용할 수 있거나 전혀 사용할 수 없습니다.
서버 측 코드는 주로 모델 조작 및 알림을 수행하므로 뚱뚱한 모델/씬 컨트롤러가 적합합니다. 컨트롤러는 본질적으로 모델 라우터입니다.
Ember의 컨트롤러가 모델 프록시으로 표시되면 컨트롤러를 뚱뚱하게 만드는 것이 더 적합합니다. 모든 논리는 컨트롤러에 위임되며 모델은 실제로 객체를 제공하기위한 것입니다. 다음은 간단한 레이아웃입니다.
당신이 볼 수 있듯이
View - Displays information
Controller - Delegates request to relevant model,
calls the appropriate view with relevant (manipulated) data
Model - (Fat) Most of the application's thinking happens here,
calls the database for records
(database) - Serves records as requested
엠버 아키텍처
Router - Sets up which template/view/controller to use for the page
Template/View - Displays information from the controller
Controller - All interactive logic goes here,
interacts with model for records
Model - Record store which calls server side api for additional records
에서, 엠버 모델은 더 많은 서버 측 데이터베이스 기능과 같이 볼 수 있어야 서버 측 아키텍처를 타다가 잠시 컨트롤러는 서버 측 컨트롤러와 비슷합니다.
자세한 내용은 엠버 페이지에서 Core Concepts과 Introduction to Controllers을 확인하십시오.
Brilliant! 그게 내가 바라는 대답이고, 잘 설명했다. 건배! –