, 7 tweets, 2 min read Read on Twitter
استكمالاً لما سبق , الMVVM اختصار لModel View ViewModel Model و قد بُني على MVC و MVP من قبل مايكروسوفت لتقنية WPF مع انه كان هناك شيء مشابه له اختصاره MVPM كتب عنه Martin Fowlerفي بداية الالفين.
لنفهم فائدة الMVVM , مايكروسوفت عندما قدمت Silverlight و WPF او Xaml بشكل عام .هذه الادوات تحتاج لمسة من مصمم جرافكس محترف فبدل ان نعطي المصمم كل المشروع نستطيع ان نعطيه فقط هذه الجزئية و نعمل كمبرمجين على جانب الBackend.
اللي اشتغل على KnockoutJS بيكون الMVVM مألوف لديه حيث ان فكرته هي تقسيم المشروع إلى ثلاثة اقسام Model فيه مصدر البيانات بدون تشكيل و فيه View و ViewModel مهمته الValidation و اعادة تشكيل البيانات بما يتناسب مع الView.
بالنسبة للView و قبل الحديث عنها في MVVM هناك نوعين من الView فإما Passive مثل الذي ذكرناه في سلسلة الMVP حيث ان الPresenter هو اللي يتحكم بالView و يعرض او يقرأ منه البيانات و يكون الView غير مرتبط مباشرة مع الModel
النوع الثاني هو الـ Active View تكون فيه البيانات مربوطة عبر آلية data binding مباشرة مع الModel فإي تغير في الView ينعكس على الModel و العكس صحيح. لكن في الـMVVM الربط مع الViewModel و ليس مباشرة مع الModel.
عندما اذكر كلمة Model هنا فأنا لا اقصد الBusiness Model بل فقط الModel الخاص بالUI اما الBusiness Model فمن الافضل أن يكون مفصولاً في مشروع اخر.
هناك امر مهم هنا و هو ان الViewModel في MVVM اخذ مهمة الController في الMVC و مهمة الPresenter في MVP فهو المنسق بين الModel و الView . الآن مايكروسوفت اعتمدت MVVP في تقنية Xamarin لبناء تطبيقات الهواتف و التي ارى انها تحسنت كثير عما كانت عليه في بدايتها.
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Ahmed Aljaberi
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!