vendredi, juin 22, 2007

Spring One (day3) : Spring Batch



Last presentation!!!
Spring IDE's presentation occured at the same time, but as I already knew a bit about it... I skipped. But go and get release 2.0 (released next week if I'm not wrong) it is amazingly productivity-inducing!

And now on to Spring Batch.
This new product of the portfolio allows to deal with batching.
It was a project built by Accenture and is now a co-project of Accenture and Interface 21.

It starts from the statement that nothing exists covering that subject in Java, and that there's a common misconception about the fact that Batch is not possible nor efficient in java.

It seems really complete and well-thought and is already production-grade.

I really dig the Enterprise Message-driven processing, sadly it's not targetted for version 1.0.

Features:

  • multiple formats for files

  • Automatic retries

  • Job control language (start, stop, suspend, cancel)

  • status and statistics

  • Entry points for launch (http, Unix script,incoming message, etc...)

  • Ability to run concurrently with OLTP system

  • Ability to use multiple transaction resources

  • Support services (logging...etc)



It really deals very well with batch retries at multiple levels, with a fairly rich set of possibilities.
Coding is (obviously one would say) POJO based, and batch behaviour is non-invasive.
Business logic is completely separated from job execution policies.

The really interesting stuff not mentionned but implicit is that jobs can now be thoroughly unit tested (not integration tested, UNIT tested with mocks and everything!!).

JMX Management is soon to be released. (How about batches launched from JRuby?)

Roadmap:
Milestone 2 is soon to be released.
In the future:
Partitioned container,SEDA,Grid, ESB support, and more...

Spring One (day3) : Spring, dynamic languages and DSLs




Rob demonstrates how to use JRuby with java with Spring and standalone.

A little demo of the spring integration.

Followed by a demo of mscript.db allowing to interact with JMX using JRuby scripting. Very powerful indeed. This will be in my toolbox ASAP! ;)

He also advertises "The Ruby way" as a good book to read for starters on Ruby.

Then on to the DSLs!
It is sad to see that support is for now a little hacky (fun and well done though) and that official support won't be there until Spring 2.2 or 2.3.

Definitely worthy of attention at the end of the day.

Spring One (day3) : ROO




ROO or Real Object Oriented programming.

It is a really nice framework part of the portfolio and enforcing the concepts part or Eric Evans' book on Domain driven design.

It's really a nice way to deal with the anemic model issue and is nicely integrated with tooling (Eclipse, Maven 2...etc).

The smashing fact is that it generates and deals with DTO generation and assembly bazed on Dozer (3.4).
They are useful as form backing objects and for remoting.

Until now, it is the really neatest and newest stuff I've seen in this conference.

Please please please go and see Spring ROO (possibly still named Acegi ROO at that time though)!!!

Spring One (day3) : OSGI




This presentation nicely sums up OSGI.
Key assets are:

  • Visibility: a bundle is a black box if not explicitely specified. Nice but does not fit with the current classloading designs where everything is in the same space (more or less)

  • Operational control: see modules and their status, install, activate,...bundles.

  • Dealing with dynamics: types and services can be exported and contributed (passive and active contribution respectively because services changes are dynamically seen).



Then what about OSGI and Spring?
How do you split applications into a number of OSGI bundles
Bundles need: instanciation, configuration, assembly, decoration.
This should not be coded, this is (mostly) boiler-plate code.

The purpose is to keep the Spring development model.

Main entrypoint there is an OSGI bundle-based application context.

Interesting thing is that beans can easily be exposed with a specific namespace (<osgi:service/> and <osgi:reference/>) and all the lifecycle and (re)binding of services is dealt with by Spring OSGI.

The ConfigurableBundleCreatorTests are interesting for integration testing. It can run the test of your code inside of an OSGI container. This is really a great progress, mostly if one can set it up for testing Eclipse plugins...

Provisioning with Maven and Ivy is also a catch and is planned for after version 1.0 (part of Maven support already is included in pre 1.0 though).

jeudi, juin 21, 2007

Spring One (day2) : New features in Spring 2.1




This will be a list of what is described:

Platforms:

  • JDK 1.6 (JDBC 4.0, JMX MXBeans, JDK ServiceLoader API)

  • Java EE 5.0 (Servlet 2.5,JSP 2.1, JSF 1.2, JTA 1.1, JavaMail 1.4,EJB 3.0 session beans,JPA even inside JEE 5.0 server, Deployment as JCA 1.5 RAR file, Websphere integration through specific addons)

  • OSGI support (allows a similar programming model between OSGI or J2EE deployment)



Configuration:

  • JSR 250 Common annotations(now supported by all JDK 1.6 and Java EE 5, and JDK 1.5 with the common annotations jar)

  • @Autowired annotation (fits well between name and type autowiring)

  • "context" configuration namespace (convenient context-relative functionalities)

  • @Component annotation



AspectJ Support:
cf. previous presentation I blogged about.

@Configurable Revisited:
no AspectJ compiler necessary (based on load-time weaving)

JMS Message Listener Containers:
"jms" XML Schema Namespace

JCA 1.5 Namespace also

still to come (not in RC versions):
Junit 4 support and Rhino/javascript support.

Spring One (day2) : Concurrency and Spring




First a definition of the Java Memory Model based on:
- Ordering
- Atomicity
- Visibility

Interesting thing I missed, volatile keyword guarantees atomic R/W on lon and double types.

He then goes on quoting stuff from Java Concurrency in practice (Brian Goetz), e.g. the Holy Bible ;).

Once again I see somebody enforcing the need of immutable objects! So people! Use them!!!!!!!! It IS the key to safe publication.

Spring One (day2) : WS-DuckTyping




How to extend the concept of Duck typing to webservices.

Duck typing is a feature of dynamic languages: "if it walks like a duck and sounds like a duck, then its a duck".

Basics are:

  • Don't validate incoming messages

  • Use XPath

  • Don't create stubs and skeletons.



One rule is: sending should be conservative, and receiving liberal.

Schematron seems interesting in this approach because it is based on finding tree patterns (RelaxNG also does this).
More simply, XPath allows to look for an info without assuming that the surroundings (things out of the path) have any strict structure.

Spring WS 1.0 RC2 is out and based on contract-first and XML use without directly doing XML.

There are a lot of cool XML and particularly XPath helpers in this release, even if you don't need to use it for web services.
XPathTemplate, NodeMapper, and annotations make it very handy and easy to use XML with the ability to switch implementations.

Spring One (day2) : Advances in AOP




This time a quite technical presentation.

First half is an introduction to AOP and AspectJ syntax (code, annotations, xml) with pros and cons for the different syntaxes.

Interesting thing in Spring 2.1 is the new Native AspectJ weaving.
Also of interest is now the bean(*) syntax. This allows to create pointcuts based on beans characteristics (name for example).

He then demonstrates how you can use AspectJ to enforce Architecture designs.
For example showing errors at compile time when somebody access data from the ui layer. You can basically enforce things by modifying compiling behaviour. Interesting, but this can become really messy if done too loosely.

Adding mixin to interfaces is also interesting when you have to deal with boilerplate code for implemented interfaces (for Example the *Aware interfaces whose method implementations is 99,99% of the times the same).

Interesting usage is also the ability to implement retry/failover strategies for remote services using around advices.

Sadly AOSGI is only mentionned but not discussed in details. That was the reason of my presence in the first place in this presentation... :P

Overrall it's interesting to see how AOP is now so widely used ;) (when using Spring at least).

Spring One (day2) : Keynote




This keynote describes the Spring Portfolio starting with a really funny (crazy?) show of Adrian with a duck and a chicken hand puppets... in a personal interpretation of DuckTyping.

Interesting info: Spring projects will now have a release train "a la" Eclipse.




Second speaker is Eric Evans. Another soothing/sleep inducing voice, yet an interesting talk about the concepts of Model/Domain driven design.
I can't wait to read his book I just bought yesterday. ;)
Really hard to sum-up again. I'll be glad to see it on Parley.

I liked the idea that quality of the code produced by a team is usually driven by the 2nd worst programmer, because all the team is already focusing on the very known worst programmer and doing damage control ;).

The conclusion is that one should establish a Context Map of a system and build an anti-corruption layer. I think I'll elaborate on this in a future post because this is really interesting, and this post is getting messy :P

A very nice analogy of these context maps is living cells in organisms.


In the end Eric Evans'talk was a great non-technical talk!

Spring One : after 1st day





A (once again not that great...Spring One should really happen in France ;)) meal and a few glasses of fresh white wine later, David, Torsten and I went back to the hotel in order to have a few beers by the pool.

I guess the visit of centre-town will be for tomorrow.

mercredi, juin 20, 2007

Spring One : SOA without Hype






Brilliant presentation about pragmatic SOA.

Hard to sum up, but very fun and interesting.

A few fun points about SOA's absurdities, WS-(death-)star specs, and about REST.

Hope this will be very soon on www.parley.com.

I'll remember the sentence: "tooling is often used to cope with a crappy product"...

Also possibility of creating an SOA based on emails and XMPP is intriguing.

Spring One : JSF and Spring




Colin is a great speaker, though his voice is so soothing that you'd fall asleep :P.

First a general presentation of web frameworks and Spring /JSF.

Interesting point: when using scopes like session, request, be careful of the scoping of injections.
For example if you inject a request scoped bean in a session scoped bean, the request scoped bean will only be created once per session... not the expected behaviour!

there's now an <aop:scoped-proxy /> that provides a proxy of the bean that recreates the bean for example for each new request.

Then Colin goes on with the longest silence in a conference ever while going through his file system... very strange!

Then the rest of the talk describes the variable resolvers, navigation handlers... etc

Colin really talks more about Spring Web flow than Spring with JSF anyway.

Spring One : SCA


Keywords for SCA:

- Assemblies (component, reference, promote, properties, bindings)
- Policies (intent, policyset, WS-Policy*)
- Client & Implementation models (java, C++, php, COBOL, ... etc)

see http://www.osoa.org.

Presentation of SCA is hard to sum-up yet very interestingly layered like Spring. Analogies with Spring are also interesting:
- Assemblies => context
- Policies and intent => AOP + annotations
- Implementation Model => bean :P or so

The Java implementation model, lifecycle, asynchronous/conversational state, callback (and so on) are sadly defined through YASLF ;) (Yet Another Specific Language Feature) though Spring support should allow to bypass these specific annotations and just expose a Spring bean.

Interestingly enough the Conversational and asynchronous mechanisms seems brand new to me in SOA in general (from the implementation point of view at least) as usually this is dealt with low-level solutions like a MOM.

Basically the Spring mechanism for this maps on sca descriptors quite closely.

On the OSS implementation side for java, Tuscany and Newton (based on OSGI).

Spring One : Introduction to Spring Web Flow



It's interesting to compare this version of the presentation with the early drafts presented last year.

Spring web flow is indeed more mature now and integrates well with JSF or Spring MVC.
It is well fitted for Wizard-like web interfaces with a rich state management.

What's interesting is that the state can be stored to anything (not only Http session, but also database for long running flows for example).

Spring One: lunch

No more lunch for us... lunch delivery obviously failed which lead us to have a wonderful belgian lunch.
And yes, Quick fastfoods are Belgian food... or not!

Spring One : GWT/Spring




Interesting presentation with mostly features of GWT plus a few integration points for Spring Business layer.

Sadly, no insight on future support for Java 5 Annotations, and no first idea of the upcoming version 1.4 which deals with the IsSerializable vs. Serializable issue amongst other things (modular RPC services for example removing the need for GWTHandler in order to integrate wutg spring).

Conclusion: until further notice, DTOs should be used with the addition of a specific Service Facade Layer to the business layer and a DTOConverter (Special mention for Spring's BeanUtils for the copy of objects' states).

My own conclusion: wait for version 1.5 of GWT for a more completely useable GWT, and keep experimenting with it.

Spring One: keynote


Keynote just finished.



It surprisingly and interestingly began with a demo of Spring .NET project and how similar developing for .NET or Java is with Spring.

A lot of marketting stuff for 3/4 of the rest of the show.
The major intend was to justify the venture funding of 10M$ for Interface 21.
Interesting thing here (from a 'technical' point of view) is that 4 Full Time Employees(FTE) will be allocated to the web part of the portfolio, and about 3 to the core Spring functionalities (against a round value of respectively 1 and 1 cumulating the work of all contributers).
An analogy between the Eclipse and Spring momentums also made a bit of sense.

For the last quarter of it, a description of a few projects of the Spring portfolio took place.
Interesting emphasis on Spring Batch project as a replacement for existing legacy batch processing.
Spring Web flow and its JSF support was also interesting.
Spring IDE (my own personal favorite ;)) had an interesting little demo. Christian has really worked his $ss off on this! New features are stunning and already cover upcoming Spring 2.1.

Overall the keynote was a bit boring for the marketting part (after all the audience is not made of funders nor shareholders) but gave an insight of future developments around OSGI and Web-related projects.

I'm now waiting for a GWT/Spring presentation that should wake me up (I woke up at 4 this morning)...

Spring One: before


Just arrived in Antwerpen.

Little breakfast in the hall next to Rod Johnson rehearsing his keynote speech in a corner of the room.

2 hours of keynote indeed diserve a rehearsal!