Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    #16
    Are you asking about when we would recommend dependency injection? We've already answered that. It's just that you keep reiterating that you have some services, but you've told us nothing about what they do. If you've set up some services whose purpose is just to help with ordinary data storage and querying, then as we've already said, this is a situation where we don't think that an external dependency injection system such as Guice is worth using, because it introduces more complexity than it saves.

    Or another way to put it: our DMI system can be considered a dependency injection architecture, which makes available variable service objects (DataSource, RPCManager, etc), which already provide data storage and querying and several other areas of functionality.

    Comment


      #17
      For completeness:

      here is my dmiFactory:
      Code:
      public class DmiFactory {
      
          public DmiFactory() {
          }
      
          public Object create(DSRequest dsRequest) throws Exception {
              DataSource ds = dsRequest.getDataSource();
              if (! (ds instanceof BasicDataSource)) {
                  throw new Exception("BasicDataSource not available.");
              }
              BasicDataSource bds = (BasicDataSource) ds;
              String className = bds.getProperty("operationBindingsClassName");
              if (className == null) {
                  throw new Exception("operationBindingsClassName not existing");
              }
              ServletContext servletContext = dsRequest.getHttpServletRequest().getServletContext();
              Injector injector = (Injector) servletContext.getAttribute(Injector.class.getName());
      
              Class<?> operationBindingsClass = Class.forName(className);
              Object injectedInstance = injector.getInstance(operationBindingsClass);
      
              return injectedInstance;
          }
      
      }
      Isomorphic any news on this ? You said you will consider implementing this out-of-the-box.. do you have any news on this ?

      Comment


        #18
        This is currently backburnered. We've had only one request for it, and it doesn't seem to eliminate much application code.

        Comment

        Working...
        X