julien dubois the spring framework · production teams •dm server is built on standard, widely...

27
The Spring Framework Julien Dubois France Regional Director SpringSource

Upload: others

Post on 01-Mar-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

The Spring FrameworkJulien DuboisFrance Regional DirectorSpringSource

Page 2: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

•France Regional Director, SpringSource

•Book author :« Spring par la pratique » (Eyrolles, 2006)

•10 years of experience in Java development

•Member of OSSGTP

Julien Dubois

Page 3: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Agenda

•SpringSource dm Server

•The Spring portfolio

•Demo

Page 4: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Agenda

•SpringSource dm Server

•The Spring portfolio

•Demo

Page 5: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

SpringSource dm Server

•The short version : it’s Spring, Tomcat and OSGi working all together

• Allows powerful and modular applications

++

Page 6: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

What is Spring?

•Spring is the most popular Java enterprise framwork.

• More than 600,000 unique visitors on our website every month

• More job offers than EJBs, and growing!

• Used in all industries, all over the world

Page 7: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

What is Tomcat?

•Tomcat is the more popular Java application server

• Used by many of the world’s leading companies for running their Java applications

• Open Source and lightweight alternative to complete J2EE and JEE servers

• Led by the Apache Software Foundation

Page 8: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

What is OSGi?

•OSGi is a specification

• OSGi defines cleanly modules and their lifecycles

• Used since many years in the telecom industry

• With several implementations in Java : for instance Equinox, which is the basis of the Eclipse IDE

Page 9: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

So, what does dm Server do?

•dm Server solves the “Jar hell” problem in your JEE applications :

Page 10: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Features for developers

•For developers :

• A truly modular architecture : secured modules, with a well-defined lifecycle

• Hot-deployment of modules during development time : you only work on your module, not on the whole application

• The complexity of OSGi is hidden by dm Server : doing a modular application is easy, knowledge of the OSGi APIs and specificities is not a requirement

Page 11: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Features for production

•For the production team :

• Hot deployment of modules of the application at runtime : lower downtime

• Several versions of the same module can be deployed in parallel

• Better usage of the server resources : dm Server only loads modules that are actually needed!

Page 12: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Summary

•dm Server is the only application server that gives the power of OSGi to development and production teams

•dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox

•Of course, dm Server is free software (GPL v3), so why don’t you start writing applications with it?

Page 13: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Agenda

•SpringSource dm Server

•The Spring portfolio

•Demo

Page 14: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

The Spring Portfolio – Value

across the application lifecycle

The Spring Portfolio

Spring Framework

Spring for .NET

Spring MVC

Spring Batch

AspectJSpring Security

Spring Integration

Spring Web Flow

Spring Rich Client

Spring Faces

Spring LDAP

Spring Dynamic Modules

Spring IDE

Spring Web Services

Groovy Grails

Page 15: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Spring as a platform

•Allows applications to be built from “Plain Old Java Objects” (POJOs)‏

•Allows enterprise services to be applied to POJOs in a non-invasive way

Page 16: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Examples of Spring as a platform

•Make a Java method execute in a database transaction

• Without the implementer dealing with transaction APIs

•Make a local Java method a remote-procedure

• Without the implementer dealing with remoting APIs

•Make a local Java method a management operation

• Without the implementer dealing with JMX APIs

•Make a local Java method a message handler

• Without the implementer dealing with JMS APIs

Page 17: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

POJO Decoration

Page 18: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Dependency Injection &

Inversion of Control

•Allows a software component to express what it depends on to work

• Without hard-coding

•A third party, called an assembler or container, is responsible for “plugging in” an implementation

Page 19: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

It's All Metadata – Whether XML...

<beans>

<tx:annotation-driven/>

<bean id=“rewardService” autowire=“byType”

class=“example.SimpleRewardService”/>

<bean id=“accountRepository”

class=“example.JdbcAccountRepository”/>

<property name=“dataSource”

ref=“dataSource”/>

</bean>

</beans>

Page 20: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

It's All Metadata – ... or Annotations

public class MyService implements MyServiceInterface {

@Autowiredprivate DataSource dataSource;

@Autowiredpublic void setServiceA(ServiceA a) { … }

@Transactional@Secured("ROLE_MANAGER")public void businessMethod(String b) { … }

}

Page 21: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

It's All Metadata – ... or JSR-250

Annotations

public class MyService implements MyServiceInterface {

@Resourceprivate DataSource dataSource;

private Processor processor;

@Resource(name=“myProcessor”)‏public void setProcessor(Processor processor) { … }

@PostConstructpublic void initialize() { … }

@PreDestroypublic void shutdown() { … }

}

Page 22: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Major benefits of the POJO approach

• Leverage

• Because you are not tied to an environment, your application code can run in any environment

• Isolation from volatile infrastructure

• No longer at the mercy of app server release schedules

•Clarity

• Application code stays focused on its core mission

• Not bogged down with infrastructural concerns

•Testability

• Simple objects with few dependencies are easy to test

Page 23: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Spring Reduces Cost & Risk

Deployment Environment

Less codeMore ReusableMore portable

Spring does heavy liftingEasier to test

Deployment Environment

More codeLess reusableLess portable

You write infrastructure codeHarder to test

Spring-Powered Application (SPA)‏

Spring

Non-Spring, traditional application

Page 24: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Spring can replace major

app. server run-time functionality

Production Environment

Application ServerApplication Server

Production Environment

Application Server ClusterApplication Server Cluster

Application Server Cluster

Spring-Powered Application (SPA)‏

Application Server Cluster

Servlet Container

•Connection mgmt.•Clustering•Deployment management

Spring

Servlet Container

•Connection mgmt.•Clustering•Deployment management

EJB Container•Transactions•Security•Monitoring•Thread concurrency•Remoting

Traditional application

Page 25: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Portable across all deployment models

Production Environment

Tomcat

Production Environment

WLS, WAS, JBoss

Servlet Container

•Connection mgmt.•Clustering•Deployment management

SPA

Spring

SPA

Spring

SOA

Batch

SPA

Spring

SPA

Spring

Production Environment

SpringSourcedm Server

SPA

Spring

Page 26: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Demo

Page 27: Julien Dubois The Spring Framework · production teams •dm Server is built on standard, widely used, Open Source components : Spring, Tomcat, Equinox •Of course, dm Server is

Questions?

Julien [email protected]

http://www.springsource.com/fr