the future of spring dr. mark pollack agenda unifying component model new web application...
TRANSCRIPT
![Page 1: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/1.jpg)
![Page 2: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/2.jpg)
The Future of Spring
Dr. Mark Pollack
![Page 3: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/3.jpg)
Agenda
Unifying Component Model New Web Application
Architectures NoSQL & Big Data
Deploy to Cloud or on
premise
NoSQL,Big Data
Web, Integration,
Batch
![Page 4: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/4.jpg)
Remember this…?
4
![Page 5: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/5.jpg)
Remember this?
5
![Page 6: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/6.jpg)
Some things change…
6
Changes in version 0.9 (25.6.2003)----------------------------------•first public release since the version that came with the book "Expert One-on-One J2EE Design and Development”•following various unofficial 0.8 CVS snapshots
![Page 7: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/7.jpg)
Some things stay the same
7
Changes in version 0.9 (25.6.2003)----------------------------------•first public release since the version that came with the book "Expert One-on-One J2EE Design and Development”•following various unofficial 0.8 CVS snapshots•log via Commons Logging•revised web framework•general tightening and polishing•new sample application "Petclinic"
![Page 8: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/8.jpg)
Some things stay the same
8
“I believe that Spring is unique, for several reasons:
• It addresses important areas that many other popular frameworks don't
• Spring is both comprehensive and modular.
• Spring is designed from the ground up to help you write code that's easy to test.
• Spring is an increasingly important integration technology”
- Rod Johnson, TheServerSide.com, 2005
![Page 9: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/9.jpg)
The Spring Stack
9
![Page 10: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/10.jpg)
Spring – Unifying Component Model
10
![Page 11: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/11.jpg)
SimpleObjectSimpleObjectsD
epen
denc
y In
ject
ion
(DI)
Aspect Orientation (AO
P)
Portable Service Abstractions
Remember This One?
![Page 12: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/12.jpg)
SimpleObject
AnnotatedComponents
Inje
ctio
n An
nota
tions
Composable Stereotypes
Service-Oriented Annotations
An Annotated Perspective
![Page 13: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/13.jpg)
A Typical Annotated Component
@Servicepublic class MyBookAdminService implements BookAdminService {
@Autowired public MyBookAdminService(AccountRepository ar) { … }
@Transactional public BookUpdate updateBook(Addendum addendum) { … }}
![Page 14: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/14.jpg)
1. Composable Stereotype Model
• Powerful options for custom stereotypes
@Service@Scope("request")@Transactional(rollbackFor=Exception.class)@Retention(RetentionPolicy.RUNTIME)public @interface MyService {}
@MyServicepublic class BookAdminService { …}
![Page 15: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/15.jpg)
2. Injection Annotations
• Spring's @Autowired & @Value versus JSR-330's @Inject
@Autowiredpublic MyBookAdminService(@Qualifier("myRepo") AccountRepository ar, @Value("#{systemProperties.databaseName}") String dbName) { …}
@Injectpublic MyBookAdminService(@Named("myRepo") AccountRepository ar) { …}
![Page 16: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/16.jpg)
3. Service-Oriented Annotations
• E.g. declarative transactions & declarative scheduling
@Transactionalpublic BookUpdate updateBook(Addendum addendum) { …}
@Scheduled(cron = "0 0 12 * * ?")public void performTempFileCleanup() { …}
![Page 17: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/17.jpg)
Example: Declarative Caching
• Based on a full-featured cache abstraction
@Cacheablepublic Owner loadOwner(int id);
@Cacheable(condition="name.length < 10")public Owner loadOwner(String name);
@CacheEvictpublic void deleteOwner(int id);
![Page 18: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/18.jpg)
@RequestMapping(value = "/books/{id}", method = GET)
public Book findBook(@PathVariable("id") long id) {
return this.bookAdminService.findBook(id);
}
http://mybookstore.com/books/12345
Example: Spring MVC - @PathVariable
![Page 19: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/19.jpg)
Example: Declarative Model Validation
public class Book { @NotNull @Past private Date releaseDate;}
@RequestMapping("/books/new")
public void newBook(@Valid Book book) { … }
• JSR-303 "Bean Validation" as the common ground
![Page 20: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/20.jpg)
Example: Declarative Formatting
• Annotation-driven number and date formatting
public class Book { @NotNull @Past @DateTimeFormat(iso=ISO.DATE) private Date releaseDate;}
![Page 21: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/21.jpg)
Bootstrapping Your Annotated Components
• Typical: a concise XML bean definition file– <context:component-scan base-package=”com.myapp”/>– @Repository / @Service / @Controller / @Configuration stereotype– compare: JPA persistence.xml with @Entity classes
• Alternative: AnnotationConfigApplicationContext– scan(basePackage)– register(componentClass)– register(configurationClass)
![Page 22: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/22.jpg)
WebApplicationInitializer
/** * Servlet 3.0 based initializer, autodetected by Spring. */public class MyWebAppInitializer implements WebApplicationInitializer {
public void onStartup(ServletContext sc) throws ServletException {
// Create the 'root' Spring application context AnnotationConfigWebApplicationContext root =
new AnnotationConfigWebApplicationContext(); root.scan("com.mycompany.myapp"); root.register(FurtherConfig.class);
// Manages the lifecycle of the root application context sc.addListener(new ContextLoaderListener(root));
... }}
![Page 23: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/23.jpg)
Configuration Classes
@Configuration
public class MyBookAdminConfig {
@Bean
public BookAdminService myBookAdminService() {
MyBookAdminService service = new MyBookAdminService();
service.setDataSource(bookAdminDataSource());
return service;
}
@Bean
public DataSource bookAdminDataSource() {
…
}
}
![Page 24: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/24.jpg)
XML-Free JPA Setup
@Configuration
public class MyBookAdminConfig {
@Bean
public FactoryBean myEntityManagerFactoryBean() {
LocalContainerEntityManagerFactoryBean emfb = new LocalContainerEntityManagerFactoryBean();
emfb.setPackagesToScan(“com.mycompany.myapp”);
emfb.setDataSource(bookAdminDataSource());
return emfb;
}
@Bean
public DataSource bookAdminDataSource() { … }
}
![Page 25: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/25.jpg)
Summary
• Spring's distinctive annotated component model– composable stereotype model– injection annotations– service-oriented annotations– flexible bootstrapping options– if desired: 100% XML-free deployment
![Page 26: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/26.jpg)
• Why do we need new application architectures?
• What do they look like?
• How do I build these apps with Spring?
Application Architecture
![Page 27: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/27.jpg)
Drivers of Change
![Page 28: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/28.jpg)
User
expectations
Drivers of Change
New client
devices
Corporate
expectations
QoS• internet scale???• survive AWS outage
Hybrid is
inevitable
Data
![Page 29: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/29.jpg)
From: server-side appsTo: smart clients and services
![Page 30: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/30.jpg)
Client
Server
ViewGeneration
ViewGeneration ControllersControllers
Service LayerService Layer
RepositoriesRepositoriesChannelsChannels RDBMSRDBMS
CRUD
ApplicationServer
Browser
Browser-based
HTML Rendering
(progressive
enhancement)
Browser-based
HTML Rendering
(progressive
enhancement)
HTML HTTP
![Page 31: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/31.jpg)
Client
Server
Service LayerService Layer
RepositoriesRepositoriesChannelsChannels RDBMSRDBMS
CRUD
Browser app orembedded in native
JSON HTTP & websockets
HTML5 & JS Engine
ControllersControllersDOMDOMClient-side modelClient-side model
events& notifications
web stgweb stg
![Page 32: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/32.jpg)
Client
Cloud/PaaS
Service LayerService Layer
RepositoriesRepositoriesChannelsChannels RDBMSRDBMS
CRUD
Browser app orembedded in native
JSON HTTP & websockets
HTML5 & JS Engine
ControllersControllersDOMDOMClient-side modelClient-side model
events& notifications
web stgweb stg
ServiceService ServiceService ServiceService business / domain services
![Page 33: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/33.jpg)
Client
PaaSCRUD
RepositoriesRepositoriesChannelsChannels RDBMSRDBMS
Browser app orembedded in native
JSON HTTP & websockets
HTML5 & JS Engine
ControllersControllersDOMDOMClient-side modelClient-side model
events& notifications
web stgweb stg
ServiceService ServiceService ServiceService business / domain services
![Page 34: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/34.jpg)
Client
PaaS
Browser app orembedded in native
JSON HTTP & websockets
HTML5 & JS Engine
ControllersControllersDOMDOMClient-side modelClient-side model
events& notifications
web stgweb stg
ServiceService ServiceService ServiceService business / domain services
ServiceService ServiceService ServiceServiceplatform services,web APIsSQLSQL NoSQLNoSQL Other
![Page 35: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/35.jpg)
HTML5(& native)
PaaS
JSON HTTP & websockets
HTML5 & JS Engine
events&
notifications
Applications
Services
![Page 36: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/36.jpg)
Smart Clients
![Page 37: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/37.jpg)
The Monty Hall Game
![Page 38: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/38.jpg)
The Monty Hall Game
The Gray Mouse Lemur – Small, Furry, and Gray!http://www.factzoo.com/mammals/gray-mouse-lemur-small-furry-gray.html
![Page 39: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/39.jpg)
The Monty Hall Game
![Page 40: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/40.jpg)
The Monty Hall Game
Stick or Change?
![Page 41: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/41.jpg)
• Cujo– curl
– wire
– when
– aop
• Clicks
Client-side code walkthrough and demo
$> demo
![Page 42: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/42.jpg)
Service-side design
![Page 43: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/43.jpg)
The frontline:SPAs, REST, (& WebSockets)
![Page 44: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/44.jpg)
Apps, REST, & WebSocketsnativeapps
browser-based apps
App Store
(Web Apps) & Services
REST
SPA
ws:
Download
Interaction
![Page 45: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/45.jpg)
• Spring MVC as the foundation
• Spring Data REST – Basic Entity Management via CRUD
– Builds on…
• Spring HATEOAS– Link Builder
– Resource Assembler
RESTful API design with Spring
![Page 46: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/46.jpg)
Monty Hall Game Resource
47
POST /games201 CreatedLocation : /games/{id}
GET /games/{id}200 OK{status : “awaiting_initial_selection” links : [ { rel : “self”, href : “http://…/games/{id}” }, { rel : “doors”, href : “http://…/games/{id}/doors”}, { rel : “history”, href : “http://…/games/{id}/history”}]}
![Page 47: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/47.jpg)
Monty Hall Door Resource
48
GET /games/{id}/doors200 OK{ doors : [ {status : “closed”, content : “unknown”, links : [ {rel : “self”, href : “http://…/games{id}/doors/1”}]}, {status : “closed”, content : “unknown”, links : [ {rel : “self”, href : “http://…/games{id}/doors/2”}]}, {status : “closed”, content : “unknown”, links : [ {rel : “self”, href : “http://…/games{id}/doors/3”}]} ], links : [ { rel : “self”, href : “http://…/games{id}/doors”} ] }
![Page 48: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/48.jpg)
Monty Hall Door Resource
49
PATCH (PUT) /games/{id}/doors/{id} {“status” : “SELECTED”}200 OK{status : “SELECTED”, content : “unknown”, links : [ {rel : “self”, href : “http://…/games{id}/doors/1”}
PATCH (PUT) /games/{id}/doors/{id} {“status” : “OPENED”}200 OK{status : “OPENED”, content : “juergen”, links : [ {rel : “self”, href : “http://…/games{id}/doors/1”}
![Page 49: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/49.jpg)
Design Pattern
controller
resourceassembler resource
domainobject
representation
![Page 50: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/50.jpg)
• Spring MVC• Spring Hateoas
Code Walkthrough and Demo
51
$> demo
![Page 51: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/51.jpg)
• Why do we need new data access solutions?
• What do they look like?
• How do I build these apps with Spring?
Data Access
![Page 52: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/52.jpg)
Drivers of Change
![Page 53: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/53.jpg)
The New Data Universe
54
![Page 54: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/54.jpg)
The Data Revolution
55
![Page 55: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/55.jpg)
Putting Data to Work
56
![Page 56: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/56.jpg)
Spring Data Mission Statement
57
89% of all virtualized applications in the world run on VMware.
Gartner, December 2008“Provides a familiar and consistent
Spring-based programming model for Big Data, NoSQL, and relational stores while retaining store-specific features and capabilities.
![Page 57: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/57.jpg)
• Consistency
• Accuracy– JPA != NoSQL
• Productivity– Template classes
– Object Mapping
– Repositories
• Horizontal integration– Spring Integration
– Spring Batch
– Gemfire 7.0
From there to here, from here to there, funny things are everywhere!”
58
Programming Model
Gemfire
Data Technologies
JPA/JDBC
• 60 releases this year
• SpringOne 2GX Release Train
• O’Reilly Book
![Page 58: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/58.jpg)
Configuration
59
@Configuration@ComponentScan@EnableTransactionManagement@EnableJpaRepositoriespublic class JpaConfig {
@Bean public DataSource dataSource() { ... }
@Bean public PlatformTransactionManager transactionManager() { ... }}
@Configuration@ComponentScan@EnableMongoRepositoriespublic class MongoConfig extends AbstractMongoConfig {
@Override public Mongo mongo() throws Exception { … } @Override protected String getDatabaseName() { … }
}
![Page 59: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/59.jpg)
Mapping
60
@Entity@Table(name = "Orders")public class Order {
@ManyToOne(optional = false) private Customer customer;
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true) @JoinColumn(name = "order_id") private Set<LineItem> lineItems = new HashSet<LineItem>();}
@Document(collection="Orders")public class Order {
@DBRef private Customer customer;
private Set<LineItem> lineItems = new HashSet<LineItem>();
...}
![Page 60: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/60.jpg)
Repository
61
public interface ProductRepository extends CrudRepository<Product, Long>, QueryDslPredicateExecutor<Product> {
Page<Product> findByDescriptionContaining(String description, Pageable pageable);
@Query("select p from Product p where p.attributes[?1] = ?2") List<Product> findByAttributes(String attribute, String value);}
![Page 61: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/61.jpg)
• Big Data problems are also integration problems
Horizontal Integration
62
Collect Transform RT Analysis Ingest Batch Analysis Distribute Use
Spring Integration & Data
Spring Hadoop + Batch
Spring MVCTwitter Search& GardenhoseTwitter Search& Gardenhose RedisRedis
![Page 62: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/62.jpg)
• Spring Integration • Spring Data
Code Walkthrough and Demo
$> demo
![Page 63: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/63.jpg)
What’s next?
![Page 64: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/64.jpg)
Spring Framework – Next version themes
• Java SE 8 – SE 8 language features are a natural fit for the Spring programming model
• Java EE 7– Support for JCache, JMS 2.0, JPA 2.1, Bean Validation 1.1
• Annotation-driven message listening and annotation-driven events within the application
• Websockets• Removal of deprecated classes• System requirements: Java SE 6+, Java EE 5+
![Page 65: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/65.jpg)
Spring Integration, Batch, Data
• Unified platform to address existing + new integration markets
Shared Data Integration Framework
•Combine Spring Integration, Batch, Data via single Modular data flow API and DSL•Common adapters, serializers, deserializers•Batch job scheduling, composition of data processing pipelines
Spring Integration
•Enterprise integration•Enterprise messaging•Channel abstraction•Adapters
Spring Data
•Relational and NoSQL•Object mapping•CRUD, repository•Now also Hadoop
Spring Batch
•Batch job scheduling•Parsers, mappers•Readers, writers•Partial processing etc.
![Page 66: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/66.jpg)
• Simplifying Java development • Helping enterprise developers with their biggest
challenges
Spring has always been about…
67
![Page 67: The Future of Spring Dr. Mark Pollack Agenda Unifying Component Model New Web Application Architectures NoSQL & Big Data Deploy to Cloud or on](https://reader035.vdocuments.site/reader035/viewer/2022062407/56649dc65503460f94ab9ac7/html5/thumbnails/67.jpg)
Thank You!