
Spring Start Here
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
In Spring Start Here, you will learn how to:
Build web applications with Spring
Manage application objects with Spring context
Implement data persistence using data sources and transactions
Implement data exchange between applications using REST services
Utilize Spring Boot's convention-over-configuration approach
Write unit and integration tests for apps implemented with Spring
Minimize work when building any kind of app
Persisting data in a Spring application using the latest approach
Spring Start Here introduces you to Java development with Spring by concentrating on the core concepts you'll use in every application you build. You'll learn how to refactor an existing application to Spring, how to use Spring tools to make SQL database requests and REST calls, and how to secure your projects with Spring Security. There's always more to learn, and this book will make your next steps much easier.
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
About the technology
For Java developers, Spring is the must-learn framework. This incredible development tool powers everything from small business ecommerce applications to enterprise-scale microservices. Mastering Spring is a long journey. Taking your first step is easy! Start here.
About the book
Spring Start Here teaches Java developers how to build applications using Spring framework. Informative graphics, relevant examples, and author Laurentiu Spilca's clear and lively writing make it easy to pick up the skills you need. You'll discover how to plan, write, and test applications. And by concentrating on the most important features, this no-nonsense book gives you a firm foundation for exploring Spring's rich ecosystem.
What's inside
Build web applications with Spring
Minimize repetition and manual work
Persisting data in a Spring application
HTTP and REST-based web services
Testing your Spring implementations
About the reader
For readers with beginning to intermediate Java skills.
About the author
Lauren?iu Spilca is a skilled Java and Spring developer and an experienced technology instructor.
Table of Contents
PART 1 FUNDAMENTALS
1 Spring in the real world
2 The Spring context: Defining beans
3 The Spring context: Wiring beans
4 The Spring context: Using abstractions
5 The Spring context: Bean scopes and life cycle
6 Using aspects with Spring AOP
PART 2 IMPLEMENTATION
7 Understanding Spring Boot and Spring MVC
8 Implementing web apps with Spring Boot and Spring MVC
9 Using the Spring web scopes
10 Implementing REST services
11 Consuming REST endpoints
12 Using data sources in Spring apps
13 Using transactions in Spring apps
14 Implementing data persistence with Spring Data
15 Testing your Spring app
More details
Other editions
Additional editions

Person
Content
- Intro
- Spring Start Here
- Copyright
- contents
- front matter
- foreword
- preface
- acknowledgments
- about this book
- Who should read this book
- How this book is organized: A roadmap
- About the code
- liveBook discussion forum
- about the author
- about the cover illustration
- Part 1 Fundamentals
- 1 Spring in the real world
- 1.1 Why should we use frameworks?
- 1.2 The Spring ecosystem
- 1.2.1 Discovering Spring Core: The foundation of Spring
- 1.2.2 Using Spring Data Access feature to implement the app's persistence
- 1.2.3 The Spring MVC capabilities for developing web apps
- 1.2.4 The Spring testing feature
- 1.2.5 Projects from the Spring ecosystem
- 1.3 Spring in real-world scenarios
- 1.3.1 Using Spring in the development of a backend app
- 1.3.2 Using Spring in a automation test app
- 1.3.3 Using Spring for the development of a desktop app
- 1.3.4 Using Spring in mobile apps
- 1.4 When not to use frameworks
- 1.4.1 You need to have a small footprint
- 1.4.2 Security needs dictate custom code
- 1.4.3 Abundant existing customizations make a framework impractical
- 1.4.4 You won't benefit from switching to a framework
- 1.5 What will you learn in this book
- Summary
- 2 The Spring context: Defining beans
- 2.1 Creating a Maven project
- 2.2 Adding new beans to the Spring context
- 2.2.1 Using the @Bean annotation to add beans into the Spring context
- 2.2.2 Using stereotype annotations to add beans to the Spring context
- 2.2.3 Programmatically adding beans to the Spring context
- Summary
- 3 The Spring context: Wiring beans
- 3.1 Implementing relationships among beans defined in the configuration file
- 3.1.1 Wiring the beans using a direct method call between the @Bean methods
- 3.1.2 Wiring the beans using the @Bean annotated method's parameters
- 3.2 Using the @Autowired annotation to inject beans
- 3.2.1 Using @Autowired to inject the values through the class fields
- 3.2.2 Using @Autowired to inject the values through the constructor
- 3.2.3 Using dependency injection through the setter
- 3.3 Dealing with circular dependencies
- 3.4 Choosing from multiple beans in the Spring context
- Summary
- 4 The Spring context: Using abstractions
- 4.1 Using interfaces to define contracts
- 4.1.1 Using interfaces for decoupling implementations
- 4.1.2 The requirement of the scenario
- 4.1.3 Implementing the requirement without using a framework
- 4.2 Using dependency injection with abstractions
- 4.2.1 Deciding which objects should be part of the Spring context
- 4.2.2 Choosing what to auto-wire from multiple implementations of an abstraction
- 4.3 Focusing on object responsibilities with stereotype annotations
- Summary
- 5 The Spring context: Bean scopes and life cycle
- 5.1 Using the singleton bean scope
- 5.1.1 How singleton beans work
- 5.1.2 Singleton beans in real-world scenarios
- 5.1.3 Using eager and lazy instantiation
- 5.2 Using the prototype bean scope
- 5.2.1 How prototype beans work
- 5.2.2 Prototype beans in real-world scenarios
- Summary
- 6 Using aspects with Spring AOP
- 6.1 How aspects work in Spring
- 6.2 Implementing aspects with Spring AOP
- 6.2.1 Implementing a simple aspect
- 6.2.2 Altering the intercepted method's parameters and the returned value
- 6.2.3 Intercepting annotated methods
- 6.2.4 Other advice annotations you can use
- 6.3 The aspect execution chain
- Summary
- Part 2 Implementation
- 7 Understanding Spring Boot and Spring MVC
- 7.1 What is a web app?
- 7.1.1 A general overview of a web app
- 7.1.2 Different fashions of implementing a web app with Spring
- 7.1.3 Using a servlet container in web app development
- 7.2 The magic of Spring Boot
- 7.2.1 Using a project initialization service to create a Spring Boot project
- 7.2.2 Using dependency starters to simplify the dependency management
- 7.2.3 Using autoconfiguration by convention based on dependencies
- 7.3 Implementing a web app with Spring MVC
- Summary
- 8 Implementing web apps with Spring Boot and Spring MVC
- 8.1 Implementing web apps with a dynamic view
- 8.1.1 Getting data on the HTTP request
- 8.1.2 Using request parameters to send data from client to server
- 8.1.3 Using path variables to send data from client to server
- 8.2 Using the GET and POST HTTP methods
- Summary
- 9 Using the Spring web scopes
- 9.1 Using the request scope in a Spring web app
- 9.2 Using the session scope in a Spring web app
- 9.3 Using the application scope in a Spring web app
- Summary
- 10 Implementing REST services
- 10.1 Using REST services to exchange data between apps
- 10.2 Implementing a REST endpoint
- 10.3 Managing the HTTP response
- 10.3.1 Sending objects as a response body
- 10.3.2 Setting the response status and headers
- 10.3.3 Managing exceptions at the endpoint level
- 10.4 Using a request body to get data from the client
- Summary
- 11 Consuming REST endpoints
- 11.1 Calling REST endpoints using Spring Cloud OpenFeign
- 11.2 Calling REST endpoints using RestTemplate
- 11.3 Calling REST endpoints using WebClient
- Summary
- 12 Using data sources in Spring apps
- 12.1 What a data source is
- 12.2 Using JdbcTemplate to work with persisted data
- 12.3 Customizing the configuration of the data source
- 12.3.1 Defining the data source in the application properties file
- 12.3.2 Using a custom DataSource bean
- Summary
- 13 Using transactions in Spring apps
- 13.1 Transactions
- 13.2 How transactions work in Spring
- 13.3 Using transactions in Spring apps
- Summary
- 14 Implementing data persistence with Spring Data
- 14.1 What Spring Data is
- 14.2 How Spring Data works
- 14.3 Using Spring Data JDBC
- Summary
- 15 Testing your Spring app
- 15.1 Writing correctly implemented tests
- 15.2 Implementing tests in Spring apps
- 15.2.1 Implementing unit tests
- 15.2.2 Implementing integration tests
- Summary
- Appendix A. Architectural approaches
- A.1 The monolithic approach
- A.2 Using a service-oriented architecture
- A.2.1 Complexity caused by communication among services
- A.2.2 Complexity added to the security of the system
- A.2.3 Complexity added for the data persistence
- A.2.4 Complexity added in the deployment of the system
- A.3 From microservices to serverless
- A.4 Further reading
- Appendix B. Using XML for the context configuration
- Appendix C. A quick introduction to HTTP
- C.1 What is HTTP?
- C.2 The HTTP request as a language between client and server
- C.3 The HTTP response: The way the server responds
- C.4 The HTTP session
- Appendix D. Using JSON formatting
- Appendix E. Installing MySQL and creating a database
- Step 1: Install a DBMS on your local system
- Step 2: Install a client application for your DBMS
- Step 3: Connecting to the local DBMS
- Step 4: Add a new database
- Appendix F. Recommended tools
- Appendix G. Recommended learning materials for further study
- index
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.