Java Spring
- Popular framework for building Java applications
-
Spring is a
Object Factory
-
Simpler and lightweight alternative to
J2EE
(Java EE) -
Java EE: Java Platform, Enterprise Edition - Currently version 8 (2017)
- Multilayer architecture . Corporative applications
-
Earlier versions of
EJB
(Enterprise Java Beans v1 and v2) were extremely complex -
Therefore the
Spring Framework
came along. - Book by
Rod Johnson
entitledJava Development with the Spring Framework
- Spring arrived in 2004 (when java EE was in version 4)
- Currently
Spring version 5
Goals of Spring
- Lightweight development with
Java POJOs
(Plain-Old-Java-Objects) - As a replacement to EJB
Dependency injection
to promote loose coupling- Declarative programming with
Aspect-Oriented-Programming
(AOP) - Minimize boilerplate Java code
Spring Components
Spring Core Container
-
Factory for creating beans, manage bean dependencies
-
Beans
- Core
- SpEL
- Context
Spring Infrastructure
-
AOP, Add functionalities to objects, logging, security, transactions, etc
-
AOP
- Aspects
- Instrumentations
- Messaging
Data Access Layer
- JDBC
- ORM
- Transactions
- OXM, JMS
Web Layer
- Servlet
- WebSocket
- Web
- Portlet
Test Layer
- Unit
- Integration
- Mock
Spring Projects
-
Additional spring modules built on top of the core spring framework
-
Spring cloud, spring data
- Spring batch, spring security
- Spring for android, spring web flow
- Spring web services, spring LDAP
Spring project
-
Directly from JAR files
- Pick the
spring-dist.zip
- Copy all the .jar files inside the
lib
folder to the lib folder of your project - Add the lib folder to the classpath of the project
Project Configuration
: Ctrl + Shift + Alt + S- Modules -> Dependencies -> + -> JARs or directories