Enterprise Architecture Short Note
Enterprise Architecture Short Note
Distributed software development involves creating applications that run on multiple interconnected
computers.
➔ Web applications
➔ Multiplayer online games
➔ Distributed databases
➔ Internet of Things (IoT) applications
Java provides libraries and frameworks (e.g., Apache Kafka) for building distributed systems.
Cross-Platform Compatibility, Simple to Use, Stable Language, Speed and performance, Powerful
Development Tool, Availability of Libraries, Security, Rich API
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
★ Java in Enterprise Development
Java Technologies
Example:
Online Retail System (Web Site)
Components
➔ Servlets and JSP : Presentation layer, handling user interactions and displaying.
➔ Spring Framework : Business logic, providing services such as shopping cart management
and order processing.
➔ Hibernate : Data access layer, interacting with the database to store and retrieve product
and customer data.
➔ JMS : Messaging between components for asynchronous processing and communication
with external systems.
★ What is a database ?
A database is a structured collection of data that can be easily accessed, managed, and updated.
1. Relational Databases:
These databases organize data into tables with rows and columns,
where each row represents a record and each column represents an attribute.
JDBC (Java Database Connectivity) is an API that enables Java applications to interact with
databases.
JDBC Architecture
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
★ Try - Catch
In Java, the try and catch blocks are used for exception handling.
Exceptions are events that occur during the execution of a program that disrupt the normal flow of
instructions.
They can occur for various reasons, such as invalid input, file not found, or database connection
issues.
DBMS RDBMS
It deals with a small quantity of data. It deals with large amounts of data.
Data redundancy is common in this model. Keys and indexes do not allow Data redundancy.
Data elements need to be accessed individually. Multiple data elements can be accessed at the
same time.
No relationship between data. Data is stored in the form of tables which are
related to each other.
Web based applications are software programs accessed through web browsers, providing
functionality and services over the internet.
Examples - email clients, social media platforms, online shopping portals, and productivity tools.
1. Client-side development: Programming executed on the user's device (browser), using HTML,
CSS, and JavaScript to create interactive interfaces.
2. Server-side development: Programming executed on the web server, managing data, business
logic, and communication with databases.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
Client-side Server-side
It does not provide security for data. It provides more security for data.
Source code is visible to the user. Source code is not visible to the user
HTML, CSS, and javascript are used. PHP, Python, Java, Ruby are used.
No need for interaction with the server. It is all about interacting with the servers.
State refers to the current condition or data of a web application, including user inputs, session
details, and application state
Techniques include - cookies, local storage, session storage, and client side
frameworks/libraries (e.g., Redux for React).
Involves storing state data on the server, often in databases or server memory.
➔ 1-tier architecture
➔ 2-tier architecture
➔ 3-tier architecture
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
★ What are Dynamic Web Models ?
Dynamic web models are architectures and patterns that enable dynamic content generation, user
interactions, and real-time updates in web applications.
It uses client-side or server scripting to generate mutable content. Like a static website, it also
contains HTML data.
Allows asynchronous data retrieval and updating parts of a web page without full
page reloads.
AJAX (Asynchronous JavaScript and XML) enables web pages to update parts of the
content asynchronously by fetching data from the server without reloading the entire
page.
2. WebSockets
Loads a single HTML page and dynamically updates content using JavaScript
frameworks / libraries (e.g., React, Angular, Vue.js).
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
★ MVC Architecture ( Model-View-Controller )
★ What is XML ?
XML stands for Extensible Markup Language. It is a text based markup language derived from
Standard Generalized Markup Language (SGML).
HTML XML
HTML stands for Hyper Text Markup Language. XML stands for Extensible Markup Language.
HTML tags are predefined tags. XML tags are user-defined tags.
XML is one of the most widely used formats for sharing structured information today
➔ Between programs
➔ Between people
➔ Between computers and people
➔ Both locally and across networks
1. Elements
2. Content
3. Attributes
4. Comments
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
★ XML Syntax,
➔ The XML declaration is case sensitive and must begin with "<?xml>" where "xml" is written in
lowercase.
➔ If a document contains XML declaration, then it strictly needs to be the first statement of the
XML document.
➔ The XML declaration strictly needs to be the first statement in the XML document.
➔ An HTTP protocol can override the value of encoding that you put in the XML declaration.
An XML file is structured by several XML elements, also called XML nodes or XML tags.The
names of XML elements are enclosed in triangular brackets < > as shown below
<element>....</element>
3. Root Element
An XML document can have only one root element.
<root>
<x>...</x>
<y>...</y>
</root>
In XML, it is illegal to omit the closing tag. All elements must have a closing tag except
prolog. XML prolog does not have a closing tag! This is not an error. The prolog is not a part
of the XML document.
<message>This is correct</message>
XML tags are case sensitive. The tag <Letter> is different from the tag <letter>.
"Properly nested" simply means that since the <i> element is opened inside the <b>
element, it must be closed inside the <b> element.
XML elements can have attributes in name/value pairs just like in HTML. In XML, the
attribute values must always be quoted
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
<note date="12/11/2007">
<to>Tove</to>
<from>Jani</from>
</note>
8. Entity References
Some characters have a special meaning in XML. If you place a character like "<" inside an
XML element, it will generate an error because the parser interprets it as the start of a new
element.
To avoid this error, replace the "<" character with an entity reference
Its value is always a string On the other hand tags defining elements/sub elements can
repeat any number of times and their values may be string data or sub elements Same data
may be encoded using attributes or elements or a combination of the two
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
11. XML Naming Rules
XML elements must follow these naming rules:
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
★ Advantages of Using XML in Enterprise Applications
Example: In Java, DOM parsers like JAXP provide APIs to traverse and manipulate XML
documents using DOM.
★ Web Servers
Web servers are primarily used to process and manage HTTP/HTTPS requests and responses from
the client system.
Web servers are software programs responsible for serving static content to web browsers over the
HTTP protocol.
Functionality: They handle requests from clients (browsers) and respond with static HTML, CSS,
JavaScript files, images, etc.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
Examples: Apache HTTP Server, Nginx, Microsoft IIS
★ Application Servers
Application servers are software frameworks or platforms designed to execute dynamic content and
business logic for web applications.
They support the execution of server side code (e.g.,Java, PHP, .NET) and provide services such as
database access, transaction management, and session handling.
An Integrated Development Environment (IDE) is a software suite that provides essential tools for
writing, testing, and debugging code.
★ What is a Servlet ?
Servlet is a technology which is used to create a web application.
Servlet is an API that provides many interfaces and classes including documentation.
Servlet is a web component that is deployed on the server to create a dynamic web page.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
★ What is a web application ?
★ Servlets Architecture
The following diagram shows the position of Servlets in a Web Application.
1. Initialization Phase
The servlet is initialized by calling the init() method.
2. Service Phase
The servlet calls service() method to process a client's request.
3. Destruction Phase
The servlet is terminated by calling the destroy() method.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
Following is the sample source code structure of a servlet example to show Hello World
GET: Data visible in URL, size limitations, suitable for non-sensitive data.
POST: Data sent in request body, not visible in URL, suitable for sensitive data.
<fieldset> and <legend> Again, these tags group related elements in a form and provide a caption
for the group, indicating this form uses the POST method.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
Create a “login” Servlet Page. The Servlet Page name needs to be added to the appropriate HTML
form's action attribute.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
getParameter() − You call the request.getParameter() method to get the value of a form
parameter.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
Run your Project and Click the Login Button.
We can use JDBC API to handle database using Java program and can perform the following
activities:
1. Connect to the database
2. Execute queries and update statements to the database
3. Retrieve the result received from the database.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
Create a MySQL Database and Table
The dbCon method is responsible for establishing a connection with the MySQL database
and returning the connection.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
Create a “Validate” Java class to validate users.
The LoginValidate function obtains the password and username as parameters, then verifies
them in the Users table.
The method, Returns true if the username and password are in the table; returns false
otherwise.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
“Login” Servlet Page
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
The doPost method get the username and password from the login.html form and sends them to the
login validate method.
If the login validate method returns true this will redirect to the welcome page otherwise it print Login
Failed.
Session
Sessions are used to store user-specific data across multiple requests, allowing web
applications to maintain stateful interactions with clients.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
Cookie
Cookies are the textual information that is stored in key-value pair format to the client’s
browser during multiple requests.
A cookie is a small piece of information that is persisted between the multiple client requests.
Cookies are commonly used to store user preferences, session identifiers, authentication
tokens, and other client-specific information.
Cookies have limitations such as size restrictions and security concerns, so sensitive
information should not be stored directly in cookies.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
➔ Create a session object if it is already not created.
HttpSession session = request.getSession();
➔ store the user information into the session object - setAttribute(String name, Object value)
session.setAttribute("username", uname);
➔ Setting the maximum age − You use setMaxAge to specify how long (in seconds) the cookie
should be valid.
ck.setMaxAge(60 * 60);
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
Update the Welcome Page
Process requests method used for both HTTP GET and POST methods.
The page loads the current HttpSession associated with this request, and if there is no
current session or the session username is null, it will redirect to the login page.
Also, it retrieves the value of the "cname" cookie from the cookies and prints its value on the
webpage.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
Create a Logout Page
Once the user requests to logout, we need to destroy that session. To do this, we need to use
invalidate() method in the HttpSession Interface.
After the session is destroyed, the page will redirect to the login.html page.
Cookie Session
Cookies are client-side files on a local computer Sessions are server-side files that contain user
that hold user information. data.
Cookies end on the lifetime set by the user. When the user quits the browser or logs out of the
program, the session is over.
It can only store a certain amount of info. It can hold an indefinite quantity of data.
Cookies are not secured. Sessions are more secure compared to cookies.
Cookies stored data in text files. Session save data in encrypted form.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
★ Advantages of Using Servlets
Session management refers to the process of controlling and maintaining user sessions in web
applications.
State management in web applications refers to the process of preserving and managing data and
application state across multiple user interactions.
It involves storing and retrieving user specific information, session data, and application state
variables.
➔ Data stored on the client side (browser) using cookies, local storage, or session
storage.
➔ Suitable for small amounts of data and maintaining user preferences.
➔ Reduced server load: Offloads data storage and management tasks to the client side.
➔ Faster access: Client side data retrieval is often faster than server side requests.
➔ Improved user experience: Enables personalized interactions and offline capabilities.
➔ Enhanced security: Data stored on the server is more secure than client Side storage.
➔ Scalability: Server side solutions can handle large amounts of data and concurrent users.
➔ Centralized management: Simplifies data access, retrieval, and manipulation on the server.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
★ Service-Oriented Architecture (SOA)
Some SOA product has been built by Oracle (SOA Suite), IBM(Websphere), Microsoft(BizTalk)
1. Service consumer
2. Service provider
The idea of an ESB is that many components can connect in a standardized way and then
communicate over the bus with any other component.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
★ Advantages of SOA
➔ Service reusability: In SOA, applications are made from existing services. Thus, services can be
reused to make many applications.
➔ Easy maintenance: As services are independent of each other they can be updated and modified
easily without affecting other services.
➔ Platform independent: SOA allows making a complex application by combining services picked
from different sources, independent of the platform.
➔ Availability: SOA facilities are easily available to anyone on request.
➔ Reliability: SOA applications are more reliable because it is easy to debug small services rather
than huge codes
➔ Scalability: Services can run on different servers within an environment, this increases scalability
★ Disadvantages of SOA
It provides a mechanism to marshal (write) java objects into XML and unmarshal (read) XML into
objects.
★ Java Annotation
Java Annotation is a tag that represents the metadata. i.e. attached with class, interface, methods or
fields to indicate some additional
@XmlRootElement : The name of the root XML element is derived from the class name,
and we can also specify the name of the root element of the XML using its name attribute.
@XmlType : define the order in which the fields are written in the XML file
@XmlElement : define the actual XML element name that will be used
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
@XmlTransient : annotate fields that we don’t want to be included in XML
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
Create another new class named " SLIATE."
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
Create a Method for Write a XML File
(JAXB Marshalling Example: Converting Object into XML)
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
Invoke Write and Read Methods
Output - 1
Output - 2
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
★ JDBC Extra code example
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
Create a Method for Update Data
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
★ What is DTD (Document Type Definition) ?
A DTD defines the structure and the legal elements and attributes of an XML document.
➔ !DOCTYPE note defines that the root element of this document is note
➔ !ELEMENT note defines that the note element must contain four elements:
"to,from,heading,body"
➔ !ELEMENT to defines the to element to be of type "#PCDATA"
➔ !ELEMENT from defines the from element to be of type "#PCDATA"
➔ !ELEMENT heading defines the heading element to be of type "#PCDATA"
➔ !ELEMENT body defines the body element to be of type "#PCDATA"
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
And here is the file "note.dtd", which contains the DTD:
★ What is Hibernate ?
Hibernate is a Java framework that simplifies the development of Java applications to interact with
the database.
Hibernate automates the mapping process, eliminating the need for developers to write
manual SQL queries for database operations.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
explain a given hibernated class code.
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "students")
public class Student {
@Id
private int id;
private String name;
private int age;
Explanation:
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
★ Write a few getters and setters for a class ?
Enterprise Java Beans (EJB) is one of the several Java APIs for standard manufacture of enterprise
software.
EJB is a server-side software element that summarizes the business logic of an application.
Disadvantages of EJB
1. Requires application server
2. Requires only Java clients. For other language clients, you need to go for web service.
3. Complex to understand and develop EJB applications.
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj
★ Session Bean
Session bean encapsulates business logic only, it can be invoked by local, remote and web service
clients.
The life cycle of session bean is maintained by the application server (EJB Container).
1. Stateless Session Bean: It doesn't maintain the state of a client between multiple
method calls.
3. Singleton Session Bean: One instance per application, it is shared between clients
and supports concurrent access.
No built-in management, needs manual handling Built-in support for declarative and programmatic
management
Using Basic security features (RBAC) Using Advanced security features, including JAAS
This short note making resources are,google search engine,chat gpt and lecture slides
WhatsApp group (click on this/new syllabus notes only) Credit - Kanishka viraj