Unlock all 53 lessons of Angular Web Development for the Real WorldFull course ₹40,000 · paid
Frameworks vs Libraries and MVC, MVP and MVVM Patterns
A free lesson from Skill-Lync's Angular Web Development for the Real World course, on Grow by Skill-Lync · Last updated 16 Nov 2026 · Session: “Week 1 Session 2”
What will you learn in this free Angular Web Development for the Real World lesson?
The lesson explains the vanilla JavaScript approach and why frameworks and libraries reduce repetitive code, using a manual versus automatic car analogy. It then distinguishes frameworks from libraries and compares the MVC, MVP and MVVM architecture patterns and when each suits a project.
- Vanilla JavaScript drawbacks for larger applications
- Difference between a framework and a library
- How MVC and MVP separate model, view and logic
- Why MVVM suits complex projects and Angular
What comes after lesson 2?
The next free lesson is lesson 3, “What Angular Is, TypeScript Basics and Week 1 Summary” (51 min). Later in Skill-Lync's Angular Web Development for the Real World course (paid): lesson 4, Week 2 Session 1; lesson 5, Week 2 Session 2; lesson 6, Week 2 Session 3. The full course has 53 lessons (25 h 59 min of video); see the course overview or its price and syllabus.
Lesson transcript
Machine transcript of the lesson audio (lightly cleaned). Technical terms may contain errors; the video is the reference.
Welcome back, everyone. So far, we have understood what is front-end web development and also understood a few phrases and jargons related to the web development. In this current session, we will try to understand what is the meaning of a framework versus what is a library and how they are used for web development. As you already know, we can develop any website or native application using hybrid model using the conventional HTML, CSS and JavaScript language. And you can just use the combination of these three to write any of the web application from this grant.
When you use only HTML, CSS and JavaScript, this is called the Vedela approach. What is the meaning of Vedela approach is you don't use any of the third-party libraries, frameworks or tools to design your website. And you just use the plain functional HTML, CSS and JavaScript to write your web application. So, the one major drawback of this approach is that your code will get extremely long and repetitive since we end up focusing more on the implementation path and lose the focus on the user experience. What I mean by that is since you are going to implement everything from the scratch and like, you know, you have to write a lot of code to implement a lot of functionalities.
Instead of focusing more on enhancing the user experience, we will end up kind of writing a lot of excessive code, which will end up making the code quite repetitive, long and also difficult to maintain. So, let's try to understand this with a real world example. So, assume that you are a car driver and your only goal is to make your passenger reach the destination safely and quickly. So, assume that, you know, you are a Uber or a ULA driver and your only goal is to ensure that your passenger is able to reach their destination safely and quickly.
So, now assume that, you know, you have two cars to choose from. One is an automatic car and one is a manual transmission car. Which one would you drive? So, the answer is simple, right? Since your only goal is to ensure your passenger is able to reach their destination safely and quickly, you can choose an automatic car because you can avoid spending your energy or shifting gears and, you know, spend more time, on being alert on the road and, you know, also engage with your passengers and have some chat with them just to keep them engaged on the journey.
So, just on the similar lines, when you consider, like, you know, the Wedela.js approach versus using a framework and libraries, this is what is the corresponding, you can say, correlation in the web development world as well. So, we can also apply the similar analogy of this manual versus automatic car to the web development as well. So, when you use Wedela.js, it is more like a manual transmission car where you have the control over the entire mechanism and implement it the way you want it from scratch.
But it also kind of introduces some, you can say, like, you know, inefficiencies in the system where you have to go back and, like, you know, write a lot of code, maintain it. And, you know, it can also lead to a lot of, like, you know, bulky code and long-term issues while to maintain your code. Whereas, in terms of your frameworks and libraries, they simplify on the implementation aspect and make it easy for you to get the code working quickly with minimal efforts. Now, let's try to understand what are frameworks and libraries.
See, frameworks are the complete ecosystem which are available to develop any particular application wherein they provide all the necessary tools and utilities right from creating the app in your local machine to all the way getting it deployed to the servers. Just to understand it, you can understand it in this way that, say, like, you know, you want to create a web application of, say, maybe, like, you know, you just want to create a e-commerce website. So, you don't really have to, like, you know, think about how do I need to create this button, how do I need to create that pop-up, how do I need to ensure that, you know, my screen one is able to talk or send data to screen two, so on and so forth.
If you do it with a vanilla JS approach, all these things has to be done by you using the plain HTML, CSS or JavaScript. But when you use a framework, most of these things are given to you by default by the framework itself. So, all you need to do is focus on implementing the functionality rather than worrying about the implementation aspect of it. So, on the framework, Angular is a popular web application framework that is used by many leading corporates to build web and hybrid application.
As you may know, which we saw in the previous lectures, a web application is something that runs on your browser and a hybrid application is something that gets packaged as a native application and runs in the browser of the particular operating system on which it is being executed. So, now let's try to understand what is a library. So, a library is nothing but a standalone utility that can just be plug-and-played into any framework or even in the vanilla JS. They do not provide end-to-end solution for web and mobile application development, but they usually address only a particular set of features or concerns.
React or jQuery is a popular library that is used in modern web and mobile development application. So, let's try to understand this with a corollary. So, assume like you know, you need to have a functionality which say converts like you know, your HTML table into say a PDF or like you know, a doc, a word document. So, in those kind of scenarios, it is just a single functionality which needs to be implemented. And for these kind of scenarios, you may have a ton of library available in the NPM marketplace which can be used for this.
Particularly doing this that, for just for a particular feature or particular functionality or a concern, you use a library which just addresses that particular point. It does not provide an end-to-end solution for your entire web development journey. But on the, to the contrary, it does provide you a solution for a particular feature. So, similarly, React is also a library which is used for your modern web and mobile application development. So, what function React provides is, is that React, why we call React a library rather is, because React does not provide you the complete set of frameworks or features for end-to-end development.
But rather, it particularly addresses the part of like you know, how to create your, the front-end or the UI of the application just by ensuring you use a virtual doc and create your application. Whereas, the other parts such as, how to like navigate between the pages or how to manage the state of your application and other aspects of it, it is managed by the different libraries or plugins which are used along with React to achieve that. So, that's why we see that React is a popular library, whereas Angular is a framework.
You guys need to understand this and this is important because in interviews a lot of times, they ask like you know, can you tell me is Angular a framework and is React framework or a library? So, you should be able to make that differentiation of like you know, when I give you a particular technology name, be it Angular, Vue or React, you should be able to say like you know, what is a library or what is a framework? So, just to recap it again, we can say that you know, a framework provides an end-to-end solution for the complete web or mobile development and it gives you all the features out of the box, right from setting up of the application till the point where you get it deployed.
Whereas, a library just provides a particular feature or a particular functionality and it does not addresses the end-to-end web development part of it. And each of these framework and libraries, they have their own advantages and disadvantages. So, frameworks usually, since they provide end-to-end solution and they are more developer friendly, since they provide the developer with a set of standard tools, recommendations and guidelines to implement any web applications based on requirement. Whereas, the libraries are more suited in scenarios where developers need the freedom in choosing their own custom set of tools or utilities that would be required to build a web application.
So, you can just consider this to be like you know, a framework is more like you know, you get everything out of the box and the developer just needs to customize them a bit and use it. Whereas, a library you can just say like it's more like a plug-and-play solution where you can combine multiple libraries to build a solution. So, the next big question that usually comes in is, which framework or library is better? So, as you may know, there are a lot of frameworks and libraries which are available in market for web development.
You might have heard about Angular, React, Vue.js and you know, there are also a bunch of libraries and frameworks which are coming up every day. So, like you know, this is a normal interview question which gets asked like you know, which framework or library do you prefer for web development? From my personal experience, I would say that you know, there is never like you know, a clear answer to this because a lot of decision depends on the project to be implemented, the skill set of the developers who are in the project and the timeline for implementing the project.
See, every project is unique. So, that's why like you know, there's never like you know, one size fits all answer to this. You can never say that okay, Angular is the best framework to be used in any web development or React is the best library to be used for any web development, so on and so forth. So, it all depends about you know, as I said, more about the project which has to be implemented, the skill set of the developers and also the timeline for implementing the project.
So, based on all these factors, we decide which library or framework should be used for the web development. And every framework or library comes with its own set of strength and weakness which gets addressed better with every new release. What I mean by that is, any time a new version of Angular or React comes in, it basically gives you newer features or addresses some old concerns which were there in the earlier releases. And also like you know, most of the frameworks and libraries, they try to like you know, upgrade themselves over a period of time.
And due to that, no single framework or library is the only solution to all the developers in across any industry and hence it's vital that you as a developer, analyze and use every framework and libraries before taking your call on which one to implement. So, what I mean by that is, when you are exploring newer libraries or frameworks in earlier part of your career, so just play around like you know, use Angular for some time, use React for some time, try out Vue.js. Try to see like you know, for a similar situation, how can you code using Angular, then how can you code using React, how can you code using Vue.js and try to develop your own kind of like you know, your own viewpoints and see like you know, which one does suits you better.
And based on that, you can take a call like you know, so in a future project, which one do you think would be a better fit for that particular project. Before we move on to like, you know, what is Angular and proceed with the further part of the session, I would like to like first go back to the basics that make you guys understand what are the architecture patterns which are normally used in the frameworks and libraries. And for that, we'll be going back to the whiteboard. Okay. So before we go in any further, I want to clear a few basics which are generally not covered in other courses.
And I thought it would be a better way that, you know, we first cover this before going further into what is Angular and other stuff. So when I say architecture pattern, let's try to understand like, you know, how any web application is being architecturally designed or like, you know, how it is being designed in the backend. So basically, as you know, any web application is being written with HTML, CSS and JavaScript, right? So using these three technologies, we kind of compose our web application. So the HTML and the CSS part of it takes care of the UI or the view part of it, whereas the JavaScript part is where we are bothered about like, you know, handling the user events and manipulating the data and so on and so forth, right?
But this is from a developer perspective. But we also need to understand architecturally how does all this thing fits together. I mean, like, you know, if I design a web application, how can I design the blueprint or the architecture of it? And so for that, we basically have three architecture design patterns, which are normally used in any web application or frameworks, which are normally used. The oldest and the most widely used pattern is something called as MBC, which is called as model, view and controller. So this is one of the very famous model of architecture pattern, which is used in to design any web application.
So what happens in a model view controller is we have three components. So assume like, you know, this is my model. This is my view. And this is my controller. And before we go into what is like how it works together, let's try to understand what each of these are. So what is the model? A model is nothing but, you know, this is where it stores all your application related data. So what I mean by data is, say, like, you know, you have a e-commerce application wherein, like, you know, you show your product data or you show it a page where the user details like his name or address or something.
Any kind of data, like, you know, related to the user or the application is being shown on the screen. This is called as model, right? And what is a view? A view is nothing but it's the UI which actually gets shown to the user. As I said earlier, like, whatever you write with your HTML, that is nothing but it's called the view where the user actually sees the page on the browser. And what is a controller? A controller is nothing but that is what establishes the relationship between the view and model.
As you guys may understand, a view is nothing but what we essentially do is whatever is the data, we just manipulate it, make it more presentable and show it on the view, right? And just to ensure that we are able to do that, we need the controller. So, now, let's try to understand how this works. So, on the view, what happens is, view depends on the model where we basically just get the data, right? So, what view does is, it makes a call to the model and gets the data.
And what controller does it, controller based on any of the user event or any of the events or other triggers which may be there, it will update this data, okay? And once that is being done, finally, it will refresh the view, okay? So, now, let's try to understand, you know, using a sample workflow. So, say, assume like, you know, I load my application and I come to the landing page. So, assume like, you know, this is my landing page of my website and I just have kind of a very simple profile page where I have the user name and I have the user address, okay?
So, what happens over here is step number one, my view, which is nothing but my HTML, right? It will first try to get the data which has to be shown over here. So, this is the step number one, where my view will get the data from the model, right? And my model has the data, so which kind of gets like, you know, thrown back to the HTML. So, now, let's take another scenario. So, say, assume like, you know, I have in my JavaScript, I have written an API call which kind of like, you know, fetches the data from the API and updates that profile data into the model, right?
So, this is done by the controller, where it, we make the API call to the backend, get the data and once I get the data, I will update the data to the model, okay, which is done by the controller. And once that is done by the controller, we then kind of refresh the view to ensure that, you know, this updated data is coming on the HTML. So, this is my step number three and this is my step number two. So, just to recap it, I will just tell it again.
So, assume that this is my HTML page or my website webpage that is being loaded. So, initially what happens is, I don't have any data on my view. So, I just try to fetch the data from the model. I have a controller in the backend, like in my UI application, which will first make and say API call to the backend, get the data, then it will update the data to the model and then it will refresh the view. So, just to ensure that the view is able to get the latest data from the model and display it on the screen.
So, this is how a sample MVC pattern looks like, okay. So, most of the earlier web application designs were using MVC model, okay. So, now next, let's try to understand what is the next pattern, which is the MVP pattern, okay, which is nothing but model, view and presenter. So, as you would have noticed, in the previous pattern, we had a controller and in the current pattern, we have a presenter, right. So, what happens in this model is, let's try to understand it first in a diagrammatic fashion.
So, my presenter is over here, my view is over here and my model is over here, okay. So, what happens is, so, assume like, you know, I have my view, my view is nothing but my HTML, my model is nothing but my data and my presenter is nothing but, I will just explain to you in a simple fashion. So, presenter is nothing but, it fetches the data from the model and applies the UI logic to decide what to display and it also manages the state of the view and takes action according to the user's input notification from the view, okay.
So, let's try to understand it from a diagrammatic perspective. So, say from my view, there is some user action, okay, so, which could be like, you know, I clicked on something or I, like, you know, submitted something, so on and so forth, right. Any of the user action, okay. So, what happens is, or from the view, if my user is performing any action, then what happens is, the presenter will go and update the model, okay. So, model is nothing but the data, so based on whatever the user has done, the presenter will go and update the model and once my model is updated, it will send a notification to the presenter that the data or the model has been changed.
So, in this case, what happens is, my presenter first updates the model and once the model is updated, it will send back a notification to the presenter stating that the model is changed and once the presenter receives the notification, that the model is changed, it will go back and update the view stating that the model is changed. So, this is how, kind of, like, you know, your MVP model, which is your model, view and presenter works. So, from the previous design, you might now understand that, you know, this is more, kind of, a dynamic approach in handling the UI application because your presenter is, kind of, at the center point and it decides, like, you know, when the user action receives and when your data is getting updated, when to update the view, so on and so forth.
So, I would say that, you know, MVP is more of an advanced version of MVC. Now, let's try to understand a new pattern which is currently being used by, like, you know, most of the modern web frameworks like Angular, React and so on, which is called as MVVM, right, as you would have observed, earlier we had MVC, then we had MVP and now, what is getting changed is MVVM and the full form of this is model, view, view, model. So, don't get confused on what is this, we'll try to address this in brief.
So, what is MVV pattern is? This is also similar to your MVP design pattern where, instead of the presenter role, now we are changing and replacing it with a view model role. So, the main application of the use case of MVVM is, it is trying to address a few of the drawbacks of the MVP pattern and what it does is, it separates the data presentation logic from the core business logic of the application, okay. So, let's try to understand what is this view model, like, you know, we understand what is a model, what is a view, but what is a view model, okay.
So, view model is nothing, but it just exposes the data which are relevant to the view, right. And it kind of serves as a link between your model and view, just like a controller. So, what happens is, This is also similar to your MVP pattern. So, just let's try to understand it pictorially. So, we have a view over here. We have a view model over here. And we have a model over here. Okay. So, what happens is, first, let's try to understand it little in detail. Okay. So, first, let's try to understand what happens.
So, assume my user has performed some action, right? So, assume that my user has performed some action, like, you know, they have either clicked on something or they have submitted a data, right? So, assume this is my action which the user has performed. So, what happens is, from the view, there is an event which gets triggered to the view model, right? And once that is done, what happens is, if required, my view model will go and it will write or update this data to the model. Okay.
And internally, also what happens is, my model can also read the data from this view model. And similarly, once the data manipulation is completed, it will send back notification back to my view model, stating that, you know, what are the change events that has occurred. Okay. Don't worry, you'll try to, like, also understand it with a real world example. But just bear with me and, you know, just follow the process. So, once that is being done, what happens is, from my view model, there are two things which will happen.
One is, whenever there is a change to any properties or any data, there will be a kind of, like, you know, event which will be triggered back to the view model, stating that, you know, these are the change events which have occurred. And also, whenever there is any, like, you know, actual data change, that also gets triggered back to the view, stating that, you know, this is the current view model data. Okay. Now, let's try to understand this in a more of a real world scenario.
Okay. So, assume that, you know, and before we go to that, I also want to tell you guys one thing, that using MVVM model, it is easy for us to kind of implement two-way data binding. So, this is a very important interview, like, you know, concept. So, how do you implement a two-way data binding? So, for that, technically, we have to use MVVM. And how it is used, I will tell you now. And before that, let's try to understand what is a two-way data binding. So, what two-way data binding essentially means is, like, say, assume that, you know, you have a view and you have a model.
So, any change in view should automatically trigger the change in model. And any change in model should automatically trigger the change in view. I will show you a real world example when we get into angular coding. But for now, just try to assume that, you know, pictorially on this. So, assume that, you know, I have a HTML page. And whenever I type something on that, I am able to see that data in real time on the screen. And similarly, in my application, if I change some logic and I change some data, immediately that data is also getting updated automatically.
Right. So, that is something called a two-way data binding. Where any changes to either your view or your model is seamlessly getting synchronized. Okay. So, coming back to this model view, view model, what happens essentially is, on your view, right, whenever there is any kind of like a user event, like a click or a submit or any of those kind of event, it triggers an event to your view model. Okay. That is your first step in the process. Then your view model, from your view model, then there are two options possible.
Right. You know, what it will do is, it will trigger a kind of a write data to your model. So, model is nothing but your data. So, from your view model, it kind of like, you know, tries to write or update the model to your, to your models too. And from your model, the model can also read what is currently there in the view model. Okay. And similarly, whenever there is any change to your model, it will trigger a change event to your view model. And that change event will again cascade back to your view.
Okay. So, basically, what your view gets back is two things. One, what are the change events? And two, what is the data? So, these are the two things which will be received back by the view once there is any user action performed. So, this is what is the model view view model architecture. So, now that we know, like, you know, we have seen three architecture patterns, right? One is your MVC. One is your MVP. And the third one is MVVM. So, and understand that, you know, each one of these architectures is that addition to the previous architecture.
As I said, this was the first architecture which was implemented. This was the enhanced version of model view controller. And MVVM is an enhancement over model view presenter, right? And we just tried to summarize, like, you know, what are the pros and cons of each of these model views? So, for MVC, it is one of the oldest software architecture which we know. Whereas, for MVP, it was developed, as I said, as a second iteration for the MVC just to address a few of the concerns which MVC had.
And MVVM is the current modern or the industry recognized pattern which is commonly used by most of the modern web frameworks, right? And in the MVP, your view and model are tightly coupled. So, in MVC pattern, any, your model and your view is not decoupled. They are very tightly coupled. Whereas, in your MVP pattern, this is resolved by using presenter. So, your model and view are loosely coupled. And also, the same pattern is followed by MVVM as well, that your model and view are decoupled, right?
Now, and in MVVM pattern, we use more of an event-driven architecture wherein we separate the business logic from the view. And similarly, there are other bunch of, like, you know, benefits of using the MVVM pattern. But, just to make you clear, MVVM pattern is slightly complex to implement. So, it is generally recommended for a complex project, we go with a MVVM pattern. But, for a smaller project, it is better to, like, you know, stick to the MVC pattern. This is just for your interview purpose. If someone asks you, like, you know, what would you recommend for a small project, you can say that, you know, you would either go with the MVC pattern or MVP pattern.
Because, from a coding perspective, using MVVM for a small project is not recommended. However, for a complex project, MVVM is more recommended than any other pattern, okay? And, one more advantage of MVVM is that it is more modular. It is, you can unit test it very easily. You can write unit test cases for various components very easily. And, since it is decoupled and event-driven, it is more scalable as well. So, for any complex or medium-sized project, MVVM-based architecture is more recommended. And, you don't need to worry on how do I create all this model-view-view-controller.
Because, that is where, as I said, Angular gives you all the solution out of the box. Just by using the relevant Angular code and utilities, you would be able to implement this out of the box, right? So, yeah, this is just for your information. I have just touched upon all this architecture patterns. And, with that being said, we have reached to the end of session 2. And, I look forward to see you in the session 3 of the week 1. Thank you.