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
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
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
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
29. Generates this BeanFactory
public class BeanFactory {
public Object getBean(String name) {
if (“movieFinder”.equals(name)) {
return getMovieFinder();
}
}
private final Object getMovieFinder() { … }
…
}
29
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
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
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