Free Ebook cover Complete HTML, CSS and Javascript course to become a Front End Developer

Complete HTML, CSS and Javascript course to become a Front End Developer

3.79

(14)

125 pages

Front End software architecture: MVC, MVVM

Capítulo 105

Estimated reading time: 3 minutes

Audio Icon

Listen in audio

0:00 / 0:00

Software architecture is fundamental to the effective development of a software system. It provides a structure that allows understanding of the software system. Software architecture is especially important for front-end development as it provides the framework for the user interface and user experience. Among the most common front-end software architectures are Model-View-Controller (MVC) and Model-View-View-Model (MVVM).

Model-View-Controller (MVC)

MVC is a software architecture that separates business logic, user interface, and input control into three distinct components: the Model, View, and Controller.

The Model is the representation of data and business rules. It encapsulates data and provides methods to access and manipulate that data. Vision is the visual representation of data. It provides the user interface, which allows the user to interact with the data. The Controller is the bridge between the Model and the Vision. It receives user input through the View, processes the input, and updates the Model and View accordingly.

One of the main advantages of MVC is the separation of responsibilities. Each MVC component has a specific responsibility, which makes the system easier to understand, maintain, and expand. Furthermore, the separation of responsibilities allows different parts of the system to be developed and tested independently of each other.

Model-Vision-Model (MVVM)

MVVM is an extension of MVC that introduces a new component: the View Model. The Vision Model is an abstract representation of the Vision. It provides a bridge between the Model and the View that allows two-way data binding. This means that changes to Model data are automatically reflected in the View and vice versa.

Continue in our app.

You can listen to the audiobook with the screen off, receive a free certificate for this course, and also have access to 5,000 other free online courses.

Or continue reading below...
Download App

Download the app

One of the main advantages of MVVM is bidirectional data binding. It simplifies updating the user interface and synchronizing data between the user interface and the data model. Additionally, two-way data binding allows you to create more dynamic and responsive user interfaces.

Another advantage of MVVM is the separation of responsibilities. Like MVC, MVVM separates business logic, user interface, and input control into distinct components. However, MVVM goes one step further and also separates the presentation logic from the user interface. This makes the system even easier to understand, maintain and expand.

Conclusion

Software architecture is a crucial aspect of front-end development. It provides the framework for the user interface and user experience. MVC and MVVM are two of the most common front-end software architectures. Both offer a separation of responsibilities that makes the system easier to understand, maintain, and expand. However, MVVM offers the additional advantage of two-way data binding, which simplifies updating the user interface and synchronizing data between the user interface and the data model.

Therefore, when developing a front-end software system, it is important to consider the appropriate software architecture. The choice of software architecture can have a significant impact on the effectiveness and efficiency of the software system.

Now answer the exercise about the content:

Which of the following statements about front-end software architectures is true?

You are right! Congratulations, now go to the next page

You missed! Try again.

Option 3 is correct because MVVM, unlike MVC, introduces the ViewModel which allows two-way data binding. This simplifies updating the user interface and synchronizes the data between the UI and the data model, offering an advantage over MVC.

Next chapter

Javascript Design Patterns

Arrow Right Icon
Download the app to earn free Certification and listen to the courses in the background, even with the screen off.