Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Why do I recommend the Spring Framework to my customers

Why do I recommend the Spring Framework to my customers

Is Spring the new legacy as quite a few people tell you on their blogs? I disagree on many levels. Throughout this session I will holistically detail on many levels without any polemics why I do recommend using the Spring Framework and it's ecosystem. Aspects that will be covered include: operational impacts, ecosystem, coding and road maps.

Michael Plöd

April 04, 2013
Tweet

More Decks by Michael Plöd

Other Decks in Programming

Transcript

  1. Why do I recommend
    the
    Spring Framework
    to my customers
    ?

    View Slide

  2. Michael Plöd
    Partner and Principal Architect at Senacor
    Technologies AG
    Author Java Magazin
    @bitboss
    http://speakerdeck.com/mploed

    View Slide

  3. 100%
    independent

    View Slide

  4. 2005
    Java EE Developer
    Spring Developer

    View Slide

  5. 2012
    Java EE Developer
    Spring Developer

    View Slide

  6. Java EE
    vs
    Spring

    View Slide

  7. Java EE
    with or
    without
    Spring
    !

    View Slide

  8. You‘ll get your projects
    delivered with both stacks

    View Slide

  9. I will discuss the topic
    on an architectural
    decision-maker level

    View Slide

  10. Myths
    and
    Legends

    View Slide

  11. Spring
    is an
    XML Hell

    View Slide

  12. 0lines of XML for a
    Spring based
    Web Application

    View Slide

  13. Spring
    is
    complex

    View Slide

  14. You don‘t need the
    force to use Spring!

    View Slide

  15. Spring
    has too many
    dependencies
    and makes
    WAR Files huge

    View Slide

  16. Is this your
    runtime
    environment?

    View Slide

  17. Spring is
    proprietary
    and not
    portable

    View Slide

  18. Who has ported a
    usual JEE
    enterprise
    application as a
    drop-in?

    View Slide

  19. A
    holistic
    examination
    is important

    View Slide

  20. Ops Road-Map
    Code

    View Slide

  21. Operational
    Aspects

    View Slide

  22. Infrastructure

    View Slide

  23. Infrastructure
    App Server
    Servlet
    Container
    Operations Team

    View Slide

  24. Update Volume
    App Server
    Servlet
    Container
    Server
    Runtime
    Libraries like
    CDI, Servlet,
    JPA, JSF, ...
    Eventually
    JVM
    A lot of
    planning
    and testing
    is required
    Integration
    in Monitoring
    ...

    View Slide

  25. Project Libs

    View Slide

  26. Project Libs
    Hibernate
    ...
    Spring
    Development Team

    View Slide

  27. Update Volume
    Hibernate
    ...
    Spring
    Dedicated,
    only single
    Libraries
    Ad Hoc
    Reduced
    test effort

    View Slide

  28. Roundtrips
    Hibernate
    ...
    Spring
    App Server
    Servlet
    Container
    2-4 Months 2-3 Years

    View Slide

  29. DEV OPS

    View Slide

  30. DEV OPS
    vs
    ?

    View Slide

  31. With Spring I achieve an
    increased flexibility by
    loosely coupling the
    infrastructure to the
    runtime

    View Slide

  32. Coding

    View Slide

  33. ? Are
    Dependency
    Injection
    and
    Testing
    game changers

    View Slide

  34. Free your mind:
    we are in
    2012
    and not in
    2005
    anymore

    View Slide

  35. Dependency
    Injection
    and
    Testing
    are
    commodity

    View Slide

  36. More important is the
    overall ecosystem

    View Slide

  37. Spring builds upon
    Java EE
    Scheduling MVC REST JMX Testing Caching Profiles
    DI AOP TX JMS AOP JDBC ORM OXM Expression
    JSR-250 JSR-330
    JTA JDBC 4.1
    JPA 2.0
    JSF 2.0 JSR-303 JMX 1.0

    View Slide

  38. WebServices AMQP Roo
    Security
    OAuth
    Data
    JPA MongoDB Neo4j GemFire
    HBase
    Redis JDBC Splunk Querydsl
    HDFS MapReduce Hive
    Pig Cascading SI/Batch
    Social
    Twitter
    LinkedIn
    Facebook
    WebFlow
    Scheduling MVC REST JMX Testing Caching Profiles
    DI AOP TX JMS AOP JDBC ORM OXM Expression
    Batch
    Integration
    Mobile

    View Slide

  39. Spring Data
    by example
    Data
    JPA MongoDB Neo4j GemFire
    HBase
    Redis JDBC Splunk Querydsl
    HDFS MapReduce Hive
    Pig Cascading SI/Batch

    View Slide

  40. JPA 2 Query
    ...
    public class PersonDAO ... {
    private EntityManager em;
    public List findByFirstname(String firstname) {
    Query q = em.createQuery(“from Person p where p.firstname = :name “)
    .setParameter(“name“, firstname)
    return q.getResultList();
    }
    }

    View Slide

  41. JPA 2 Query
    ...
    public class PersonDAO ... {
    private EntityManager em;
    public List findByFirstname(String firstname) {
    Query q = em.createQuery(“from Person p where p.firstname = :name “)
    .setParameter(“name“, firstname)
    return q.getResultList();
    }
    }
    You end up writing many simple queries

    View Slide

  42. Spring Data
    @Repository
    public interface PersonRepository extends JpaRepository {
    List findByFirstname(String firstname);
    }

    View Slide

  43. Spring Data with
    QueryDSL
    @Repository
    public interface PersonRepository extends JpaRepository,
    QueryDslPredicateExecutor {
    List findByFirstname(String firstname);
    }
    QPerson P = QPerson.person;
    BooleanExpression hasBirthday = p.birthday.eq(...);
    BooleanExpression livesInLinz = p.adress.city.eq("Linz");
    Person result = personRepository.findAll(hasBirthday.and(livesInLinz));

    View Slide

  44. Spring Data also
    adresses NoSQL, Big
    Data and Data Grids
    Data
    JPA MongoDB Neo4j GemFire HBase
    Redis JDBC Splunk Querydsl
    HDFS MapReduce Hive
    Pig Cascading SI/Batch

    View Slide

  45. Where are the
    Java EE
    Answers
    to NoSQL, Mobile,
    Social, ...?

    View Slide

  46. Keep in mind
    App Server
    Servlet
    Container
    Server
    Runtime
    Libraries like
    CDI, Servlet,
    JPA, JSF, ...
    Eventuell
    JVM
    A lot of
    planning
    and testing
    is required
    ! Ususal Roundtrip is 2-3 years !

    View Slide

  47. Spring offers a consistent
    programming model and
    many helpful abstractions
    and utilities besides the
    basics

    View Slide

  48. Road-Maps

    View Slide

  49. Java EE 6
    12 / 2009 Mid 2011
    12 / 2010 01 / 2012 02 / 2012
    12 / 2009 Final Spec Release (GlassFish, no support)
    12 / 2010 JBoss 6 (Web Profile, no support)
    Mid 2011 WebSphere 8
    01 / 2012 WebLogic 12c
    02 / 2012 JBoss 7.1

    View Slide

  50. !The Java EE venors took
    1,5 years
    for the first fully
    professionally supported
    container

    View Slide

  51. Java EE 7:
    3,5 years later
    12 / 2009 Final Spec Release JEE 6
    Q2 / 2013 Final Spec Release JEE 7

    View Slide

  52. News around
    Java EE 7
    Cloud Plattform will be
    delayed to Java EE 8
    Social API is on a halt
    JCache won‘t make it in
    Java EE 7

    View Slide

  53. What is left?

    View Slide

  54. JAX-WS 2.0
    CDI 1.1
    JMS 2.0
    after
    11 years
    JPA 2.1
    Servlet 3.1 JSF 2.2
    ....
    Java EE 7

    View Slide

  55. 12 / 2009 Spring 3.0
    12 / 2011 Spring 3.1
    12 / 2012 Spring 3.2
    Spring since
    2009
    12 / 2009 12 / 2011 End 2012
    Full professional
    support
    Available on all
    containers right
    away

    View Slide

  56. Some math
    Java EE
    API Release 12 / 2009 0 months
    Server Mid 2011 18 months
    Available in
    organisations
    Mid 2013 18 + 24 months
    API is available in production
    API is available in production
    42 months
    3,5 years

    View Slide

  57. The same math
    Spring 3.0
    API Release 12 / 2009 0 months
    Available in
    organisations
    3 / 2010 3 months
    API is available in production
    API is available in production 3 months

    View Slide

  58. Spring offers an
    innovative and reliable
    Road-Map
    with
    immediate availability
    and
    support

    View Slide

  59. Ops Road-Map
    Code

    View Slide

  60. Thank you!
    Photos / Graphics (c) Michael Plöd / Senacor Technologies AG
    Exceptions: Photos on Slides 2, 9 (c) Matthias Heyde; Photo on Slide 34 is licensed from istockphoto
    Pointy Font licensed from Bitfoundry
    Senacor is hiring
    Software Developers and -Architects
    [email protected]
    @bitboss
    http://www.senacor.com

    View Slide