Mvvm stand for dab tsi?
Mvvm stand for dab tsi?

Video: Mvvm stand for dab tsi?

Video: Mvvm stand for dab tsi?
Video: MVVM in Simple Words 2024, Kaum ib hlis
Anonim

Qauv-saib-viewmodel ( MVVM ) yog ib tug software architectural qauv. MVVM txhawb kev sib cais ntawm kev txhim kho ntawm cov neeg siv graphical interface - yog nws los ntawm cov lus cim lossis GUI code - los ntawm kev txhim kho kev lag luam logic lossis back-end logic (cov ntaub ntawv qauv).

Kuj paub, qhov txawv ntawm MVC thiab MVVM yog dab tsi?

Raws li qhov MVC hom ntawv yog tsim tshwj xeeb los tsim kom muaj kev sib cais ntawm kev txhawj xeeb ntawm tus qauv thiab saib, cov MVVM hom ntawv nrog cov ntaub ntawv-binding yog tsim tshwj xeeb los tso cai rau kev saib thiab qauv sib txuas lus ncaj qha rau ib leeg. Qhov no yog vim li cas ib nplooj ntawv thov ua haujlwm zoo heev nrog ViewModels.

Tsis tas li ntawd, Mvm puas zoo? Raws li tus qauv nws tus kheej MVVM yog zoo heev . Hauv luv luv: MVVM tsis yog pointless, nws yog zoo heev . NET 4.0 WPF's tswj tsev qiv ntawv yog thoob khib nyiab. Ntawm no yog cov ntaub ntawv pov thawj yooj yim ntawm lub tswv yim ViewModel uas koj tsis tuaj yeem cov ntaub ntawv khi hauv cov ntshiab MVVM kev siv WPF.

Qhov thib ob, qhov twg zoo dua MVVM lossis MVC?

MVVM qauv Saib tau txais thiab xa cov hloov tshiab rau ViewModel nkaus xwb, tsis suav tag nrho cov kev sib txuas lus ntawm ntu no thiab Model nws tus kheej. Qhov sib txawv tseem ceeb ntawm MVC thiab iOS MVVM yog tias MVVM cov faib qauv yog zoo dua tshaj nyob rau hauv lub npe yav dhau los MVC , tab sis thaum piv rau MVP nws kuj yog hnyav heev.

Puas yog MVC pem hauv ntej kawg lossis backend?

Qhov sib txawv tseem ceeb ntawm MVC ntawm tus neeg siv khoom thiab MVC ntawm qab kawg yog nrog MVC ntawm pem hauv ntej kawg muaj tsawg kawg code khiav ntawm lub server. Lub server feem ntau yog siv los tuav lub vev xaib API thov uas teb nrog JSON cov ntaub ntawv. Cov qab kawg yog qhov hnyav heev.

Pom zoo: