👉 เมื่อเราได้รู้จัก MVC ไปกันแล้ว..มันยังมีอีกโมเดลหนึ่งที่สำคัญในการเขียนโปรแกรมเช่นกันนะ นั่นก็คือ… MVVM นั่นเอง!!
.
แล้วมันคืออิหยังงง?? เหมือนหรือต่างกับ MVC รึป่าวนะ หากพร้อมแล้ว มาหาคำตอบกันได้ในโพสต์นี้เลยจ้าาา
.
🌈MVVM ย่อมาจาก Model-View-ViewModel พัฒนามาจาก MVC โดยจะแยก View ออกจาก Model เพิ่ม ViewModel ขึ้นมาเพื่อเก็บข้อมูลทั้งหมดที่ View ต้องการ โดยทั้งสองจะส่งผลซึ่งกันและกัน หากมีอันไหนเปลี่ยนแปลง อีกอันก็จะเปลี่ยนแปลงตาม
.
👩🔧 Model
เหมือนกับ MVC มีหน้าที่จัดเก็บ และจัดการกับข้อมูลต่าง ๆ ภายในโมเดล
.
✨ View
เป็นส่วนการแสดงผล ซึ่งใน MVVM จะแยกกับ Model อย่างชัดเจน เน้นการแสดงผลอย่างเดียว ส่วน Logic ต่าง ๆ เป็นหน้าที่ของ ViewModel
.
👨💻 ViewModel
เป็นส่วนที่แปลง Logic ต่าง ๆ ให้แสดงบน View ได้ ซึ่ง ViewModel เปรียบเสมือนสมองของ View นั่นเอง โดยจะมี Data Binding เพื่อควบคุมการติดต่อระหว่างทั้งสอง เมื่อส่วนใดมีการเปลี่ยนแปลงจะส่งผลถึงกันและกัน
.
🌟 ข้อดีของ MVVM
- แยกส่วน Logic ออกจากการแสดงผล
- ง่ายต่อการบำรุงรักษาและทำการทดสอบ
- สามารถเขียน Unit Test Case สำหรับทั้ง ViewModel และ Model โดยไม่ต้องกังวลในส่วน View
- เหมาะกับการพัฒนาเว็บหรือแอปที่มีการเปลี่ยน UI บ่อย ๆ เพราะไม่กระทบกับส่วน ViewModel
.
หวังว่าจะเป็นประโยชน์กับเพื่อน ๆ นะคร้าบบบบบบ 🥰
.
💥หากใครอยากอ่าน MVC แอดเคยสรุปไว้ให้แล้ว คลิกลิงค์ด้านล่างแล้วไปอ่านกันได้เลยจ้า
https://www.facebook.com/borntodev/posts/4245182842206643
.
Source : https://andrewlundy.hashnode.dev/software-architectural-patterns-mvvm , https://www.guru99.com/mvc-vs-mvvm.html
.
borntoDev - 🦖 สร้างการเรียนรู้ที่ดีสำหรับสายไอทีในทุกวัน
同時也有1部Youtube影片,追蹤數超過1萬的網紅howtindog,也在其Youtube影片中提到,最新消息請到 http://www.howtindog.com 或訂閱 http://facebook.com/howtindogs Michael Coogan, God & Sex 最後一章節錄: ================ For readers who are believers...
「view binding」的推薦目錄:
- 關於view binding 在 BorntoDev Facebook 的最佳貼文
- 關於view binding 在 創業小聚 Meet Startup Facebook 的最佳貼文
- 關於view binding 在 Online Station Facebook 的最佳解答
- 關於view binding 在 howtindog Youtube 的最佳解答
- 關於view binding 在 How to use view binding in Android - Stack Overflow 的評價
- 關於view binding 在 zeoflow/view-binding - GitHub 的評價
- 關於view binding 在 Fragments, ViewBinding and memory leaks - Stojan ... 的評價
view binding 在 創業小聚 Meet Startup Facebook 的最佳貼文
鄭涵睿認為危機有好壞之分的關鍵是,在好危機之下我們還能有所行動,「一個好的危機可以重新確立組織文化;在這個危機之下,你可以發現與同事間的 binding 比想像中更深;撐過去了這個危機,我們應該會有所成長。」
https://meet.bnext.com.tw/articles/view/47859
view binding 在 Online Station Facebook 的最佳解答
Dead by Daylight เปิดตัวแชปเตอร์ใหม่ A Binding of Kin กระตุกจิต!!
ดูตัวอย่างและรายละเอียด : https://www.online-station.net/pc-console-game/view/180068
.
มาพร้อมอัปเดตของคิลเลอร์กับเซอร์ไวเวอร์คู่ใหม่!!
#OnlineStation
view binding 在 howtindog Youtube 的最佳解答
最新消息請到 http://www.howtindog.com 或訂閱 http://facebook.com/howtindogs
Michael Coogan, God & Sex 最後一章節錄:
================
For readers who are believers, the Bible continues to be considered an authoritative guide. Yet, while upholding it as such, individuals and communities of faith today, as through the ages, have of necessity been selective--not just adopting, but adapting, modifying, and even rejecting some of its teachings.
...
Bible is an anthology of historically conditioned texts, how do these texts apply to later situations?
...
What a foundational text meant when it was written is not the only question that needs to be answered: we also have to determine what such a text means in the present. To do so requires ascertaining the ideals that underlie the text.
...
As an illustration, let us consider a specific issue from the culture wars of another era, the issue of slavery. Every part of the Bible reflects the views of its writers, and for them all, from the early Israelites to the latest authors of the New Testament, slavery was divinely ordained and beyond question. Yet the biblical story and the laws embedded in it also imply an alternate, even subversive view... [The] repeated references to the Exodus from Egypt is the principle of imitation of God: if God had delivered the Israelites from slavery, then perhaps Jews and Christians should do the same for their own slaves. They should treat others as they themselves had been treated, and would wish to be treated... The essence of the scripture, then, is fair and equitable treatment of others; the actual words are not necessarily binding.
Hence, relying on the overarching authority of the Bible, rather than on the actual words of specific biblical writers for whom slavery was not only permissible but even divinely decreed, abolitionists argued that slavery should be ended because it was contrary to the essence of the biblical message. The same analysis can be applied to issues like the status of women and, I would argue, of any individual or group perceived as inferior.
...
Any specific biblical text is an incomplete formulation of the ideal because it is historically conditioned, and so it should not be taken as absolute in any sense. Moreover, no single biblical text adequately expresses the ideal, and in fact some texts clearly counter to it from our perspective.
================

view binding 在 zeoflow/view-binding - GitHub 的推薦與評價
A lightweight library aiming to speed up Android app development by leveraging the new Android Data Binding together with the Model-View-ViewModel design ... ... <看更多>
view binding 在 Fragments, ViewBinding and memory leaks - Stojan ... 的推薦與評價
As an Android engineer one of the basic things you need to do is bind the views (written in XML) with Kotlin/Java code. ... <看更多>
view binding 在 How to use view binding in Android - Stack Overflow 的推薦與評價
... <看更多>
相關內容