SlideShare una empresa de Scribd logo
1 de 49
Descargar para leer sin conexión
Spring ME
Unleashing Spring to the Rest of
the Platform

Wilfred Springer
Xebia, The Netherlands
Audience
Agenda
>   Why this talk?
>   Why Spring?
>   Why not Spring?
>   How Spring?
>   Under the hood
>   Alternatives
>   Current status & what's next?
>   Discussion

                                    3
Java is doing AWESOME!




          Source: Tiobe Programming Community Index March   4
Spring is doing GREAT!




             =
     +




                         Source: Evans Data, 2008   5
But that's like... a freaking big number




                                           6
… or is it?


     SAN MATEO, Calif.—November 19, 2008 –
     SpringSource, a leading provider of infrastructure
     software and the company behind Spring, the de facto
     standard in enterprise Java, today announced that
     results from an extensive Evans Data research study
     reveal large scale adoption and penetration of Spring
     as a means of increasing developer productivity and
     combating complexity in today’s enterprise
     application infrastructure market.



                                                             7
Java Nodes in the Cloud
>   3 Billion Java-Enabled Cards in 2007
>   1.8 Billion Java-Enabled Phones in 2007
>   7 Million Java Set-top Boxes
>   1 Million GWT downloads in 2007
>   Sun SPOT
>   Livescribe Smartpen




                                              8
Not all men are equal




                versus




                         9
Spring ME Manifesto

 “We hold these truths to be self-evident, that
all men … Java Developers are entitled to get
      their portion of Spring goodness.”

         Not just Java EE developers
         Not just Java SE developers
But also Java ME, GWT developers and Java
               Card developers

                                                  10
Why Spring?




              11
IoC/Dependency Injection
Instead of this     Take hard-wired      And have a framework
                    dependencies out     connect them together




            “Trust us, we know what we're doing.”
                  “Don't call us, we call you.”

                                                            12
AOP (Cross-cutting behavior)
Sanitized API




“Any problem in computer science can be solved with
            another layer of indirection.”
                              – David Wheeler
Why not Spring?




                  15
So why not have Spring?
Platform Limitations
>   Limited Java Runtime capabilities
>   Limitations imposed by deployment
>   Limited computational resources
     ●   Limitations on heap
     ●   Limitations on application size
     ●   Limitations on performance
Java Runtime Limitations
                                               )      ct
                                      )      e( refle
                                   ... anc g.
                                 e( s t        n tring
                               am In a.la .S                         is t
                         o r N ew a v            ng             il.L
                    s s.f ss.n er j a.la r                a.
                                                             ut
                  a          a      h      v        a
               Cl        Cl      Ot     ja       ch    jav
   GWT         n         n       n      y        y     y
   Java ME     y         y       n      y        y     n
   Java Card   n         n       n      n        n     n

          BeanFactory#getBean(String name)?
          BeanFactory#getBean(char[] name)?
Deployment Limitations
     <bean id=”movie1” class=”sample.Movie”>
       <property name=”title” value=”Into the Wild”/>
     </bean>                                              1

                       OBFUSCATION
                                     package a.b;
 package com.mgm;
                                     public class a {
 public class Movie {
                                       void a(String ...);
   void setTitle(String title);
                                     }
 }
                          2                               3

     <bean id=”movie1” class=”a.b.a”>
       <property name=”a” value=”Into the Wild”/>
     </bean>
                                                          4
Heap
>   Java SE
     ●   Max heap approx. 1.5 GB
>   Java ME
     ●   Lower bound max. heap: 140 KB
     ●   Upper bound max. heap: 128 MB
     ●   Between factor 11 and 11,714 difference
>   Java Card
     ●   16 K RAM
Application Size
>   Java ME: Upperbounds between 64 KB and 28
     MB


          Spring Core        267KB
          Spring Beans       467KB
          Spring Context     455KB
          Total             1189KB
Throughput
>   Nokia E71:
     ●   369 MHz ARM 11 CPU
>   Gameboy Advance
     ●   16 MHz ARM 7 CPU
     ●   C-Ray Raytracing Benchmark 296108 s
>   Dell PowerEdge M710
     ●   2.4 GHz Xeon Quad Core CPU
     ●   C-Ray Raytracing Benchmark 201 s
How Spring?




              22
Introducing Spring ME's IoC




                              23
Introducing Spring ME's IoC
                              Do most of the
                              hard work at
                              build time




                                         24
Suppose this is the object model




                                   25
And you want to create these instances




                                         26
Then this is the Spring ME Configuration
<beans xmlns=”…”>
  <bean id=”movieFinder” class=”….InMemoryMovieFinder”>
    <property name=”movies”>
      <list>
         <bean class=”….Movie”>
           <property name=”title” value=”Bye Bye Blue Bird”/>
           <property name=”director” value=”Søren Kragh-Jacobsen”/>
           <property name=”year” value=”1999”/>
         </bean>
         …
      </list>
    </property>
  </bean>
</beans>




                                                                      27
With this Maven plugin configuration
<project>
  <build>
    <plugins>
      <plugin>
        <groupId>me.springframework</groupId>
        <artifactId>spring-me-maven-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <goals>
               <goal>generate</goal>
            </goals>
            <configuration>
               <contextFile>....context.xml</contextFile>
               <className>com.mgm.BeanFactory</className>
            </configuration>
          </execution>
        </executions>



                                                            28
Generates this BeanFactory
public class BeanFactory {

    public Object getBean(String name) {
      if (“movieFinder”.equals(name)) {
        return getMovieFinder();
      }
    }

    private final Object getMovieFinder() { … }
    …
}




                                                  29
DEMO




       30
DEMO (Java ME)
>   Spring ME on Java ME




                           31
DEMO (Java ME)



                 >   A little more Spring alike




                                             32
DEMO (Java SE)




                 public interface MinimalBeanFactory
                 {
                     Object getBean(String name)
                         throws BeansException;
                 }

                                                  33
DEMO (Java SE)




                 34
Additional benefits
>   Compile time validation
     ●   “Is 10e2 a valid int representation?”
     ●   “Is an instance of Boeing747 assignable to a
           property of type Airplane?”
>   Minimal or no runtime dependencies
>   Superfast (but no benchmarks to verify this)
>   Small (1K?)
Under the hood




                 36
Spring ME Meta Model
>   Meta Model independent of Spring
>   Typically Spring XML configuration is used




       Spring XML      Spring ME        Spring ME
      Configuration    Meta Model      BeanFactory


                                                     37
Other sources?
                   @Autowired        @ProvidedBy
                   @PostConstruct    @Inject
                   @PostDestroy      @ImplementedBy




    Annotations




                        Spring ME            Spring ME
                        Meta Model          BeanFactory


    Spring XML
   Configuration
                                                          38
Spring ME's Meta Model




                         39
Spring ME Meta Model Snapshot




                                40
Alternatives




               41
Inversion of Control Galore
                                                                                        ax
                                                                           tion s ynt
                                                                         ra lder e S                 n
                                                                    n igu o bl                    tio n           e
                                                    ds            o
                                                           od rati onf ceh pati                jec ctio e type nam
                                                 ho      h                                  in
                              s    s           et od met figu n c pla om           ns* tor inje nam by by
                       E ton ype           r
                                                               o
                                            y m eth oy con tati erty g C        tio truc erty by wire wire
                 T va M gle otot zy ger cto t m str L no op rin as llec ns op ire to to
                       n r a a a ni e M n r p li o o r
               GW Ja Si P L E F I              D X A P S A C C P W Au Au
Rocket GWT    y n y y y y y y y y n y n n all y y y n n
Spring ME     y y y y y y y y y y n n y n l/m y y y y* y*
Israfil IoC   n y y n n n n n n n n n n n ... y n n y y
Fall ME       n y y n n n n n n n n n n n ... y n n n n
GWToolbox     y n y y y y ? y y n y y n n all n y n y y
Signal        n n y y n n ? n n n n n y n all n y y ? ?




                                                                                                            42
Sanitized API
>   Java ME needs a lot more sanity
     ●   J2ME Polish is your friend
>   Java Card is probably too limited to use wrapper
     APIs
>   GWT is already addressed by a lot of frameworks




                                                       43
AOP
>   What about it?
>   Compile team weaving?
>   Using the metadata, AOP proxies could be
     constructed at build time
>   The factory could construct instances of these
     proxies instead of the actual objects




                                                     44
Current Status and What's Next




                                 45
Current status
   >   'Request' scope
   >   'Session' scope
   >   'Global session' scope
   >   BeanFactoryAware, but ...
   >   BeanPostProcessor (without reflection?)
   >   BeanFactoryPostProcessor, but ...
   >   FactoryBean, but ...



                                                 46
If there's only one thing you remember
>   “ME” as in “supporting Java ME”
>   “ME” as in “a microscopic small version of Spring”
>   Useful for Java ME
>   Useful for GWT
>   Useful for Java SE
>   Potentially useful for Java Card and Java EE




                                                         47
Other than that
>   Version 1.0 just released
>   GPL + Classpath Exception
>   Integration with J2ME Polish
>   JSR 296 on ME
>   http://springframework.me/
>   spring-me@googlegroups.com




                                   48
Wilfred Springer
wilfred at flotsam.nl

http://springframework.me/

Más contenido relacionado

Destacado

Interactive Powerpoint Project
Interactive Powerpoint ProjectInteractive Powerpoint Project
Interactive Powerpoint Projectdoomsj
 
Escuela Normal Superior Del Estado
Escuela Normal Superior Del EstadoEscuela Normal Superior Del Estado
Escuela Normal Superior Del Estadoguestc48621
 
Portada Nadal
Portada NadalPortada Nadal
Portada Nadalariafp10
 
El Alegre Barrendero
El Alegre BarrenderoEl Alegre Barrendero
El Alegre Barrenderoprofesorivan3
 
Interactive Powerpoint Project
Interactive Powerpoint ProjectInteractive Powerpoint Project
Interactive Powerpoint Projectdoomsj
 
Breaking Through the Talent Barrier
Breaking Through the Talent BarrierBreaking Through the Talent Barrier
Breaking Through the Talent BarrierService Strategies
 

Destacado (10)

Mlsbooktalks
MlsbooktalksMlsbooktalks
Mlsbooktalks
 
Interactive Powerpoint Project
Interactive Powerpoint ProjectInteractive Powerpoint Project
Interactive Powerpoint Project
 
Mongo
MongoMongo
Mongo
 
NoSQL Rollercoaster
NoSQL RollercoasterNoSQL Rollercoaster
NoSQL Rollercoaster
 
Escuela Normal Superior Del Estado
Escuela Normal Superior Del EstadoEscuela Normal Superior Del Estado
Escuela Normal Superior Del Estado
 
Portada Nadal
Portada NadalPortada Nadal
Portada Nadal
 
Simplicity
SimplicitySimplicity
Simplicity
 
El Alegre Barrendero
El Alegre BarrenderoEl Alegre Barrendero
El Alegre Barrendero
 
Interactive Powerpoint Project
Interactive Powerpoint ProjectInteractive Powerpoint Project
Interactive Powerpoint Project
 
Breaking Through the Talent Barrier
Breaking Through the Talent BarrierBreaking Through the Talent Barrier
Breaking Through the Talent Barrier
 

Similar a Spring ME JavaOne

Grails @ Java User Group Silicon Valley
Grails @ Java User Group Silicon ValleyGrails @ Java User Group Silicon Valley
Grails @ Java User Group Silicon ValleySven Haiges
 
Monkeybars in the Manor
Monkeybars in the ManorMonkeybars in the Manor
Monkeybars in the Manormartinbtt
 
JSUG - Spring by Christoph Pickl
JSUG - Spring by Christoph PicklJSUG - Spring by Christoph Pickl
JSUG - Spring by Christoph PicklChristoph Pickl
 
닷넷 개발자를 위한 패턴이야기
닷넷 개발자를 위한 패턴이야기닷넷 개발자를 위한 패턴이야기
닷넷 개발자를 위한 패턴이야기YoungSu Son
 
Griffon - Making Swing Fun Again
Griffon - Making Swing Fun AgainGriffon - Making Swing Fun Again
Griffon - Making Swing Fun AgainDanno Ferrin
 
New Features of Java7 SE
New Features of Java7 SENew Features of Java7 SE
New Features of Java7 SEdogangoko
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesJohn Brunswick
 
Uma introdução ao framework Spring
Uma introdução ao framework SpringUma introdução ao framework Spring
Uma introdução ao framework Springelliando dias
 
Struts Tags Speakernoted
Struts Tags SpeakernotedStruts Tags Speakernoted
Struts Tags SpeakernotedHarjinder Singh
 
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & GroovyGrails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & GroovyHenk Jurriens
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6Gal Marder
 
Spring-batch Groovy y Gradle
Spring-batch Groovy y GradleSpring-batch Groovy y Gradle
Spring-batch Groovy y GradleAntonio Mas
 
Migrate Early, Migrate Often: JDK release cadence strategies
Migrate Early, Migrate Often: JDK release cadence strategiesMigrate Early, Migrate Often: JDK release cadence strategies
Migrate Early, Migrate Often: JDK release cadence strategiesDanHeidinga
 
ConFoo Presentation - Front-End Architecture
ConFoo Presentation - Front-End ArchitectureConFoo Presentation - Front-End Architecture
ConFoo Presentation - Front-End Architecturekarimbaaba
 

Similar a Spring ME JavaOne (20)

Grails @ Java User Group Silicon Valley
Grails @ Java User Group Silicon ValleyGrails @ Java User Group Silicon Valley
Grails @ Java User Group Silicon Valley
 
Monkeybars in the Manor
Monkeybars in the ManorMonkeybars in the Manor
Monkeybars in the Manor
 
JSUG - Spring by Christoph Pickl
JSUG - Spring by Christoph PicklJSUG - Spring by Christoph Pickl
JSUG - Spring by Christoph Pickl
 
닷넷 개발자를 위한 패턴이야기
닷넷 개발자를 위한 패턴이야기닷넷 개발자를 위한 패턴이야기
닷넷 개발자를 위한 패턴이야기
 
BeJUG JavaFx In Practice
BeJUG JavaFx In PracticeBeJUG JavaFx In Practice
BeJUG JavaFx In Practice
 
Griffon - Making Swing Fun Again
Griffon - Making Swing Fun AgainGriffon - Making Swing Fun Again
Griffon - Making Swing Fun Again
 
New Features of Java7 SE
New Features of Java7 SENew Features of Java7 SE
New Features of Java7 SE
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
 
Java EE 6 & Spring: A Lover's Quarrel
Java EE 6 & Spring: A Lover's QuarrelJava EE 6 & Spring: A Lover's Quarrel
Java EE 6 & Spring: A Lover's Quarrel
 
Seam Glassfish Perspective
Seam Glassfish PerspectiveSeam Glassfish Perspective
Seam Glassfish Perspective
 
Uma introdução ao framework Spring
Uma introdução ao framework SpringUma introdução ao framework Spring
Uma introdução ao framework Spring
 
สปริงเฟรมเวิร์ค4.1
สปริงเฟรมเวิร์ค4.1สปริงเฟรมเวิร์ค4.1
สปริงเฟรมเวิร์ค4.1
 
Struts Tags Speakernoted
Struts Tags SpeakernotedStruts Tags Speakernoted
Struts Tags Speakernoted
 
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & GroovyGrails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6
 
Spring-batch Groovy y Gradle
Spring-batch Groovy y GradleSpring-batch Groovy y Gradle
Spring-batch Groovy y Gradle
 
Migrate Early, Migrate Often: JDK release cadence strategies
Migrate Early, Migrate Often: JDK release cadence strategiesMigrate Early, Migrate Often: JDK release cadence strategies
Migrate Early, Migrate Often: JDK release cadence strategies
 
Os Haase
Os HaaseOs Haase
Os Haase
 
ConFoo Presentation - Front-End Architecture
ConFoo Presentation - Front-End ArchitectureConFoo Presentation - Front-End Architecture
ConFoo Presentation - Front-End Architecture
 

Más de Wilfred Springer (9)

Unfiltered Unveiled
Unfiltered UnveiledUnfiltered Unveiled
Unfiltered Unveiled
 
Scala in your organisation
Scala in your organisationScala in your organisation
Scala in your organisation
 
Unfiltered Unveiled
Unfiltered UnveiledUnfiltered Unveiled
Unfiltered Unveiled
 
NoSQL
NoSQLNoSQL
NoSQL
 
Byzantine Generals
Byzantine GeneralsByzantine Generals
Byzantine Generals
 
Eventually Consistent
Eventually ConsistentEventually Consistent
Eventually Consistent
 
Into the Wild
Into the WildInto the Wild
Into the Wild
 
OOPSLA Talk on Preon
OOPSLA Talk on PreonOOPSLA Talk on Preon
OOPSLA Talk on Preon
 
Preon (J-Fall 2008)
Preon (J-Fall 2008)Preon (J-Fall 2008)
Preon (J-Fall 2008)
 

Último

Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Último (20)

Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

Spring ME JavaOne

  • 1. Spring ME Unleashing Spring to the Rest of the Platform Wilfred Springer Xebia, The Netherlands
  • 3. Agenda > Why this talk? > Why Spring? > Why not Spring? > How Spring? > Under the hood > Alternatives > Current status & what's next? > Discussion 3
  • 4. Java is doing AWESOME! Source: Tiobe Programming Community Index March 4
  • 5. Spring is doing GREAT! = + Source: Evans Data, 2008 5
  • 6. But that's like... a freaking big number 6
  • 7. … or is it? SAN MATEO, Calif.—November 19, 2008 – SpringSource, a leading provider of infrastructure software and the company behind Spring, the de facto standard in enterprise Java, today announced that results from an extensive Evans Data research study reveal large scale adoption and penetration of Spring as a means of increasing developer productivity and combating complexity in today’s enterprise application infrastructure market. 7
  • 8. Java Nodes in the Cloud > 3 Billion Java-Enabled Cards in 2007 > 1.8 Billion Java-Enabled Phones in 2007 > 7 Million Java Set-top Boxes > 1 Million GWT downloads in 2007 > Sun SPOT > Livescribe Smartpen 8
  • 9. Not all men are equal versus 9
  • 10. Spring ME Manifesto “We hold these truths to be self-evident, that all men … Java Developers are entitled to get their portion of Spring goodness.” Not just Java EE developers Not just Java SE developers But also Java ME, GWT developers and Java Card developers 10
  • 12. IoC/Dependency Injection Instead of this Take hard-wired And have a framework dependencies out connect them together “Trust us, we know what we're doing.” “Don't call us, we call you.” 12
  • 14. Sanitized API “Any problem in computer science can be solved with another layer of indirection.” – David Wheeler
  • 16. So why not have Spring? Platform Limitations > Limited Java Runtime capabilities > Limitations imposed by deployment > Limited computational resources ● Limitations on heap ● Limitations on application size ● Limitations on performance
  • 17. Java Runtime Limitations ) ct ) e( refle ... anc g. e( s t n tring am In a.la .S is t o r N ew a v ng il.L s s.f ss.n er j a.la r a. ut a a h v a Cl Cl Ot ja ch jav GWT n n n y y y Java ME y y n y y n Java Card n n n n n n BeanFactory#getBean(String name)? BeanFactory#getBean(char[] name)?
  • 18. Deployment Limitations <bean id=”movie1” class=”sample.Movie”> <property name=”title” value=”Into the Wild”/> </bean> 1 OBFUSCATION package a.b; package com.mgm; public class a { public class Movie { void a(String ...); void setTitle(String title); } } 2 3 <bean id=”movie1” class=”a.b.a”> <property name=”a” value=”Into the Wild”/> </bean> 4
  • 19. Heap > Java SE ● Max heap approx. 1.5 GB > Java ME ● Lower bound max. heap: 140 KB ● Upper bound max. heap: 128 MB ● Between factor 11 and 11,714 difference > Java Card ● 16 K RAM
  • 20. Application Size > Java ME: Upperbounds between 64 KB and 28 MB Spring Core 267KB Spring Beans 467KB Spring Context 455KB Total 1189KB
  • 21. Throughput > Nokia E71: ● 369 MHz ARM 11 CPU > Gameboy Advance ● 16 MHz ARM 7 CPU ● C-Ray Raytracing Benchmark 296108 s > Dell PowerEdge M710 ● 2.4 GHz Xeon Quad Core CPU ● C-Ray Raytracing Benchmark 201 s
  • 24. Introducing Spring ME's IoC Do most of the hard work at build time 24
  • 25. Suppose this is the object model 25
  • 26. And you want to create these instances 26
  • 27. Then this is the Spring ME Configuration <beans xmlns=”…”> <bean id=”movieFinder” class=”….InMemoryMovieFinder”> <property name=”movies”> <list> <bean class=”….Movie”> <property name=”title” value=”Bye Bye Blue Bird”/> <property name=”director” value=”Søren Kragh-Jacobsen”/> <property name=”year” value=”1999”/> </bean> … </list> </property> </bean> </beans> 27
  • 28. With this Maven plugin configuration <project> <build> <plugins> <plugin> <groupId>me.springframework</groupId> <artifactId>spring-me-maven-plugin</artifactId> <version>1.0</version> <executions> <execution> <goals> <goal>generate</goal> </goals> <configuration> <contextFile>....context.xml</contextFile> <className>com.mgm.BeanFactory</className> </configuration> </execution> </executions> 28
  • 29. Generates this BeanFactory public class BeanFactory { public Object getBean(String name) { if (“movieFinder”.equals(name)) { return getMovieFinder(); } } private final Object getMovieFinder() { … } … } 29
  • 30. DEMO 30
  • 31. DEMO (Java ME) > Spring ME on Java ME 31
  • 32. DEMO (Java ME) > A little more Spring alike 32
  • 33. DEMO (Java SE) public interface MinimalBeanFactory { Object getBean(String name) throws BeansException; } 33
  • 35. Additional benefits > Compile time validation ● “Is 10e2 a valid int representation?” ● “Is an instance of Boeing747 assignable to a property of type Airplane?” > Minimal or no runtime dependencies > Superfast (but no benchmarks to verify this) > Small (1K?)
  • 37. Spring ME Meta Model > Meta Model independent of Spring > Typically Spring XML configuration is used Spring XML Spring ME Spring ME Configuration Meta Model BeanFactory 37
  • 38. Other sources? @Autowired @ProvidedBy @PostConstruct @Inject @PostDestroy @ImplementedBy Annotations Spring ME Spring ME Meta Model BeanFactory Spring XML Configuration 38
  • 39. Spring ME's Meta Model 39
  • 40. Spring ME Meta Model Snapshot 40
  • 42. Inversion of Control Galore ax tion s ynt ra lder e S n n igu o bl tio n e ds o od rati onf ceh pati jec ctio e type nam ho h in s s et od met figu n c pla om ns* tor inje nam by by E ton ype r o y m eth oy con tati erty g C tio truc erty by wire wire T va M gle otot zy ger cto t m str L no op rin as llec ns op ire to to n r a a a ni e M n r p li o o r GW Ja Si P L E F I D X A P S A C C P W Au Au Rocket GWT y n y y y y y y y y n y n n all y y y n n Spring ME y y y y y y y y y y n n y n l/m y y y y* y* Israfil IoC n y y n n n n n n n n n n n ... y n n y y Fall ME n y y n n n n n n n n n n n ... y n n n n GWToolbox y n y y y y ? y y n y y n n all n y n y y Signal n n y y n n ? n n n n n y n all n y y ? ? 42
  • 43. Sanitized API > Java ME needs a lot more sanity ● J2ME Polish is your friend > Java Card is probably too limited to use wrapper APIs > GWT is already addressed by a lot of frameworks 43
  • 44. AOP > What about it? > Compile team weaving? > Using the metadata, AOP proxies could be constructed at build time > The factory could construct instances of these proxies instead of the actual objects 44
  • 45. Current Status and What's Next 45
  • 46. Current status > 'Request' scope > 'Session' scope > 'Global session' scope > BeanFactoryAware, but ... > BeanPostProcessor (without reflection?) > BeanFactoryPostProcessor, but ... > FactoryBean, but ... 46
  • 47. If there's only one thing you remember > “ME” as in “supporting Java ME” > “ME” as in “a microscopic small version of Spring” > Useful for Java ME > Useful for GWT > Useful for Java SE > Potentially useful for Java Card and Java EE 47
  • 48. Other than that > Version 1.0 just released > GPL + Classpath Exception > Integration with J2ME Polish > JSR 296 on ME > http://springframework.me/ > spring-me@googlegroups.com 48
  • 49. Wilfred Springer wilfred at flotsam.nl http://springframework.me/