Caucho Technology
  • resin 4.0
  • inversion of control (ioc) tutorials


      Binding Patterns

      Four of the primary Java Injection patterns.

      Injection

      The Dependency Injection pattern simplifies application code, and increases configuration flexibility by deferring component configuration and assembly to the container. Resin calls setters on the configured objects to assemble the resource dependencies.

      IoC appconfig

      Applications often need to read, and possibly write, configuration files. An excellent way to accomplish this is to implement a custom singleton, which is easily configured and easily obtained from anywhere in the application.

      This implementation of the concept allows you to configure a base directory for configuration files. An object of type AppConfig is obtained with a javax.enterprise.inject.Current injection. It is used to open files relative to the base directory.


    Copyright © 1998-2011 Caucho Technology, Inc. All rights reserved.
    Resin ® is a registered trademark, and Quercustm, Ambertm, and Hessiantm are trademarks of Caucho Technology.