4 Replies Latest reply on Aug 6, 2007 10:47 AM by Ales Justin

    Alias status inside Controller

    Ales Justin Master

      Is this a valid method on Controller?

       /**
       * Get the alias status.
       *
       * not present : Not_Installed
       * pending: Start
       * installed : Installed
       *
       * @param alias the alias
       * @return status
       */
       ControllerState getAliasStatus(Object alias);
      


      Since it hides the alias impl details (lookup of Context with this name: alias + "_Alias").

        • 1. Re: Alias status inside Controller
          Adrian Brock Master

          No. There is absolutely no need why that logic has to be implemented in the controller.
          There already is a mechanism to retrieve a context's status any additional logic
          on top of that is not a function of the controller.

          NO FAT INTERFACES! Let's keep it minimal please.

          I don't understand the alias + "_Alias" reference?

          • 2. Re: Alias status inside Controller
            Adrian Brock Master

            I note you've still not fixed some of the public methods you introduced
            on the AbstractKernelController that I complained about before.

            They need fixing otherwise somebody can break the entire state machine with injudicious
            (or malign) invocations on those methods.

            This is basic OO principles. All public methods should keep the invariant state
            of the underlying Object, there should be no backdoors. :-)

            • 3. Re: Alias status inside Controller
              Ales Justin Master

               

              "adrian@jboss.org" wrote:

              I don't understand the alias + "_Alias" reference?


              When you add a new alias, I install a new AliasControllerContext into the Controller, for the alias to be a full dependency item.
              This new AliasControllerContext gets the name after alias --> alias + "_Alias".

              So when you are interested if alias already exists or is pending, you need to know this impl detail.
              But I wouldn't want this detail to be exposed outside AbstractController.

              • 4. Re: Alias status inside Controller
                Ales Justin Master

                 

                "adrian@jboss.org" wrote:
                I note you've still not fixed some of the public methods you introduced
                on the AbstractKernelController that I complained about before.

                They need fixing otherwise somebody can break the entire state machine with injudicious
                (or malign) invocations on those methods.

                This is basic OO principles. All public methods should keep the invariant state
                of the underlying Object, there should be no backdoors. :-)


                I'll have a look.
                Closing all backdoors on the way out. ;-)