U3 (Framework, MVC, TS)
U3 (Framework, MVC, TS)
1
Syllabus
Front-End Frameworks: What is web framework? Why Web Framework? Web Framework Types.
MVC: What is MVC, MVC Architecture, MVC in Practical, MVC in Web Frameworks.
Angular Version 10+: Angular CLI, Angular Architecture, Angular Project Structure, Angular Lifecycle,
Angular Modules, Angular Components, Angular Data Binding, Directives and Pipes, Angular Services
and Dependency Injections (DI), Angular Routers, Angular Forms.
2
Front-End Frameworks
3
What is web framework?
Web Application Framework or simply “web framework” is a software framework that is
designed to support the development of web applications including web services, web
resources, and web APIs.
In simple words, web frameworks are a piece of software that offers a way to create and run
web applications. Thus, you don’t need to code on your own and look for probable
miscalculations and faults.
Now, depending upon your task you may choose one web framework that fulfills all your
requirements or converges multiple frameworks.
4
What is web framework?
Web frameworks provide a standard way to build and deploy web applications on the World
Wide Web.
For example, you may have written a code to handle data validation for your web application.
In order to prevent having to re-write that code from scratch each time you make a website or
web service, the web framework does it for you.
5
Why Web Framework?
Saves time
Secure code
CRUD
Re-use of code
7
Types of Web Framework
1. Server-side Frameworks
To create a web application with a well-developed interface you need a wider range of functionality. Server-
side frameworks handle HTTP requests, database control and management, URL mapping, etc. These
frameworks can improve security and form the output data- simplifying the development process.
NET (C#)
Django (Python)
Express (JavaScript/Node.JS)
Symfony (PHP)
8
Types of Web Framework
2. Client-side Frameworks
Client-side frameworks don’t take care of the business logic like the server-side ones. They function inside the
browser. Therefore, you can enhance and implement new user interfaces. A number of animated features can be
created with frontend and single page applications. Every client-side framework varies in functionality and use.
Angular
Ember.JS
Vue.JS
React.JS
9
Front End Frameworks : React
◦ It comes in quite handy when you require building an interactive interface for an
application within a limited time because you can reuse the components in this
framework.
10
Front End Frameworks : Angular
o Angular usually deals with the development of mobile and web applications. Not just
that, but one can easily build both single and multi-page web applications.
o Due to its various features, Angular is opted by some of the biggest companies in the
o Although Angular has better features when compared to React, it is not easy to learn.
The framework is a bit complex and thus takes time to excel at.
11
Front End Frameworks : VueJS
o Firstly, it is not complex like Angular, which makes it easy to learn and use.
o Secondly, it is much smaller in size and similar to Angular, offers two-way binding, Visual
DOM, and component-based programming.
o VueJs is a framework that allows you to build both dynamic and small web applications with
ease.
o However, despite being versatile, it is not yet popular among big-scale companies. This is
because most large-scale companies still trust Angular for enterprise-based web applications.
o Some of the companies that use VueJs are Alibaba, 9gag, and Xiaomi.
12
Front End Frameworks : jQuery
o Despite being an older Framework, it is still popular and widely used. Jquery is a very simple
Framework that is easy to learn. With the framework, one doesn’t need to write extensive
Javascript codes.
o Despite being a simple framework, it can still be used to deploy dynamic applications.
o JQuery is not suggested for building large-scale applications because the excess javascript
code might make your application heavy.
13
Front End Frameworks : EmberJs
o It was developed in 2011 owing to the demands of modern technologies.
o With its component-based functionality and two-way data binding, Ember resembles Angular
a lot.
o Despite being one of the toughest Frameworks to learn, it is still used by some of the largest
companies like Linkedin and Apple.
o This is because it allows the developers to develop complex mobile and web applications
easily.
14
MVC
(Model-View-Controller)
15
What is MVC?
The Model-View-Controller (MVC) is an architectural pattern that separates an application
into three main logical components: the model, the view, and the controller.
Model: It includes all the data and its related logic
MVC Architecture
16
Features of MVC:
It provides a clear separation of business logic, Ul logic, and input logic.
It offers full control over your HTML and URLs which makes it easy to design web
application architecture.
It is a powerful URL-mapping component using which we can build applications that have
comprehensible and searchable URLs.
17
MVC Components
18
Example of MVC Architecture Design
2. Increase cohesion.
3. Reduce coupling.
4. Increase reuse.
20
Advantages of MVC:
Codes are easy to maintain and they can be extended easily.
It reduces complexity by dividing an application into three units. Model, view, and controller.
It works well for Web apps that are supported by large teams of web designers and developers.
This architecture helps to test components independently as all classes and objects are independent of each other.
21
Disadvantages of MVC:
It is difficult to read, change, test, and reuse this model
22
Popular MVC Frameworks :
Some of the most popular and extensively used MVC frameworks :
Ruby on Rails
Django
CherryPy
Spring MVC
Catalyst
Rails
Zend Framework
Fuel PHP
Laravel
Symphony
23
TypeScript
24
Introduction to TypeScript
TypeScript is an open-source, object-oriented language developed and maintained by Microsoft.
TypeScript extends JavaScript by adding data types, classes and other object-oriented features with type-
checking.
Why TypeScript?
25
Features
Cross-Platform
Object-Oriented Language
DOM Manipulation
ES 6 Features
26
Installation on Windows 8 or later
Following are the steps to be followed for installing the TypeScript code.
27
Installation on VS terminal
Following are the steps to be followed for installing the TypeScript code:
Your default terminal in VS is Powershell so you have to write tsc.cmd instead of tsc
To change default terminal to cmd , press crtl + alt + p -> terminal(with profile) ->
change to cmd
28
How to Write Program?
⮚ Generate js file
29
Type Annotations
The TypeScript is a typed language. We can specify the data type of the variables and
functions.
For specifying the data type of the variable the syntax is:
30
Variable and Constant Declaration
31
Modules in TS
The TypeScript code we write is in the global scope by default. If we have multiple files in a
project, the variables, functions, etc. written in one file are accessible in all the other files.
For example, consider the following TypeScript files: file1.ts and file2.ts
32
Modules in TS
33
Export Module
Use the prefix export with all the definitions you want to include in a module and want to access
from other modules.
34
Import Module
A module can be used in another module using an import statement.
35
Thank You!!!
36