liveBook · Manning

Spring

As explained in Java Persistence with Spring Data and Hibernate epub

Spring is a Java application-development framework that provides infrastructure abstractions for tasks such as dependency injection, data access, and transaction management.

Spring is a Java framework that supplies application infrastructure while letting developers focus on business logic. Its central idea is dependency injection, also called inversion of control (IoC): a container creates, configures, and manages application objects called beans. section 14.1

Spring coordinates several application concerns:

  • Dependency injection assembles collaborating components from application classes and configuration metadata. section 14.1
  • Persistence integrations let Spring control JPA EntityManager or Hibernate SessionFactory instances, transaction managers, and DAO components. section 14.6
  • Transaction management supports declarative annotations or programmatic TransactionTemplate usage across Hibernate, JPA, and Spring Data JPA. section 11.4

A transaction-manager boundary

PlatformTransactionManager defines the transaction lifecycle: obtain a TransactionStatus with getTransaction, then commit or roll back that status. Application code usually reaches this abstraction through annotations or TransactionTemplate rather than invoking the interface directly. section 11.4

public interface PlatformTransactionManager extends TransactionManager {
    TransactionStatus getTransaction(
 @Nullable TransactionDefinition definition)
                                     throws TransactionException;
    void commit(TransactionStatus status) throws TransactionException;
    void rollback(TransactionStatus status) throws TransactionException;
}

Use the interface listing to inspect Spring’s core transaction boundary and its get, commit, and rollback operations. section 11.4

How Java Persistence with Spring Data and Hibernate epub covers it

How deep it goes
Explains IoC containers, bean lifecycle, persistence integration, and transaction APIs, but stops short of detailed implementation internals.
Examples
Uses IoC container assembly, DAO applications, JPA and Hibernate integrations, and PlatformTransactionManager operations as concrete examples.
What you can do after
Configure Java components, persistence beans, and declarative or programmatic transaction management with Spring.
How it connects
Connects dependency injection with inversion of control, IoC containers, beans, DAO, JPA, Hibernate, Spring Data JPA, and transactions.

Also explained in

Compare how 3 books explain Spring →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Java Persistence with Spring Data and Hibernate epub. The section links point to the parts of the book it draws on.