Spring Boot & co. – Spring? – Conventions?



Spring Boot & co. – Spring? – Conventions?

0 0


lumesse-spring-boot-data-elasticsearch


On Github Xaerxess / lumesse-spring-boot-data-elasticsearch

Spring Boot & co.

Spring?

The Spring Framework is an application framework and inversion of control container for the Java platform. (...)

The framework's core features can be used by any Java application, but there are extensions for building web applications on top of the Java EE platform.

Spring Framework Modules ------------------------ - **Spring Core Container**: This is the base module of Spring and provides spring containers (BeanFactory and ApplicationContext).[9] - **Aspect-oriented programming**: enables implementing cross-cutting concerns. - **Authentication and authorization**: configurable security processes that support a range of standards, protocols, tools and practices via the Spring Security sub-project (formerly Acegi Security System for Spring). - **Convention over configuration**: a rapid application development solution for Spring-based enterprise applications is offered in the Spring Roo module - **Data access**: working with relational database management systems on the Java platform using JDBC and object-relational mapping tools and with NoSQL databases - **Inversion of control container**: configuration of application components and lifecycle management of Java objects, done mainly via dependency injection
Modules (contd.) ---------------- - **Messaging**: configurative registration of message listener objects for transparent message-consumption from message queues via JMS, improvement of message sending over standard JMS APIs - **Model–view–controller**: an HTTP- and servlet-based framework providing hooks for extension and customization for web applications and RESTful Web services. - **Remote access framework**: configurative RPC-style marshalling of Java objects over networks supporting RMI, CORBA and HTTP-based protocols including Web services (SOAP) - **Transaction management**: unifies several transaction management APIs and coordinates transactions for Java objects - **Remote management**: configurative exposure and management of Java objects for local or remote configuration via JMX - **Testing**: support classes for writing unit tests and integration tests
[spring.io projects](https://spring.io/projects) ================================================

Conventions?

What does the Spring framework do? Should I use it? Why or why not?

- [SimpleBeanFactoryAwareAspectInstanceFactory](http://docs.spring.io/spring/docs/4.2.x/javadoc-api/org/springframework/aop/config/SimpleBeanFactoryAwareAspectInstanceFactory.html) - [AbstractSingletonProxyFactoryBean](http://docs.spring.io/spring/docs/4.2.x/javadoc-api/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.html)

Convention...n

Convention over configuration

A software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, and not necessarily losing flexibility.

Spring Roo

Spring Roo provides an alternative, code-generation based approach at using convention-over-configuration to rapidly build applications in Java. (...) It focuses on:

- Extensibility (via add-ons) - Java platform productivity (as opposed to other languages) - Lock-in avoidance (Roo can be removed within a few minutes from any application) - Runtime avoidance (with associated deployment advantages) - Usability (particularly via the shell features and usage patterns)

Spring Boot

Spring Boot is Spring's convention-over-configuration solution for creating stand-alone, production-grade Spring based Applications that you can "just run". It takes an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss.

- Create stand-alone Spring applications - Embed Tomcat or Jetty directly (no need to deploy WAR files) - Provide opinionated 'starter' POMs to simplify your Maven configuration - Automatically configure Spring whenever possible - Provide production-ready features such as metrics, health checks and externalized configuration - Absolutely no code generation and no requirement for XML configuration
Some useful resources --------------------- - [Quick Start](http://projects.spring.io/spring-boot/#quick-start) - [Reference Guide](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/) - [API](http://docs.spring.io/spring-boot/docs/current/api/) - [Spring Boot – Simplifying Spring for Everyone](https://spring.io/blog/2013/08/06/spring-boot-simplifying-spring-for-everyone)
Key components -------------- - Spring Boot Starter(s) - Spring Boot AutoConfigure - Spring Boot CLI - Spring Boot Actuator
[Spring Boot Starters](https://github.com/spring-projects/spring-boot/tree/master/spring-boot-starters) ------------------------------------------------------------------------------------------------------- > Spring Boot Starters are a **set of convenient dependency descriptors that you can include in your application**. (...) For example, if you want to get started using Spring and JPA for database access just include the `spring-boot-starter-data-jpa` dependency in your project, and you are good to go.
[Spring Boot Autoconfigure](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#getting-started-first-application-auto-configuration) ------------------------------------------------------------------------------------------------------------------------- - [List of features](https://github.com/spring-projects/spring-boot/blob/master/spring-boot-autoconfigure/pom.xml) - Ex. [Spring Data Elasticsearch auto configuration](https://github.com/spring-projects/spring-boot/tree/master/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch)

Spring Boot CLI

$ spring help run
spring run - Run a spring groovy script

usage: spring run [options] <files> [--] [args]

Option                     Description
------                     -----------
--autoconfigure [Boolean]  Add autoconfigure compiler
                             transformations (default: true)
--classpath, -cp           Additional classpath entries
-e, --edit                 Open the file with the default system
                             editor
--no-guess-dependencies    Do not attempt to guess dependencies
--no-guess-imports         Do not attempt to guess imports
-q, --quiet                Quiet logging
-v, --verbose              Verbose logging of dependency
                             resolution
--watch                    Watch the specified file for changes
            

Spring Actuator

Enter some data! --------------- - [Spring Data](http://projects.spring.io/spring-data/) - [Spring Data Elasticsearch](https://github.com/spring-projects/spring-data-elasticsearch) - [Spring Boot Data Elasticsearch](http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-nosql.html#boot-features-elasticsearch)
[Search For Tomorrow](http://repo.lumesse.local/projects/TEAM/repos/search-for-tomorrow/browse) ----------------------------------------------------------------------------------------------- ![SFT](images/Search_for_Tomorrow.jpg)
_(Eclipse session)_

THE END

Questions?