Microservices
--------------
1.Spring Framework
2.Spring Boot
3.Spring Webservice
4.Spring Data
5.Spring Rest API
5.Microservice
----------------------
Web application
1. jsp - Designing the form[looks similar to html].html/.jsp
HTML - Predefined - p,h1, body,a,...
<!doctype html>
<head>...</head>
<body>...</body>
</html>
head section -
loading scripts- javascript/CSS files.
body section
- What we wanted to display in browser.
jsp
---
Display our dynamic content.
Executed by server- tomcat
.jsp
JSP=Java+html
Jsp
---
<% java code %>
Home work - JSP
client--->Controller(servlet)--->....
2. servlet
java code runs inside the server
but it will not have any main method
servlet.jar(API)-- HTTPServlet...
3. jdbc
To connect with db
JDBC API -- 500 lines
J2EE?
Client Side->server side->Server Business logic ->Database
J2EE 1.2 -servlet/jsp/EJB/JMS/RMI - 1999
J2EE 1.3
..
JEE7- JSF/JPA..
Spring Framework
----------------
1.A framework= collection of interfaces and classes.
2. .jar
3. Simplify the java enterprise application.[Banking/IRCTC/Shopping site]
Why Spring Framework?
Very popular framewrk for building Java Applicaiton.
Simple and Lightweight.
POJO programming model.
Current version Spring 5- 2017
What is new in Spring5?
->Java 8 and higher -lambda Expression, DateTime API, Stream, Functional
programming
->Spring MVC Model
M - pojo -DB
V - jsp
C - Dispatcher Servlet.
Each layer is separated.
Reactive Programming framework: Spring WebFlux
Spring 4
---------
Inversion of Control
Dependency injection
Spring MVC
Spring official website.
http://spring.io/
Goal
-----
POJO
DI - promotes loose coupling.
AOP -logging /security/ Montior
Aspect oriented programming model
Minimize boiler plate code
Spring Framework/Architecutre.
-Spring Architecture is divided in to modules.
Core Container
--------------
Factory for creating beans/objects
Manage the bean dependencies./objects
In java - We will create the objects
Spring - framework will create the objects[Bean].
Primary function for Spring Container
1. Create and Manage objects(IOC).- Inversion of Control.
2. Inject Object DI
AOP
---
Aspect oriented programming.
Add functionality to object declaratively.
-Logging ,security, transaction, etc...
Log4j
Data Access Integration Module
-------------------------------
Spring->JDBCAPI-DB - 250 lines of code.[50%]
ORM
----
Object to Relational Mapping[ important]
Spring frmework->ORM framework(Hibernate API)---MySQL/Oracle/NOSQL
JMS----------RabbitMQ- Messaging Broker
----
Java Messaging Service
Sending Messages
Transaction
- Basic transaction relate to DB
Web Module
------------
Web- Web Application
Instrumentation
---------------
Monitor your application
Test
----
Testing your app.[Junit/Mockito]framework
Spring Projects
---------------
Additional module built on top of core spring framework
Spring cloud
Spring security
Spring Boot
Spring for Andriod
Home Work - [Spring projects]
https://spring.io/projects
Software requirement
--------------------
JDK
Tomcat
Eclipse IDE/STS IDE
Downloading spring 5 jar files
How to download java?
java is over
STS
---
Traditional spring application
------------------------------
1. Create a java project- over
2. add spring jar files -
3. create the class- yes
4. create the xml file to provide values - yes
5. create the main java class----yes
ApplicationContext.xml file
---------------------------
<bean>
Used to define a bean for the given class
<property>
specify the property of stundet class named name,