Thursday, 27 September 2012

Java basics: converting a collection to a string

If you look up how to write a map or a list out as a string, you can find lots of complicated answers involving loops and even XMLEncoders. It doesn't have to be that hard. The easiest way to convert a Map into a nice string?

String niceString = Arrays.toString(map.entrySet().toArray());

It's even easier for a list:

String niceString = Arrays.toString(list.toArray());


Wednesday, 26 September 2012

Enterprise OSGi in Action

We're getting really close now ... 

Are you looking for a way to write an OSGi web application? Or get JPA persistence working in OSGi? Or just group your OSGi bundles into something a bit more granular? Do you need a guide to best practices for OSGi build and test? 

Modern enterprise applications must be scalable, maintainable, and modular. Unfortunately, by itself Java EE doesn't do modularity very well. The Enterprise OSGi model enforces simple rules to make Java better at modularity. And now, projects such as Apache Aries and Geronimo provide pluggable components that make it easier than ever to use OSGi's mature modularity system in your own enterprise applications.

Enterprise OSGi in Action is a hands-on guide for developers using OSGi to build the next generation of enterprise Java applications. By presenting relevant examples and case studies, it guides the reader through the maze of new standards and projects. Armed with this knowledge, readers will learn how to build and deploy enterprise OSGi applications, use automatic dependency provisioning, declaratively provide enterprise qualities of service to their business logic, and make use of the Java EE technologies they know and love in a familiar way.

Manning have a reader forum where you can ask Tim and me questions (or I'm on twitter @holly_cummins).