concept crosstalk in category dependency injection
appears as: crosstalk

This is an excerpt from Manning's book Dependency Injection: Design Patterns Using Spring and Guice.
I’ve chosen to do a simple, trivial clone of the popular microblogging service Twitter. (This isn’t in the least bit because I spend large chunks of my day on Twitter!) While I was writing this chapter, I thought crosstalk was cool code name.
Listing 11.1. The Guice configuration for crosstalk (also creates the injector)
public final class CrosstalkBootstrap extends GuiceServletContextListener { @Override protected Injector getInjector() { //bind in all of our service dependencies final Module services = new ServicesModule(); //tell Sitebricks to scan this package final Module sitebricks = new SitebricksModule() { protected void configureSitebricks() { scan(CrosstalkBootstrap.class.getPackage()); } }; //map all incoming requests through the PersistenceFilter final Module servlets = new ServletModule() { protected void configureServlets() { filter("/*").through(PersistenceFilter.class); install(sitebricks); } }; //finally, create the injector with all our configuration return Guice.createInjector(services, servlets); } }
Our thesis is fairly straightforward: crosstalk allows users to write short text messages (called tweets) on their home page. This engenders some broad requirements. We need to