1 2 Previous Next 18 Replies Latest reply on Feb 27, 2008 9:40 AM by ataylor Go to original post
      • 15. Re: New package structure
        ataylor

         

        Being dependent on the implementation in one place (at construction) is better than being dependent on the implementation in N places (each place the class is used), so it's an improvement.

        I agree, but that is what IOC is all about, it class doesnt have to worry about how a pluggable component is constructed.

        1) Makes testing a whole lot easier since can easily create mock / fake implementions
        i agree

        2) Makes code easier to read / understand

        again i agree

        3) If user wants to create their own implementation of the interface they can. If it's a concrete class they'd have to extend that class. That may not be possible or desirable.


        defo.

        I'm not against using interfaces where we can, just making a point. We have to make sure that we dont just introduce interfaces that are dragged out of the implementation, the abstraction still needs to make sense.

        • 16. Re: New package structure
          jmesnil

           

          "timfox" wrote:
          I have just committed a refactoring to our new package structure.

          Here is how it goes:

          org.jboss.messaging.core and sub packages.

          Contain the messaging core - this is all the stuff needed to make a fully functioning transactional, reliable messaging system.

          ...

          server - the core server interfaces and implementation

          ...

          client - this contains the core client interfaces and implementation


          I'd put the stuff common to the client & server code directly under org.jboss.messaging.core.
          I'm thinking mainly about the Message interface (and also the Version interface, anything else?).
          I find weird in client code to instantiate an object from server.impl package.

          As an aside, we should also extract a subset of the Message interface common to the client and the server. In this interface, all the methods related to MessageReference do not make sense in the context of the client.

          • 17. Re: New package structure
            timfox

             

            "jmesnil" wrote:

            I'm thinking mainly about the Message interface (and also the Version interface, anything else?).
            I find weird in client code to instantiate an object from server.impl package.


            We should probably create a core/message package to avoid this problem.

            Version is already in core/version.


            • 18. Re: New package structure
              ataylor

               

              2) Deployers. Currently abstract class Deployer is exported from the module. This should be an interface. Also DeploymentManager should be an interface. We should also avoid singletons throughput JBM, this is to allow multiple JBM instances to co-exist in the same VM without interacting.

              done

              1 2 Previous Next