Intro
Spring-based Architectures?
Why this talk?
A Few Words About Spring
The Unique Feature of Spring
Dependency Injection
Why Dependency Injection?
What Spring Offers...
Object Orientation in Spring Architectures
Typical Spring Architecture
Typical Spring Architecture: Services
Typical Spring Architecture: DAOs
Domain objects
Spring Architectures
My goal
Is the shown Spring architecture object oriented?
An example: Using a Service ...
Is that object oriented?
Fundamentals of Object Orientation
So it is not object oriented: Behavior implemented in the service not in the object
Services and Domain Objects
What it should look like...
Spring 2.0 helps
@Configurable Example
Does that help?
Why it does not help
RebatableShoppingCard with Services
Object-oriented RebatedShoppingCart
What might help
Not always a good idea
So what now?
Is Object Orientation the Silver Bullet?
Which problem are we solving?
Reason for Service / Domain Model separation
Why separate Domain Objects from Services
Just add an Exporter
Just a configuration
Problems of Exporting Services
Another example for Service / Domain Model separation
DAO is also Service / Domain Model separation
DAO in Action
Is the DAO Pattern a bad idea?
Interchangeable Persistence Technology
Interchangeable Persistence
Which Persistence Technology Lurks behind this Interface?
Which Persistence Technology?
Persistence Independence
Why care about Interchangeable Persistence Technologies?
Persistence: Result
Spring, Architectures and Layering
Again: Typical Spring-Architecture
How do you make Layer Software Artefacts?
Layer in Spring Configuration: <import>
Layer with Spring Configuration: ApplicationContext-Hierarchies
Layer with Spring Configuration: JAR file per layer
Still...
Spring-OSGi
But this is only about Spring-Beans and Configurations
What about the Code?
Code: DAO-Interfaces
Code: Service
Define Layers as Pointcuts
Power Point Architecture
...and Software-Artefact
To Sum Up
Architectures are complex - No Golden Bullet.
Welcome to the world of Spring- a very powerful framework that opens a lot of possibilities. More often than not the potentials of Spring leave people confused. How should an application be designed? What about best practices? In this talk some of the issues for the architecture of Spring applications are explained in more detail and typical approaches are shown. This includes typical solution in areas like
the design of a persistence layer
the choice of persistence technology
how to actually make layering work
the design of the service layer
how to do distributed applications with Spring.
Eberhard Wolff is one of the founding members of the Java Champions program and a Java developer since the early days. His focus is on enterprise systems. He regularly publishes articles and gives talks at several conferences. He is also author of the first German Spring book.