3. mergerandAcquisition
?
● January 4, 2004 : EMC² acquires VMware
● August 10, 2009 : VMware acquires
Springsource
● March 20, 2012 : EMC² acquires Pivotal
Labs
● April 1, 2013 : Pivotal Software is
created
○ All of VMware's applications and
developer-oriented products,
including Spring, tc Server, Cloud
Foundry, RabbitMQ, GemFire, and
SQLFire were transferred to this
organization
● October 12, 2015 : Dell Inc announced its
intent to acquire EMC² in a cash-and-stock
deal valued at $67 billion
5. Someofboringspringreleasedates
● 1.0.0 released in March 2004
● 2.0.0 released in October 2006
● 2.5.0 released in November 2007
● 3.0.0 released in December 2009
● 3.1.0 released in December 2011
● 3.2.5 released in November 2013
● 4.0.0 released in December 2013
● 4.2.0 released in July 2015
6. Atthebeginning
● Core container
○ the core of IoC pattern
● Beans / Core
○ fundamental parts of the
framework
○ IoC / Dependency Injection
○ BeanFactory
● Context
○ Manage Spring context
○ I8N
○ EJB/JMX
○ caching/mailing/scheduling/
template engine
● SpEL
○ Extend unified EL
7. Atthebeginning
● AOP
○ AOP Alliance-compliant aspect-
oriented programming by proxying
spring beans
● Aspects
○ AspectJ integration
● Instrumentation
○ class instrumentation support
○ classloader implementation
● Messaging (Spring 4)
○ Abstraction for messaging-based
applications
○ Annotations for mapping messages
to methods
9. Atthebeginning
● Servlet
○ Basic web integration
○ Web-oriented application context
● Web
○ Spring MVC
○ Rest Webservices
● WebSocket
○ Abstraction for websocket
integration
● Portlet
○ MVC implementation to be used in
a Portlet environment
10. Atthebeginning
● Test
○ Unit testing / integration
testing with JUnit or TestNG
○ Mock spring commons object
○ Consistent loading of Spring
ApplicationContexts and caching
of those context
12. Springsideprojects
● Based upon spring framework runtime
● 17 side projects
● Community Projects
○ Spring ROO
○ Spring Scala
● Pojects in the Attic
○ Spring BlaezDS Integration
○ Spring Loaded
○ Spring Shell
○ Rest Shell
13. SpringDATA
● Consitent Spring-based data access
● Main Modules
○ Spring Data commons
○ Spring Data JPA
○ Spring Data MongoDB
○ Spring Data Redis
○ Spring Data Solr
○ Spring Data Gemfire
○ Spring Data KeyValue
○ Spring Data REST
● Community modules
○ Spring Data JDBC Extensions
○ Spring for Apache Hadoop
● Interface driven, no more need of
implementation
14. SpringDATA
public interface SimpleUserRepository extends CrudRepository<User,
Long> {
User findByTheUsersName(String username);
List<User> findByLastname(String lastname);
@Query("select u from User u where u.firstname = ?")
List<User> findByFirstname(String firstname);
@Query("select u from User u where u.firstname = :name or
u.lastname = :name")
List<User> findByFirstnameOrLastname(@Param("name") String
name);
}
15. SpringXD
● BigData Spring solution
● Data ingestion
● Real time analytics
● Batch processing
● Data export
19. SpringSecurity
● Comprehensive and extensible support
for both Authentication and
Authorization
● Protection against attacks like
session fixation, clickjacking,
cross site request forgery, etc.
● Servlet API integration
● Optional integration with Spring Web
MVC
● Much more...
20. SpringSecurity
@EnableWebSecurity
public class SecurityConfig {
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth)
throws Exception {
auth
.inMemoryAuthentication()
.withUser("user").password("password").roles("USER");
}
}
21. SpringIntegration
● Implementation of most of the Entreprise
Integration Patterns
○ Endpoint
○ Channel (P2P and Publish/Subscribe)
○ Aggregator
○ Filter
○ Transformer
○ Control Bus
● Integration with External Systems
○ ReST/HTTP
○ FTP/SFTP
○ Twitter
○ Webservices (Soap and ReST)
○ TCP/UDP
○ JMS
○ RabbitMQ
○ Email
● Extensive JMX support
22. SpringIntegration
@Configuration
@SpringBootApplication
@IntegrationComponentScan
public class Application {
public static void main(String[] args) {
ConfigurableApplicationContext ctx = SpringApplication.run(Application.class, args);
TempConverter converter = ctx.getBean(TempConverter.class);
System.out.println(converter.fahrenheitToCelcius(68.0f));
ctx.close();
}
@MessagingGateway
public interface TempConverter {
@Gateway(requestChannel = "convert.input")
float fahrenheitToCelcius(float fahren);
}
@Bean
public IntegrationFlow convert() {
return f -> f
.transform(payload ->
"<FahrenheitToCelsius xmlns="http://www.w3schools.com/webservices/">"
+ "<Fahrenheit>" + payload +"</Fahrenheit>"
+ "</FahrenheitToCelsius>")
.enrichHeaders(h -> h
.header(WebServiceHeaders.SOAP_ACTION,
"http://www.w3schools.com/webservices/FahrenheitToCelsius"))
.handle(new SimpleWebServiceOutboundGateway(
"http://www.w3schools.com/webservices/tempconvert.asmx"))
.transform(Transformers.xpath("/*[local-name()="FahrenheitToCelsiusResponse"]"
+ "/*[local-name()="FahrenheitToCelsiusResult"]"));
}
}
23. ● Contract-First development
● Loose coupling between contract and
impl
● Powerful mappings
● XML Api support
● Support WS-Security
● Integrates with Spring Security
● Low activity in the repository
SpringWebServices
24. SpringWebServices
<beans xmlns="http://www.springframework.org/schema/beans">
<bean id="webServiceClient" class="WebServiceClient">
<property name="defaultUri" value="http://localhost:8080/WebService"/>
</bean>
</beans>
public class WebServiceClient {
private static final String MESSAGE =
"<message xmlns="http://tempuri.org">Hello World</message>";
private final WebServiceTemplate webServiceTemplate = new
WebServiceTemplate();
public void setDefaultUri(String defaultUri) {
webServiceTemplate.setDefaultUri(defaultUri);
}
// send to the configured default URI
public void simpleSendAndReceive() {
StreamSource source = new StreamSource(new StringReader(MESSAGE));
StreamResult result = new StreamResult(System.out);
webServiceTemplate.sendSourceAndReceiveToResult(source, result);
}
// send to an explicit URI
public void customSendAndReceive() {
StreamSource source = new StreamSource(new StringReader(MESSAGE));
StreamResult result = new StreamResult(System.out);
webServiceTemplate.sendSourceAndReceiveToResult("http://localhost:
8080/AnotherWebService",
source, result);
}
}
25. SpringWebFlow
● Allows implementing the “flows” of a
web application
● Clear start and end point
● User must go through a set of
screens in a specific order
● Changes not finalized until the last
step
27. SpringHATEOAS
● HATEOAS : Hypermedia as the Engine
of Application State
● Model classes for link, resource
representation models
● Link builder API to create links
pointing to Spring MVC controller
methods
● Support for hypermedia formats like
HAL
28. SpringHATEOAS
class BookmarkResource extends ResourceSupport {
private final Bookmark bookmark;
public BookmarkResource(Bookmark bookmark) {
String username = bookmark.getAccount().getUsername();
this.bookmark = bookmark;
this.add(new Link(bookmark.getUri(), "bookmark-uri"));
this.add(linkTo(BookmarkRestController.class,
username).withRel("bookmarks"));
this.add(linkTo(methodOn(BookmarkRestController.class,
username).readBookmark(username, bookmark.getId())).
withSelfRel());
}
public Bookmark getBookmark() {
return bookmark;
}
}
29. SpringLDAP
● Provides LDAP template which eliminates
the need to worry about creating and
closing LdapContext and looping through
NamingEnumeration
● Contains classes for dynamically building
LDAP filters and Distinguished Names
● Client-side LDAP transaction management
31. SpringSession
● API and implementations for managing a
user's session
● HttpSession - allows replacing the
HttpSession in an application container
(i.e. Tomcat) neutral way
○ Clustered Sessions
○ Multiple Browser Sessions
○ RESTful APIs
● WebSocket - provides the ability to keep
the HttpSession alive when receiving
WebSocket messages
35. SpringAMQP
● Advanced Message Queuing Protocol
Spring integration
● Listener container for asynchronous
processing of inbound messages
● RabbitTemplate for sending and
receiving messages
● RabbitAdmin for automatically
declaring queues, exchanges and
bindings
37. SpringMobile
● A Device resolver abstraction for server-
side detection of mobile and tablet devices
● Site preference management that allows the
user to indicate if he or she prefers a
"normal", "mobile", or "tablet" experience
● A site switcher capable of switching the
user to the most appropriate site
● Device aware view management for organizing
and managing different views for specific
devices
38. SpringMobile
@Controller
public class DeviceDetectionController {
@RequestMapping("/detect-device")
public @ResponseBody String detectDevice(Device device)
{
String deviceType = "unknown";
if (device.isNormal()) {
deviceType = "normal";
} else if (device.isMobile()) {
deviceType = "mobile";
} else if (device.isTablet()) {
deviceType = "tablet";
}
return "Hello " + deviceType + " browser!";
}
}
39. SpringforAndroid
● A Rest Client for Android
● Auth support for accessing secure APIs
// The connection URL
String url = "https://ajax.googleapis.com/ajax/" +
"services/search/web?v=1.0&q={query}";
// Create a new RestTemplate instance
RestTemplate restTemplate = new RestTemplate();
// Add the String message converter
restTemplate.getMessageConverters().add(new
StringHttpMessageConverter());
// Make the HTTP GET request, marshaling the response to a
String
String result = restTemplate.getForObject(url, String.class,
"Android");
40. SpringCloud
● Tools for developers to quickly
build distributed apps
○ Distributed/versioned configuration
○ Service registration and discovery`
○ Routing
○ Service-to-service calls
○ Load balancing
○ Circuit Breakers
○ Global locks
○ Leadership election and cluster state
○ Distributed messaging
● 16 sub-projects
● Integration with spring boot
41. SpringCloud
@Configuration
@EnableAutoConfiguration
@RestController
public class Application {
@Value("${config.name}")
String name = "World";
@RequestMapping("/")
public String home() {
"Hello " + name;
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
@Configuration
@EnableAutoConfiguration
@EnableDiscoveryClient
@EnableConfigServer
public class ConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigServerApplication.class, args);
}
}
42. SpringBoot
● Create stand-alone Spring
applications
● Embed Tomcat, Jetty or Undertow
directly (make JAR not WAR)
● 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