A multiple-page application (MPA) is a more traditional approach to app development.
With MPAs, every time we
want to see something new, the whole web page has to reload. E-commerce companies with lots of products often
prefer this approach.
Pros and Cons of Single-Page Applications
Pros of Single Page Application
Single Page Applications come with several advantages that make them a popular choice for web
development:
1. Performance: SPAs tend to be faster after the initial page load. This is because HTML, CSS, and
scripts are loaded just once, and only data is transmitted between the server and the user.
2. Improved User Experience: SPAs offer a better user experience by providing faster responses,
mobile-friendly interfaces, effortless interaction, and a linear content flow.
3. Connectivity: SPAs can work offline to some extent since most of the content is available after
the initial load. This makes them accessible even with a poor or no internet connection.
4. Development Speed: Developers find SPAs developer-friendly. They require testing fewer
elements, allow code reuse, and enable easy network operations monitoring.
Cons of Single Page Application
However, SPAs also have some drawbacks:
1. Initial Loading Time: SPAs may load many scripts at once, even if users don’t need all of them.
This can slow down the initial loading of the first page.
2. SEO Limitations: SPAs can pose challenges for search engine optimization (SEO) since search
engines don’t interpret JavaScript well. Server-side rendering with frameworks
like NextJS or GatsbyJS can help address this issue.
Single-page applications offer speed, user-friendliness, offline capabilities, and development efficiency but
come with trade-offs like initial loading time and SEO limitations.
What is a Multi-Page Application (MPA)?
A Multi-Page Application, or MPA, is a type of website or web application where each page is separately
created and sent to our web browser by a server.
Unlike Single Page Applications (SPAs), which build pages in our browser using JavaScript, MPAs depend
on the server to generate and refresh pages. This means that every time a user interacts with an MPA, for
example, clicking a link or submitting a form, the server sends a new page to the browser.
How Does a Multi-Page Application Work?
In a Multi-Page Application, when there is an action like clicking on a link or submitting a form, the server
creates a new page with the updated content and sends it to our browser. This constant communication with
the server is necessary to ensure that we see the most up-to-date information on each page.
Examples of Multi-Page Applications
Multi-page applications are commonly used for e-commerce websites, including online marketplaces and
product catalogs. When a website or app needs to make significant changes as you move from one page to
another, developers often opt for the MPA approach. So, when shopping for Christmas gifts on Amazon or
searching for a vintage record player on eBay, we are using an MPA.
Pros and Cons of Multi-Page Applications
Now, let’s explore the advantages and disadvantages of Multi-Page Applications.
Pros of Multi-Page Application
1. SEO Optimization is Possible: One major advantage of MPAs is their SEO-friendliness. Each
page in an MPA has its unique URL, allowing developers to optimize them with meta tags and
updated content. If attracting high website traffic and search engine optimization are essential for
the business, MPAs are a great choice.
2. Ease of Scaling: MPAs provide a flexible canvas for developers. One can add as many pages as
needed to accommodate their content and features. However, it is important to note that as the
number of pages increases, performance might decrease, so careful planning is required.
3. Analytic Capabilities: Compared to SPAs, MPAs offer extensive opportunities for data analysis,
such as tracking the number of visitors, their session durations, and target audience behavior.
Analytics tools often perform better when the server manages the pages, rather than relying on the
browser. While achieving these insights may require additional effort, MPAs have the upper hand
in this aspect.
Cons of Multi-Page Application
1. Performance Speed: In MPAs, every time a page is refreshed or navigates to a new one, the
browser has to reload and display all the content from scratch. This can lead to slower
performance, especially on slower internet connections.
2. Cost: Unlike SPAs, which rely on client-side resources like memory and processors, MPAs
require server resources. This means additional costs for hosting and maintaining servers, making
them less cost-effective for some projects.
Multi-page applications offer benefits like SEO optimization, scalability, and robust analytic capabilities.
However, they come with drawbacks such as potential performance issues and increased hosting costs.
What is Full Stack Development?
To understand what a full stack developer does, first you need to
know what full stack means. Basically, a tech stack is a combination
of tools and programming languages to create a platform that
supports applications. For example, a stack for a web application
would be formed by the operating system, a web server, a database,
and at least one programming language.
Since software has a client-facing side (the frontend) and a server
side (the backend), software engineers talk of two separate stacks
that cover all the layers that make up the entire tech stack of that
particular software. As such, many people claim that you have to
tackle both stacks separately to create software successfully.
However, other people believe that developing both the front and back
end with the same stack isn’t just possible – it’s the best alternative.
These are the full stack developers, engineers that have the
necessary skills to create or optimize the complete integration
between frontend and backend systems through one single code.
What is a full stack JavaScript developer?
In that sense, a full stack JavaScript developer is an engineer that can
develop both the frontend and the backend applications. This means
that they have to master HTML and CSS but also have the skills to
build a browser, a server, and a database. Full stack developers can
use a variety of JS frameworks , but one of the most popular is the
MEAN stack which includes;
MongoDB, a NoSQL database program
Express, considered the de facto standard server framework for
Node.js.
AngularJS, a frontend web framework
Node.js, a JavaScript runtime environment for server-side
scripting
As you can see, all of the components are based on JavaScript, which
supports the idea of tackling all the web project’s layers with the same
language. That’s why this stack is so popular among full stack
JavaScript developers.
Of course, the fact that MEAN is popular doesn’t mean that this stack
is the only one full stack JavaScript developers use. There are many
other technologies to use as alternatives for each of those
components, including Koa, restify, React, Vue.js, MySQL, and many
more.
Pros of Full Stack JavaScript
The uses of JavaScript vary depending on the project and it’s so
widely used for a number of reasons.
Increased Development Efficiency
Full stack JavaScript Developers can work on a web app entirely in
that programming language, making it easier for anyone in the team
to understand what’s going on. In other words, the people working in
the frontend and the backend all use the same language, so they are
always aware of what’s happening with the entire project. What’s
more, you can use only one team to handle the whole app, leading to
a more efficient development experience.
More Code Reuse
Since both the backend and frontend use JavaScript, you can reuse
chunks of code that follow similar logic and implementation. This can
reduce the amount of code full stack JavaScript developers have to
write and the overall number of code lines for the entire project. This
makes full stack development more efficient and makes it easier for
developers to maintain and update their products.
High Performance
Thanks to Node.js, full stack JavaScript developers can take full
advantage of non-blocking programming and create fully
asynchronous apps. This allows for the resulting applications to run
multiple independent processes simultaneously. This, in turn,
increases the performance of web applications written entirely in
JavaScript, resulting in better user experience and higher quality
products.
Access To Open Source Tools
Virtually the entire MEAN stack is open source, which means that
you’ll get access to vetted tools for free (in most cases). The fact that
they are open source implies that they are regularly updated by their
respective communities, which bring a lot of benefits for their users.
More Development Talent Available
According to the 2020 Stack Overflow Developer Survey, JavaScript
is the most-used technology with an astonishing 69.7% of
respondents saying they use it in some way. This means that there
are plenty of people out there who understand and regularly use this
programming language, a vast pool from which you can always pick
new talent to boost your full stack projects.
Plenty Of Resources
There are an enormous list of tools, JavaScript frameworks, and
libraries readily available for web developers – it also boasts one of
the most thriving communities in the development world. This means
that full stack JavaScript developers will have many resources to help
them while coding their projects, from dedicated communities to
forums, documentation, and ebooks.
Cons of Full Stack JavaScript
Naturally, going the full stack JavaScript development path means
you’ll have to deal with some disadvantages. Here are the most
notable ones.
Not Suitable For Computation-Heavy Projects
Yes, Node.js is great to improve a web application’s performance –
unless you’re trying to build an app that relies on intensive data
processing on the server side. Sure, you can break down the most
complex tasks into microservices with more suitable technologies and
then have them “talk” to your backend to keep Node.js. However, that
adds an extra layer of complexity to the project, which costs money
and takes time.
Limited Server-side Capabilities
As mentioned in the introduction, JavaScript added its server-side
capabilities after being focused exclusively in the frontend. Any
seasoned backend engineer can quickly spot the limitations this
relative lack of maturity brings to the job, especially when compared
with more established alternatives like PHP or Java.
Limited Amount Of “True” Full Stack Developers
This might seem contradictory after saying that one of the advantages
of full stack JavaScript development is that you have access to more
talent but think about it. While you can quickly find JavaScript
developers that can work in both the frontend and the backend, they
always end up being more suitable for one or the other. Finding
engineers that are actually capable of delivering on both ends is
rather tricky, which is why some people say that full stack JavaScript
developers are like unicorns.
Creating, deploying and consuming a java SOAP web service
Creating, deploying and consuming a java REST web service
MICROSERIVCES ARCHITECTURE, write the basics of this if asked how
spring and spring boot help simplify enterprise web applications
DRAWBACKS OF MONOLITHIC:
MICROSERIVES:
SPRING AND SPRING BOOT:
Difference between Spring and Spring Boot
Spring Spring Boot
Spring is an open-source lightweight Spring Boot is built on top of the conventional
framework widely used to develop enterprise spring framework, widely used to develop
applications. REST APIs.
The most important feature of the Spring The most important feature of the Spring Boot
Framework is dependency injection. is Autoconfiguration.
It helps to create a loosely coupled application. It helps to create a stand-alone application.
To run the Spring application, we need to set Spring Boot provides embedded servers such as
the server explicitly. Tomcat and Jetty etc.
To run the Spring application, a deployment There is no requirement for a deployment
descriptor is required. descriptor.
To create a Spring application, the developers
It reduces the lines of code.
write lots of code.
It doesn’t provide support for the in-memory It provides support for the in-memory database
database. such as H2.
Developers need to write boilerplate code for In Spring Boot, there is reduction in boilerplate
smaller tasks. code.
Developers have to define dependencies pom.xml file internally handles the required
manually in the pom.xml file. dependencies.
SQL NoSQL
RELATIONAL DATABASE MANAGEMENT
Non-relational or distributed database system.
SYSTEM (RDBMS)
These databases have fixed or static or
They have a dynamic schema
predefined schema
These databases are not suited for hierarchical These databases are best suited for hierarchical
data storage. data storage.
These databases are best suited for complex These databases are not so good for complex
queries queries
Vertically Scalable Horizontally scalable
Follows CAP(consistency, availability,
Follows ACID property
partition tolerance)
Examples: MySQL, PostgreSQL, Oracle, MS- Examples: MongoDB, HBase, Neo4j,
SQL Server, etc Cassandra, etc
An SQL injection attack happens when someone tries to trick a database into running unintended commands
by inserting malicious SQL code into a query. This often happens through input fields on websites, like a
login form.
How it works:
1. Input Field: A user enters data into a web form, like a username and password.
2. Vulnerable Query: The web application takes this input and directly uses it in an SQL query
without proper validation.
3. Malicious Input: An attacker enters specially crafted data that includes SQL commands.
4. Execution: The database executes the malicious SQL code as part of the query, potentially giving
the attacker access to sensitive data or control over the database.
Consequences:
Unauthorized Access: Attackers can log in without valid credentials.
Data Leakage: Attackers can retrieve sensitive information from the database.
Data Manipulation: Attackers can modify or delete data.
Prevention:
Use Prepared Statements: Use parameterized queries that separate SQL code from data.
Input Validation: Ensure all user inputs are properly validated and sanitized.
Least Privilege: Limit database permissions to the minimum necessary for the application.
By carefully handling user input and following best practices, developers can protect their applications from
SQL injection attacks.
Connection pooling means a pool of Connection Objects. Connection pooling is based on an
object pool design pattern. Object pooling design pattern is used when the cost (time & resources
like CPU, Network, and IO) of creating new objects is higher. As per the Object pooling design
pattern, the application creates an object in advance and place them in Pool or Container.
Whenever our application requires such objects, it acquires them from the pool rather than
creating a new one.
An application that uses a connection pooling strategy has already DB connection objects which
can be reused. So, when there is a need to interact with the database, the application obtains
connection instances from Pool. Connection pooling improves application performance that
interacts with the database.
Practice test – 1
1)B)
Java Full Stack Technologies
Critical assessment of the given case study
The given system should be assessed through component based full stack technologies.
The following are the business roles identified such as employees, driver, Customers
and Supplier.
The following are the Business requirements Such as
o To allot required employees for each session of the company.
o To allot driver details with the vehicle.
o To make a reservation for the customer for the required vehicle.
o To maintain a software payment process.
o To maintain supplier details for the purchasing accessories to servicing the
vehicle.
o To provide captcha for user accounts.
The above business requirements are analysed and implemented using full stack
technologies.
In a Java full-stack development environment,The breakdown of the
typical component based technologies.
1. Front-end (Client-Side): AWT Swing, GUI Interfaces or other Java-based
templating engines can be used for building the user interface.
For example, We have created a login screen with captcha provisions.
Design required forms for supplier, Customer, Employees, Driver details
2. Back-end (Server-Side): Java-based frameworks like JSP, JAVA Servlet,
Hibernate, Spring or Java EE (Enterprise Edition) are used for server-side
development. These frameworks provide tools and libraries for building robust and
scalable applications.
The required java JDBC API used for CLI and SLI Statements including SQL
Queries.
For example if you want to know the customer details including vehicle reservation
in the given system.
3. Database: Java applications often interact with relational databases (Oracle, MySql,
Sql Server )using technologies like Java Database Connectivity (JDBC).
In this case study we have created required tables with normalization.
The tables such as to maintain employee, drive, supplier, customer.
4. Middleware: Java applications might use middleware technologies like Apache
Tomcat, GlassFish Server or other application servers to deploy and run
applications.
For example if you want to design a payment process the required Third Party API
included through application server.
JavaScript Full Stack:
● In a JavaScript full-stack development environment, Here's a breakdown of the typical
components in a JavaScript full stack:
● Front-end (Client-Side): JavaScript is used along with HTML and CSS to build interactive
and dynamic user interfaces.
We have created dynamic web pages for Section allotment of employee, assigned
driver to vehicles, reserve vehicle for the customer and maintaining supplier details.
● Back-end (Server-Side): JavaScript is used for server-side development with the help of
Node.js, Express.js and Angular.
In the given system we have evaluated Database connection and Queries
For example, If you want to know vehicle allotted for a given customer.
● Database: JavaScript applications can interact with various databases, both SQL and
NoSQL, MongoDB, and NoSQL databases.
The Cab Service Management system should be maintained with the help of
MongoDB.
● Middleware: Node.js itself serves as middleware in JavaScript full-stack applications. It
allows developers to build scalable network applications and handle concurrent
connections.
The given system is needed for integrating other web applications like PayPal,
Parivahan and UDAI through API calls.
1)C)
Challenges
Performance: This includes requirements related to the speed, scalability, and
responsiveness of the system. For example, a requirement that the system should be able
to handle a certain number of concurrent users or process a certain amount of data within
a specific time frame.
1. Security: This includes requirements related to the protection of the system and its
data from unauthorized access, as well as the ability to detect and recover from
security breaches.
2. Usability: This includes requirements related to the ease of use and
understandability of the system for the end-users.
3. Reliability: This includes requirements related to the system’s ability to function
correctly and consistently under normal and abnormal conditions.
4. Maintainability: This includes requirements related to the ease of maintaining the
system, including testing, debugging, and modifying the system.
5. Portability: This includes requirements related to the ability of the system to be
easily transferred to different hardware or software environments.
6. Compliance: This includes requirements related to adherence to laws, regulations,
industry standards, or company policies.
Functional requirements:-
User Management:
● Authentication and authorization mechanisms for different user roles (admin, salesperson,
dealer, wholesaler).
● User registration, login, and profile management functionalities.
Sales Monitoring:
● Ability to track sales data in real-time, including product sales volume, revenue, and trends.
● Generate reports and analytics to analyze sales performance at various levels (product,
region, salesperson).
Inventory Management:
● Keep track of inventory levels for each product in different warehouses or locations.
● Automatically update inventory counts upon receiving new shipments or processing orders.
Order Processing:
● Allow dealers and wholesalers to place orders through the system.
● Support various order types, such as standard orders, pre-orders, and backorders.
● Handle order fulfillment, including order confirmation, packing, and shipping.
Payment Management:
● Accept payments from dealers and wholesalers for orders placed.
● Support multiple payment methods such as credit/debit cards, bank transfers, and cash on
delivery.
● Manage installment payments for large orders, if applicable.
Performance Tracking:
● Evaluate the performance of salespersons based on key performance indicators (KPIs) such
as sales targets, customer satisfaction, and order fulfillment rates.
● Provide dashboards and reports to visualize salesperson performance metrics and compare
them against predefined goals.