We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14
Course:
Application Development Project using Java
CHAPTER 1:Getting Started With Spring Boot (Part-1) Structure of Chapter-1 • Introduction to Spring Boot • Features of Spring Boot • Advantages of Spring Boot • Breaking the monolithic way of developing software • When to start using microservices? • When not to start using microservices? • System requirements • Setting up the environment • The 12-factor app • Spring Initializr Introduction to Spring Boot • Spring Boot is an open source Java-based framework used to create a micro Service. • It is developed by Pivotal Team and is used to build stand-alone and production ready spring applications • Spring Boot provides a good platform for Java developers to develop a stand- alone and production-grade spring application that you can just run. • You can get started with minimum configurations without the need for an entire Spring configuration setup Difference between Spring and Spring Boot • Spring is an open source lightweight framework that allows Java EE 7 developers to build simple, reliable, and scalable enterprise applications. This framework mainly focuses on providing various ways to help you manage your business objects. It made the development of Web applications much easier as compared to classic Java frameworks and Application Programming Interfaces (APIs), such as Java database connectivity(JDBC), JavaServer Pages(JSP), and Java Servlet. • Spring Boot is built on top of the conventional spring framework. So, it provides all the features of spring and is easier to use than spring. Spring Boot is a microservice-based framework and makes a production-ready application in very less time. In Spring Boot everything is auto configured. We just need to use proper configuration for utilizing a particular functionality. Spring Boot is very useful if we want to develop REST API. Goals of Spring Boot Design • Spring Boot is designed with the following goals: • To avoid complex XML configuration in Spring • To develop a production ready Spring applications in an easier way • To reduce the development time and run the application independently • Offer an easier way of getting started with the application Why Spring Boot? • You can choose Spring Boot because of the features and benefits it offers as given here: • It provides a flexible way to configure Java Beans, XML configurations, and Database Transactions. • It provides a powerful batch processing and manages REST endpoints. • In Spring Boot, everything is auto configured; no manual configurations are needed. • It offers annotation-based spring application Eases dependency management • It includes Embedded Servlet Container Features of Spring Boot • Faster way of developing applications by reducing the boilerplate configurations • Loosely Coupled dependencies • Starter Packs availableas part of dependency • Creating production-ready microservices • Embedded container server support • Auto-configuration for dependencies • Externalized configurations • Live reload for the application • Ability to exclude/change the dependency Dependencies in project management • A project dependency is a task that relies on the completion of a different task. • In computer science, a software dependency is a piece of software that relies on another program to function properly • This is managed through a package manager like npm for JavaScript or pip for Python • Dependencies are specified in configuration files and installed when you compile or start the runtime • Examples of dependencies in software development:
➢ React depends on Babel for browser compatibility
➢ Django depends on Pillow for image processing
➢ Node.js depends on Express for web server management
Advantages of Spring Boot • Spring Boot offers the following advantages to its developers: • Easy to understand and develop spring applications • Helps to create stand-alone spring-based applications with production-ready features • The above features you can execute on the local workspace and the cloud platform • You can get started with minimum code setup with less development time • This allows the developers to to focus on the idea that evolves during the initial phase of the requirement • Mostly, Spring Boot applications need less Spring configuration • Spring Boot Increases productivity and Reduces the development time • After building, the Spring Boot applications can bre executed by java –jar <jar name> just like any other java project Breaking the monolithic way of developing software • In monolithic way of software development, the developers or the business analyst or even the product owner of the software receives a big requirement at once and then the team starts to work on after getting all the requirement details • But, now business capabilities are delivered using misroservices • There are many reasons to choose microservices like: • Each service can have a single functionality and data repository • Each service is independent of each other • Each service can communicate with each other usinfg IPC calls • Each service cab be tested independently • Deploying each application independently in an isolated environment What is Micro Service? • Micro Service is an architecture that allows the developers to develop and deploy services independently. Each service running has its own process and this achieves the lightweight model to support business applications. • Micro services offers the following advantages to its developers: ➢ Easy deployment ➢Simple scalability ➢ Compatible with Containers ➢Minimum configuration ➢ Lesser production time When to start using microservices? • When there is Migrateion of legacy applications to the new technology • When Changing of technology stack of one service will not affect the whole application • When creation of high performance and scalable service is required • When Agile methodology can be experimented When not to start using microservices?
• When cost is increased
• When the development team size is small • When the requirement is relatively tiny • When some support of tools in legacy applications maynot be supported Contd.. In Part2 of Chapter-1