SlideShare a Scribd company logo
1 of 24
A Template For Success
Debajani Mohanty
Java Script Framework
Challenges in Front-end
Development
As per well-known lead front-end developer of Yahoo
as well as author to many related technical books,
Nicholas Zakas “Front end development is the most
hostile development environment in the world."
Once a front end developer has finished doing their
job, they get right back to work making sure that the
product functions optimally on every browser, mobile
device, and high-end toaster oven under the sun that
makes Front end development much more
complicated than it seems.
It’s also important to focus on the security of the
product, protecting against CSRF, XSS, DNS pinning,
and clickjacking.
Single Page Applications
The old-timers in Java might still remember the Swing & Applet
applications that formed the thick client web based UI. It was later to
be replaced with Jsp and many different template technologies that
offered thin client solutions. In last few years we are again moving
back to the fat client approach that we had started with.
In past few years, Single Page Applications (SPAs) have become
extremely popular on the web, because they are supposed to provide
a more fluid user experience entirely based on fat client approach.
Difference From Traditional Web
Application
 In traditional web applications, the client (browser)
initiates the communication with the server by
requesting a page. The server then processes the
request and sends the HTML of the page to the client.
In subsequent interactions with the page –e.g. the
user navigates to a link or submits a form with data– a
new request is sent to the server, and the flow starts
again: the server processes the request and sends a
new page to the browser in response to the new
action requested by the client.
 In Single-Page Applications (SPAs) the entire page is
loaded in the browser after the initial request, but
subsequent interactions take place through Ajax
requests. This means that the browser has to update
only the portion of the page that has changed; there is
no need to reload the entire page. The SPA approach
reduces the time taken by the application to respond
to user actions, resulting in a more fluid experience.
SPA Frameworks
The three major players in this area are AngularJS,
EmberJS and Backbone.js
All the above mentioned frameworks have common
features: their code is open, released under MIT license &
they solve tasks of single-page web application creation
with the help of MV* designing template. All of them have
the concept of scene, event, data models & pathnames.
 Backbone stands for minimalism. It is fast & simple in
teaching & provides a minimal set of the necessary tools.
 Angular is an innovator in extending HTML possibilities. It
has a huge community & support from Google, it will have
a constant growth & development. It suits well for fast and
simple way to create a mockup as well as for huge
projects.
 EmberJS has the highest learning curve. Yet it would suit
relatively bigger applications with long running client
sessions. If you are creating heavy RESTful front-end
apps, Ember is your framework.
Advantages Of AngularJS
 AngularJS provides capability to create Single
Page Application in a very clean and maintainable
way.
 AngularJS provides data binding capability to
HTML thus giving user a rich and responsive
experience
 AngularJS is opensource & code is unit testable.
 AngularJS uses dependency injection and make
use of separation of concerns.
 AngularJS provides reusable components.
 With AngularJS, developer write less code and
get more functionality.
Cases where Angular shines?
 Building form-based "CRUD apps".
 Throw-away projects (prototypes, small apps).
 Slow corporate monoliths, when performance
does not matter and maintenance costs are not
discussed
Where Angular Fails
 Teams with varying experience.
 Projects, which are intended to grow.
 Lack of highly experienced frontend lead
developer, who will look through the code all the
time.
 Project with 5 star performance requirements.
 Application written in AngularJS are not safe.
Server side authentication and authorization is
must to keep an application secure.
 If your application user disables JavaScript then
user will just see the basic page and nothing
more.
Node JS
 AngularJS is mostly but not necessarily used with
NodeJS.
 It can also be used with Tomcat or any other
standard J2EE server.
 Node.js is an open-source, cross-platform runtime
environment for developing server-side Web
applications.
 Node.js is not a JavaScript framework, but its
applications are written in JavaScript and can be
run within the
 Node.js runtime on a wide variety of platforms
that varies from Windows, IBM AIX, Linux or few
NodeJS Single Thread Vs Java EE Multiple
Thread
 Node.js provides an event-driven architecture and a non-blocking I/O API
designed to optimize an application's throughput and scalability for real-time
Web applications. The most important differences between NodeJS and
Java are the concurrency and I/O models. Java uses multi-threaded
synchronous I/O while NodeJS uses single threaded asynchronous I/O.
 The below diagram shows how in a multithreaded environment, multiple
requests can be concurrently executed, while in a single-thread environment
multiple requests are sequentially executed. Of course, the multi-threaded
environment utilizes more resources.
 It may seem obvious that a multithreaded environment will be able to handle
more requests per second than the single threaded environment. This is
generally true for requests that are compute intensive, which utilize the
allocated resources extensively.
Resource Usage
 However, in cases where requests involve a lot of I/O such as
database or web service calls, each request needs to wait for the
external engine to respond to the calls made, and hence the
allocated CPU and memory resources are not used during this
wait time.
 The following diagrams illustrate this scenario where requests
involve I/O wait times:
 Node.js is typically used where light-weight, real-time response
is needed, like communication apps and Web-based gaming. It
is used to build large, scalable network applications
Popular NodeJS Projects
 GODADDY
 GROUPON
 IBM
 LINKEDIN
 MICROSOFT
 NETFLIX
 PAYPAL
 RAKUTEN
 SAP
 VOXER
 WALMART
 YAHOO!
Is Node JS a replacement to Apache
Tomcat
 This diagram shows the market position of the selected technologies
in terms of popularity and traffic compared to the most popular web
servers.
 As per a report in https://dzone.com/articles/performance-
comparison-between that compares the performances of tomcat and
nodeJS, The Node.js is 20% faster than the Java EE solution for
the problem at hand.
Working with MEAN stack – The
Complete Solution
 The MEAN stack (MongoDB, Express.js, Angular.js,
Node.js) is now being deemed as the new LAMP (Linux,
Apache, MySQL, PHP), the preferred technology stack for
startups.
 In the MEAN stack, the Linux operating system is replaced
with any operating system that Node.js can run on. This
includes MS Windows, Mac OS, and Linux. The Apache
web server is replaced with the Node.js. The MySQL is
replaced with MongoDB, which is a No-SQL database. The
PHP server side programming language is replaced with
the ExpressJS, which basically provides a thin layer of
features over Node.js. Here is a key point; the ExpressJS
and Node.js in combination are tools to run JavaScript on
the server side.
 MongoDB with its JSON document structure comes with a
lot of flexibility and helps to create highly scalable solution
and faster applications. MEAN stack is great for POC
projects and for dealing with data that may ultimately prove
tricky to constrain in table form.
The “MEAN” Architecture
Angular JS & Spring
Usage of Angular JS consuming Spring REST based web services has
become very popular nowadays as it gives us the option to build a
complex, secure, high-traffic, enterprise level single-page application. In
fact many existing projects currently migrating their Spring MVC
application from JSP to Angular JS. We may use Spring Boot to quickly
build such an application with production-ready services, Basic health-
check and monitoring functions, Pre-configured, embedded Tomcat
server, Executable JAR packaging with all dependencies included, Very
little overall configuration overhead.
Why Unit Testing In Javascript?
 JavaScript is a dynamically typed language
comes with almost no help from the compiler. So
JavaScript needs to come with a strong set of
tests.
 AngularJS is developed with unit testing in mind.
With features like dependency injection testing
components are much easier, because you can
pass in a component's dependencies and stub or
mock them as you wish.
 For testing Angular applications there are certain
tools that you should use that will make testing
much easier to set up and run. We need to know
the usage of Karma, Jasmine, angular-mocks.
Karma
 Karma is The official AngularJS team test runner.
We’ll use it to launch Chrome, Firefox, and
PhantomJS.
 It’s a JavaScript command line tool that can be used
to spawn a web server which loads your application's
source code and executes your tests. You can
configure Karma to run against a number of browsers,
which is useful for being confident that your
application works on all browsers you need to
support. Karma is executed on the command line and
will display the results of your tests on the command
line once they have run in the browser.
 Karma is a NodeJS application, and should be
installed through npm. Full installation instructions are
available on the Karma website.
Jasmine
 Jasmine is a behavior driven development
framework for JavaScript that has become the
most popular choice for testing Angular
applications. Jasmine provides functions to help
with structuring your tests and also making
assertions. As your tests grow, keeping them well
structured and documented is vital, and Jasmine
helps achieve this.
angular-mocks
 Angular also provides the ngMock module, which
provides injecting & mocking for your tests. This
is used to inject and mock Angular services within
unit tests. In addition, it is able to extend other
modules so they are synchronous. Having tests
synchronous keeps them much cleaner and
easier to work with. One of the most useful parts
of ngMock is $httpBackend, which lets us mock
XHR requests in tests, and return sample data
instead.
Mocha
 Mocha is a feature-rich JavaScript test framework
running on Node.js and in the browser, making
asynchronous testing simple and fun. Mocha tests run
serially, allowing for flexible and accurate reporting,
while mapping uncaught exceptions to the correct test
cases.
 Mocha is free and open source, licensed under the
MIT license.
Why Integration Testing In
Javascript?
 As applications grow in size and complexity, unit as
well as manual testing would not be enough.
 Integration testing is to test between components
which can't be captured in a unit test. End-to-end
tests are made to find these problems.
 In large projects where we have hundreds of
developers working in different teams a practice of
running all integration tests should be mandatory
before merging the code to master repository. It
enables all developers to minimize the risks of their
code & features overwritten by someone else’s by
mistake.
 Automation testing of such end-to-end scenarios
would ensure integrity of all modules in all
environments.
Summary
 In the times of rapid app development, we need better ways to quickly
develop interactive web applications and that is where JavaScript
frameworks come to the rescue.
 While learning Tech stack of Angular JS Architects and senior developers
must note that we have to wisely select a group of technologies, be it Node
JS or Spring MVC, that fits into our requirements and address all the non-
functional requirement of the application.
 Comparing NodeJS with Spring would be like comparing Apples with
Oranges. Node.js is a platform while spring is a enterprise framework and
both have totally different usecases.
 Node JS is better than Spring in creating Web services written on top of
NoSQL and RDBMS databases. The whole non-blocking model makes Node
JS a lot more faster than Web services implemented on top of Spring and
hosted on J2EE servers. Java + whole J2EE stack + Spring stack adds a lot
of overhead, and if you goal is to serve REST calls, Node JS gets the job
done, and gets it done well.
 Spring is better at creating enterprise Java applications. It integrates into the
Java ecosystem a lot better than Node JS. If you have a lot of COTS
applications in your ecosystem, a Spring based web application will integrate
much easily.
References
 NodeJS - https://en.wikipedia.org/wiki/Node.js
 MEAN stack - http://www.newspindigital.com/wp-
content/uploads/2014/08/NSD_Node.js-Stack-
1024x534.png
 Market Position NodeJS Vs Tomcat -
http://w3techs.com/technologies/comparison/ws-
nodejs,ws-tomcat
 What Developers Mean When They Build a MEAN
Stack - https://www.newspindigital.com/nsd-tech-
primer-the-mean-stack-a-k-a-full-stack-javascript/
 Java EE threads v/s Node.js – which is better for
concurrent data processing operations -
http://bijoor.me/2013/06/09/java-ee-threads-vs-node-
js-which-is-better-for-concurrent-data-processing-
operations/
 Unit Testing - https://docs.angularjs.org/guide/unit-
testing

More Related Content

What's hot

R2DBC Reactive Relational Database Connectivity
R2DBC Reactive Relational Database ConnectivityR2DBC Reactive Relational Database Connectivity
R2DBC Reactive Relational Database ConnectivityMaarten Smeets
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Bhupesh Bansal
 
Database project edi
Database project ediDatabase project edi
Database project ediRey Jefferson
 
Caching and Its Main Types
Caching and Its Main TypesCaching and Its Main Types
Caching and Its Main TypesHTS Hosting
 
Oracle Autonomous Database for Developers
Oracle Autonomous Database for DevelopersOracle Autonomous Database for Developers
Oracle Autonomous Database for DevelopersTércio Costa
 
Azure Cloud Patterns
Azure Cloud PatternsAzure Cloud Patterns
Azure Cloud PatternsTamir Dresher
 
Introduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationIntroduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationAndrew Siemer
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...WebStackAcademy
 
Scalability using Node.js
Scalability using Node.jsScalability using Node.js
Scalability using Node.jsratankadam
 
Azure - Data Platform
Azure - Data PlatformAzure - Data Platform
Azure - Data Platformgiventocode
 
Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite
Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache CalciteEnable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite
Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache CalciteVMware Tanzu
 
Implement SQL Server on an Azure VM
Implement SQL Server on an Azure VMImplement SQL Server on an Azure VM
Implement SQL Server on an Azure VMJames Serra
 
Introducing Azure SQL Database
Introducing Azure SQL DatabaseIntroducing Azure SQL Database
Introducing Azure SQL DatabaseJames Serra
 
Azure Cloud Dev Camp - Introduction
Azure Cloud Dev Camp - IntroductionAzure Cloud Dev Camp - Introduction
Azure Cloud Dev Camp - Introductiongiventocode
 
10 Tricks to Ensure Your Oracle Coherence Cluster is Not a "Black Box" in Pro...
10 Tricks to Ensure Your Oracle Coherence Cluster is Not a "Black Box" in Pro...10 Tricks to Ensure Your Oracle Coherence Cluster is Not a "Black Box" in Pro...
10 Tricks to Ensure Your Oracle Coherence Cluster is Not a "Black Box" in Pro...SL Corporation
 
NoSQL - No Security?
NoSQL - No Security?NoSQL - No Security?
NoSQL - No Security?Gavin Holt
 

What's hot (20)

Azure cosmosdb
Azure cosmosdbAzure cosmosdb
Azure cosmosdb
 
R2DBC Reactive Relational Database Connectivity
R2DBC Reactive Relational Database ConnectivityR2DBC Reactive Relational Database Connectivity
R2DBC Reactive Relational Database Connectivity
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
 
Database project edi
Database project ediDatabase project edi
Database project edi
 
Caching and Its Main Types
Caching and Its Main TypesCaching and Its Main Types
Caching and Its Main Types
 
Oracle Autonomous Database for Developers
Oracle Autonomous Database for DevelopersOracle Autonomous Database for Developers
Oracle Autonomous Database for Developers
 
Azure Cloud Patterns
Azure Cloud PatternsAzure Cloud Patterns
Azure Cloud Patterns
 
Introduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationIntroduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregation
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 
CQRS
CQRSCQRS
CQRS
 
Azure Data Storage
Azure Data StorageAzure Data Storage
Azure Data Storage
 
Scalability using Node.js
Scalability using Node.jsScalability using Node.js
Scalability using Node.js
 
Azure - Data Platform
Azure - Data PlatformAzure - Data Platform
Azure - Data Platform
 
Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite
Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache CalciteEnable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite
Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite
 
Implement SQL Server on an Azure VM
Implement SQL Server on an Azure VMImplement SQL Server on an Azure VM
Implement SQL Server on an Azure VM
 
Introducing Azure SQL Database
Introducing Azure SQL DatabaseIntroducing Azure SQL Database
Introducing Azure SQL Database
 
Azure Cosmos DB
Azure Cosmos DBAzure Cosmos DB
Azure Cosmos DB
 
Azure Cloud Dev Camp - Introduction
Azure Cloud Dev Camp - IntroductionAzure Cloud Dev Camp - Introduction
Azure Cloud Dev Camp - Introduction
 
10 Tricks to Ensure Your Oracle Coherence Cluster is Not a "Black Box" in Pro...
10 Tricks to Ensure Your Oracle Coherence Cluster is Not a "Black Box" in Pro...10 Tricks to Ensure Your Oracle Coherence Cluster is Not a "Black Box" in Pro...
10 Tricks to Ensure Your Oracle Coherence Cluster is Not a "Black Box" in Pro...
 
NoSQL - No Security?
NoSQL - No Security?NoSQL - No Security?
NoSQL - No Security?
 

Similar to Java script framework

What is Node.js_ Where, When & How To Use It.pdf
What is Node.js_ Where, When & How To Use It.pdfWhat is Node.js_ Where, When & How To Use It.pdf
What is Node.js_ Where, When & How To Use It.pdfSmith Daniel
 
All You Need to Know About Using Node.pdf
All You Need to Know About Using Node.pdfAll You Need to Know About Using Node.pdf
All You Need to Know About Using Node.pdfiDataScientists
 
9 Best JavaScript Frameworks To Choose
9 Best JavaScript Frameworks To Choose9 Best JavaScript Frameworks To Choose
9 Best JavaScript Frameworks To ChooseAlbiorix Technology
 
Why You Should Use MERN Stack for Startup Apps?
Why You Should Use MERN Stack for Startup Apps?Why You Should Use MERN Stack for Startup Apps?
Why You Should Use MERN Stack for Startup Apps?Pixel Crayons
 
COMP6210 Web Services And Design Methodologies.docx
COMP6210 Web Services And Design Methodologies.docxCOMP6210 Web Services And Design Methodologies.docx
COMP6210 Web Services And Design Methodologies.docxwrite31
 
Big Improvement_ New AngularJS Tools Changing How We Develop.pptx
Big Improvement_ New AngularJS Tools Changing How We Develop.pptxBig Improvement_ New AngularJS Tools Changing How We Develop.pptx
Big Improvement_ New AngularJS Tools Changing How We Develop.pptxsarah david
 
Latest Web development technologies 2021
 Latest Web development technologies 2021 Latest Web development technologies 2021
Latest Web development technologies 2021SWATHYSMOHAN
 
React Js vs Node Js_ Which Framework to Choose for Your Next Web Application
React Js vs Node Js_ Which Framework to Choose for Your Next Web ApplicationReact Js vs Node Js_ Which Framework to Choose for Your Next Web Application
React Js vs Node Js_ Which Framework to Choose for Your Next Web Applicationadityakumar2080
 
Big Improvement_ New AngularJS Tools Changing How We Develop.pdf
Big Improvement_ New AngularJS Tools Changing How We Develop.pdfBig Improvement_ New AngularJS Tools Changing How We Develop.pdf
Big Improvement_ New AngularJS Tools Changing How We Develop.pdfsarah david
 
Know the difference - Angular.js vs Node.js
Know the difference - Angular.js vs Node.jsKnow the difference - Angular.js vs Node.js
Know the difference - Angular.js vs Node.jsdenizjohn
 
The Positive and Negative Aspects of Node.js Web App Development.pdf
The Positive and Negative Aspects of Node.js Web App Development.pdfThe Positive and Negative Aspects of Node.js Web App Development.pdf
The Positive and Negative Aspects of Node.js Web App Development.pdfWDP Technologies
 
Node.js and Enterprise Web Apps: Know all About it
Node.js and Enterprise Web Apps: Know all About itNode.js and Enterprise Web Apps: Know all About it
Node.js and Enterprise Web Apps: Know all About itFibonalabs
 
Node.js vs. java which one should you choose for backend development
Node.js vs. java  which one should you choose for backend development Node.js vs. java  which one should you choose for backend development
Node.js vs. java which one should you choose for backend development Moon Technolabs Pvt. Ltd.
 
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous  Blocking or synchronous.pdfNode Js Non-blocking or asynchronous  Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous Blocking or synchronous.pdfDarshanaMallick
 
8 Best Ways To Boost Node.js Performance Of Your Application!.pdf
8 Best Ways To Boost Node.js Performance Of Your Application!.pdf8 Best Ways To Boost Node.js Performance Of Your Application!.pdf
8 Best Ways To Boost Node.js Performance Of Your Application!.pdfSufalam Technologies
 
MEAN Stack: What and Why
MEAN Stack: What and WhyMEAN Stack: What and Why
MEAN Stack: What and WhyNatural Group
 
AngularJS vs NodeJS vs ReactJS Which One Would You Choose.pdf
AngularJS vs NodeJS vs ReactJS Which One Would You Choose.pdfAngularJS vs NodeJS vs ReactJS Which One Would You Choose.pdf
AngularJS vs NodeJS vs ReactJS Which One Would You Choose.pdfiDataScientists
 

Similar to Java script framework (20)

What is Node.js_ Where, When & How To Use It.pdf
What is Node.js_ Where, When & How To Use It.pdfWhat is Node.js_ Where, When & How To Use It.pdf
What is Node.js_ Where, When & How To Use It.pdf
 
All You Need to Know About Using Node.pdf
All You Need to Know About Using Node.pdfAll You Need to Know About Using Node.pdf
All You Need to Know About Using Node.pdf
 
9 Best JavaScript Frameworks To Choose
9 Best JavaScript Frameworks To Choose9 Best JavaScript Frameworks To Choose
9 Best JavaScript Frameworks To Choose
 
Why You Should Use MERN Stack for Startup Apps?
Why You Should Use MERN Stack for Startup Apps?Why You Should Use MERN Stack for Startup Apps?
Why You Should Use MERN Stack for Startup Apps?
 
COMP6210 Web Services And Design Methodologies.docx
COMP6210 Web Services And Design Methodologies.docxCOMP6210 Web Services And Design Methodologies.docx
COMP6210 Web Services And Design Methodologies.docx
 
Big Improvement_ New AngularJS Tools Changing How We Develop.pptx
Big Improvement_ New AngularJS Tools Changing How We Develop.pptxBig Improvement_ New AngularJS Tools Changing How We Develop.pptx
Big Improvement_ New AngularJS Tools Changing How We Develop.pptx
 
Latest Web development technologies 2021
 Latest Web development technologies 2021 Latest Web development technologies 2021
Latest Web development technologies 2021
 
What is mean stack?
What is mean stack?What is mean stack?
What is mean stack?
 
React Js vs Node Js_ Which Framework to Choose for Your Next Web Application
React Js vs Node Js_ Which Framework to Choose for Your Next Web ApplicationReact Js vs Node Js_ Which Framework to Choose for Your Next Web Application
React Js vs Node Js_ Which Framework to Choose for Your Next Web Application
 
Big Improvement_ New AngularJS Tools Changing How We Develop.pdf
Big Improvement_ New AngularJS Tools Changing How We Develop.pdfBig Improvement_ New AngularJS Tools Changing How We Develop.pdf
Big Improvement_ New AngularJS Tools Changing How We Develop.pdf
 
Know the difference - Angular.js vs Node.js
Know the difference - Angular.js vs Node.jsKnow the difference - Angular.js vs Node.js
Know the difference - Angular.js vs Node.js
 
The Positive and Negative Aspects of Node.js Web App Development.pdf
The Positive and Negative Aspects of Node.js Web App Development.pdfThe Positive and Negative Aspects of Node.js Web App Development.pdf
The Positive and Negative Aspects of Node.js Web App Development.pdf
 
Node.js and Enterprise Web Apps: Know all About it
Node.js and Enterprise Web Apps: Know all About itNode.js and Enterprise Web Apps: Know all About it
Node.js and Enterprise Web Apps: Know all About it
 
Node.js vs. java which one should you choose for backend development
Node.js vs. java  which one should you choose for backend development Node.js vs. java  which one should you choose for backend development
Node.js vs. java which one should you choose for backend development
 
Node.js vs. java
Node.js vs. javaNode.js vs. java
Node.js vs. java
 
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous  Blocking or synchronous.pdfNode Js Non-blocking or asynchronous  Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
 
8 Best Ways To Boost Node.js Performance Of Your Application!.pdf
8 Best Ways To Boost Node.js Performance Of Your Application!.pdf8 Best Ways To Boost Node.js Performance Of Your Application!.pdf
8 Best Ways To Boost Node.js Performance Of Your Application!.pdf
 
MEAN Stack: What and Why
MEAN Stack: What and WhyMEAN Stack: What and Why
MEAN Stack: What and Why
 
NodeJs Frameworks.pdf
NodeJs Frameworks.pdfNodeJs Frameworks.pdf
NodeJs Frameworks.pdf
 
AngularJS vs NodeJS vs ReactJS Which One Would You Choose.pdf
AngularJS vs NodeJS vs ReactJS Which One Would You Choose.pdfAngularJS vs NodeJS vs ReactJS Which One Would You Choose.pdf
AngularJS vs NodeJS vs ReactJS Which One Would You Choose.pdf
 

Recently uploaded

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

Java script framework

  • 1. A Template For Success Debajani Mohanty Java Script Framework
  • 2. Challenges in Front-end Development As per well-known lead front-end developer of Yahoo as well as author to many related technical books, Nicholas Zakas “Front end development is the most hostile development environment in the world." Once a front end developer has finished doing their job, they get right back to work making sure that the product functions optimally on every browser, mobile device, and high-end toaster oven under the sun that makes Front end development much more complicated than it seems. It’s also important to focus on the security of the product, protecting against CSRF, XSS, DNS pinning, and clickjacking.
  • 3. Single Page Applications The old-timers in Java might still remember the Swing & Applet applications that formed the thick client web based UI. It was later to be replaced with Jsp and many different template technologies that offered thin client solutions. In last few years we are again moving back to the fat client approach that we had started with. In past few years, Single Page Applications (SPAs) have become extremely popular on the web, because they are supposed to provide a more fluid user experience entirely based on fat client approach.
  • 4. Difference From Traditional Web Application  In traditional web applications, the client (browser) initiates the communication with the server by requesting a page. The server then processes the request and sends the HTML of the page to the client. In subsequent interactions with the page –e.g. the user navigates to a link or submits a form with data– a new request is sent to the server, and the flow starts again: the server processes the request and sends a new page to the browser in response to the new action requested by the client.  In Single-Page Applications (SPAs) the entire page is loaded in the browser after the initial request, but subsequent interactions take place through Ajax requests. This means that the browser has to update only the portion of the page that has changed; there is no need to reload the entire page. The SPA approach reduces the time taken by the application to respond to user actions, resulting in a more fluid experience.
  • 5. SPA Frameworks The three major players in this area are AngularJS, EmberJS and Backbone.js All the above mentioned frameworks have common features: their code is open, released under MIT license & they solve tasks of single-page web application creation with the help of MV* designing template. All of them have the concept of scene, event, data models & pathnames.  Backbone stands for minimalism. It is fast & simple in teaching & provides a minimal set of the necessary tools.  Angular is an innovator in extending HTML possibilities. It has a huge community & support from Google, it will have a constant growth & development. It suits well for fast and simple way to create a mockup as well as for huge projects.  EmberJS has the highest learning curve. Yet it would suit relatively bigger applications with long running client sessions. If you are creating heavy RESTful front-end apps, Ember is your framework.
  • 6. Advantages Of AngularJS  AngularJS provides capability to create Single Page Application in a very clean and maintainable way.  AngularJS provides data binding capability to HTML thus giving user a rich and responsive experience  AngularJS is opensource & code is unit testable.  AngularJS uses dependency injection and make use of separation of concerns.  AngularJS provides reusable components.  With AngularJS, developer write less code and get more functionality.
  • 7. Cases where Angular shines?  Building form-based "CRUD apps".  Throw-away projects (prototypes, small apps).  Slow corporate monoliths, when performance does not matter and maintenance costs are not discussed
  • 8. Where Angular Fails  Teams with varying experience.  Projects, which are intended to grow.  Lack of highly experienced frontend lead developer, who will look through the code all the time.  Project with 5 star performance requirements.  Application written in AngularJS are not safe. Server side authentication and authorization is must to keep an application secure.  If your application user disables JavaScript then user will just see the basic page and nothing more.
  • 9. Node JS  AngularJS is mostly but not necessarily used with NodeJS.  It can also be used with Tomcat or any other standard J2EE server.  Node.js is an open-source, cross-platform runtime environment for developing server-side Web applications.  Node.js is not a JavaScript framework, but its applications are written in JavaScript and can be run within the  Node.js runtime on a wide variety of platforms that varies from Windows, IBM AIX, Linux or few
  • 10. NodeJS Single Thread Vs Java EE Multiple Thread  Node.js provides an event-driven architecture and a non-blocking I/O API designed to optimize an application's throughput and scalability for real-time Web applications. The most important differences between NodeJS and Java are the concurrency and I/O models. Java uses multi-threaded synchronous I/O while NodeJS uses single threaded asynchronous I/O.  The below diagram shows how in a multithreaded environment, multiple requests can be concurrently executed, while in a single-thread environment multiple requests are sequentially executed. Of course, the multi-threaded environment utilizes more resources.  It may seem obvious that a multithreaded environment will be able to handle more requests per second than the single threaded environment. This is generally true for requests that are compute intensive, which utilize the allocated resources extensively.
  • 11. Resource Usage  However, in cases where requests involve a lot of I/O such as database or web service calls, each request needs to wait for the external engine to respond to the calls made, and hence the allocated CPU and memory resources are not used during this wait time.  The following diagrams illustrate this scenario where requests involve I/O wait times:  Node.js is typically used where light-weight, real-time response is needed, like communication apps and Web-based gaming. It is used to build large, scalable network applications
  • 12. Popular NodeJS Projects  GODADDY  GROUPON  IBM  LINKEDIN  MICROSOFT  NETFLIX  PAYPAL  RAKUTEN  SAP  VOXER  WALMART  YAHOO!
  • 13. Is Node JS a replacement to Apache Tomcat  This diagram shows the market position of the selected technologies in terms of popularity and traffic compared to the most popular web servers.  As per a report in https://dzone.com/articles/performance- comparison-between that compares the performances of tomcat and nodeJS, The Node.js is 20% faster than the Java EE solution for the problem at hand.
  • 14. Working with MEAN stack – The Complete Solution  The MEAN stack (MongoDB, Express.js, Angular.js, Node.js) is now being deemed as the new LAMP (Linux, Apache, MySQL, PHP), the preferred technology stack for startups.  In the MEAN stack, the Linux operating system is replaced with any operating system that Node.js can run on. This includes MS Windows, Mac OS, and Linux. The Apache web server is replaced with the Node.js. The MySQL is replaced with MongoDB, which is a No-SQL database. The PHP server side programming language is replaced with the ExpressJS, which basically provides a thin layer of features over Node.js. Here is a key point; the ExpressJS and Node.js in combination are tools to run JavaScript on the server side.  MongoDB with its JSON document structure comes with a lot of flexibility and helps to create highly scalable solution and faster applications. MEAN stack is great for POC projects and for dealing with data that may ultimately prove tricky to constrain in table form.
  • 16. Angular JS & Spring Usage of Angular JS consuming Spring REST based web services has become very popular nowadays as it gives us the option to build a complex, secure, high-traffic, enterprise level single-page application. In fact many existing projects currently migrating their Spring MVC application from JSP to Angular JS. We may use Spring Boot to quickly build such an application with production-ready services, Basic health- check and monitoring functions, Pre-configured, embedded Tomcat server, Executable JAR packaging with all dependencies included, Very little overall configuration overhead.
  • 17. Why Unit Testing In Javascript?  JavaScript is a dynamically typed language comes with almost no help from the compiler. So JavaScript needs to come with a strong set of tests.  AngularJS is developed with unit testing in mind. With features like dependency injection testing components are much easier, because you can pass in a component's dependencies and stub or mock them as you wish.  For testing Angular applications there are certain tools that you should use that will make testing much easier to set up and run. We need to know the usage of Karma, Jasmine, angular-mocks.
  • 18. Karma  Karma is The official AngularJS team test runner. We’ll use it to launch Chrome, Firefox, and PhantomJS.  It’s a JavaScript command line tool that can be used to spawn a web server which loads your application's source code and executes your tests. You can configure Karma to run against a number of browsers, which is useful for being confident that your application works on all browsers you need to support. Karma is executed on the command line and will display the results of your tests on the command line once they have run in the browser.  Karma is a NodeJS application, and should be installed through npm. Full installation instructions are available on the Karma website.
  • 19. Jasmine  Jasmine is a behavior driven development framework for JavaScript that has become the most popular choice for testing Angular applications. Jasmine provides functions to help with structuring your tests and also making assertions. As your tests grow, keeping them well structured and documented is vital, and Jasmine helps achieve this.
  • 20. angular-mocks  Angular also provides the ngMock module, which provides injecting & mocking for your tests. This is used to inject and mock Angular services within unit tests. In addition, it is able to extend other modules so they are synchronous. Having tests synchronous keeps them much cleaner and easier to work with. One of the most useful parts of ngMock is $httpBackend, which lets us mock XHR requests in tests, and return sample data instead.
  • 21. Mocha  Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases.  Mocha is free and open source, licensed under the MIT license.
  • 22. Why Integration Testing In Javascript?  As applications grow in size and complexity, unit as well as manual testing would not be enough.  Integration testing is to test between components which can't be captured in a unit test. End-to-end tests are made to find these problems.  In large projects where we have hundreds of developers working in different teams a practice of running all integration tests should be mandatory before merging the code to master repository. It enables all developers to minimize the risks of their code & features overwritten by someone else’s by mistake.  Automation testing of such end-to-end scenarios would ensure integrity of all modules in all environments.
  • 23. Summary  In the times of rapid app development, we need better ways to quickly develop interactive web applications and that is where JavaScript frameworks come to the rescue.  While learning Tech stack of Angular JS Architects and senior developers must note that we have to wisely select a group of technologies, be it Node JS or Spring MVC, that fits into our requirements and address all the non- functional requirement of the application.  Comparing NodeJS with Spring would be like comparing Apples with Oranges. Node.js is a platform while spring is a enterprise framework and both have totally different usecases.  Node JS is better than Spring in creating Web services written on top of NoSQL and RDBMS databases. The whole non-blocking model makes Node JS a lot more faster than Web services implemented on top of Spring and hosted on J2EE servers. Java + whole J2EE stack + Spring stack adds a lot of overhead, and if you goal is to serve REST calls, Node JS gets the job done, and gets it done well.  Spring is better at creating enterprise Java applications. It integrates into the Java ecosystem a lot better than Node JS. If you have a lot of COTS applications in your ecosystem, a Spring based web application will integrate much easily.
  • 24. References  NodeJS - https://en.wikipedia.org/wiki/Node.js  MEAN stack - http://www.newspindigital.com/wp- content/uploads/2014/08/NSD_Node.js-Stack- 1024x534.png  Market Position NodeJS Vs Tomcat - http://w3techs.com/technologies/comparison/ws- nodejs,ws-tomcat  What Developers Mean When They Build a MEAN Stack - https://www.newspindigital.com/nsd-tech- primer-the-mean-stack-a-k-a-full-stack-javascript/  Java EE threads v/s Node.js – which is better for concurrent data processing operations - http://bijoor.me/2013/06/09/java-ee-threads-vs-node- js-which-is-better-for-concurrent-data-processing- operations/  Unit Testing - https://docs.angularjs.org/guide/unit- testing