Kevin Greene
@SurrealAnalysis
...well, 2004
<?xml version="1.0" encoding="UTF-8"?>
allows someone to easily write a microservice
also has support for easy CRUD
has great library support
can easily do anything needed
Spring eliminated the need for most XML (2008), and eventually all (2012)
@EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth .inMemoryAuthentication() .withUser("user").password("password").roles("USER"); } }
Annotations and improvements made JPA and Hibernate easily readable
@Entity public class Customer { @Id @GeneratedValue(strategy=GenerationType.AUTO) private long id; private String firstName; private String lastName; protected Customer() {} };
Single class-style coding lets you write code just as unorganized as NodeJS
STILL NEED EXAMPLE HERE
Java got better
List<String> organizers = Arrays.asList("Kevin", "Carlus", "Galen"); organizers .stream() .filter(s -> s.endsWith("n")) .map(String::toLowerCase) .sorted() .forEach(System.out::println);This is easily parallelizable This is lazy
No more excuses
DevTools are analogous to rerun in Ruby Spring Loaded allows you to hotload codeDeploying got easier
Uberjars make deploying significantly easier. Spring Boot now embeds a Tomcat container, making everything just work with java -jar@Configuration @Profile("dev") public class StandaloneDataConfig { @Bean public DataSource dataSource() { return new EmbeddedDatabaseBuilder() .setType(EmbeddedDatabaseType.HSQL) .addScript("classpath:com/bank/config/sql/schema.sql") .addScript("classpath:com/bank/config/sql/test-data.sql") .build(); } }; @Configuration @Profile("production") public class JndiDataConfig { @Bean(destroyMethod="") public DataSource dataSource() throws Exception { Context ctx = new InitialContext(); return (DataSource) ctx.lookup("java:comp/env/jdbc/datasource"); } }
Some great companies threw their weight behind Spring
And if you hate Java still...
Groovy
Great language Speed comparable to Java What to use if you like what Ruby brings to the tableKotlin
Great language Speed comparable to Java What to use if you like what Scala brings to the tableSpring Boot is just an opinionated collection of Spring libraries, with starter kits and command-line runners
...but what is Spring?
Spring is just a collection of useful Java libraries that cohesively come together for web development (and more)
Spring IO standardizes the version of Spring + common libraries
Also, many times, when I / others say Spring Boot, they just mean modern Spring
How do I start?
Rails can quickly generate a useful REST API.
Let's see what Spring Boot looks like?
@Entity public class Character
Warning: This demo is lacking
@EnableEurekaServer
@EnableEurekaServer
Five commands to make an app
yo jhipster yo jhipster:entity Skill yo jhipster:entity Employee gulp mvn springBoot:run
start.spring.io
spring.io/guides