One of the most important things you'll do when using WebSphere eXtreme Scale with Spring is wiring the instances of ObjectGrid, Session, or EntityManager into data access layers. A common application activity is finding and saving users to some data store. Let's see how we would do it with a data grid. If we have an existing DAO interface like this:
public interface UserDAO { public User find(int id); User find(String username); public void addUser(User user); }
We expect to use any implementation of this in our application. Chances are that we have an implementation that uses an ORM framework with a database backing it. Calling methods on implementations of this DAO are probably already established, and we should conform to the expected usage when we try to work WebSphere eXtreme Scale into the development environment. This means that our implementation should not require any setup or initialization beyond what can be accomplished via dependency injection...