2 Replies Latest reply on Jun 23, 2009 10:20 AM by gurkanerdogdu

    Kernel Class Constructor Access Modifier

    gurkanerdogdu

      Hi;

      I was looking for the configuration and booting of the Kernel instance. There is a class KernelFactory to create Kernel instances. It is a singleton factory class for Kernel. But then why Kernel class has a public constructor?

      Is it more reasonable to create protected constructor for Kernel class?

      NOT : I am not sure this is a development forum question. If not please warn me!

      -- Gurkan

        • 1. Re: Kernel Class Constructor Access Modifier
          alesj

           

          "gurkanerdogdu" wrote:

          I was looking for the configuration and booting of the Kernel instance. There is a class KernelFactory to create Kernel instances. It is a singleton factory class for Kernel. But then why Kernel class has a public constructor?

          Is it more reasonable to create protected constructor for Kernel class?

          I don't think it really matters.
          Or why do you think it's important?

          I think the factory here just acts as an object that knows how to provide you with default configured Kernel.
          But you can instantiate it yourself (hence public ctor) and configure it differently.


          • 2. Re: Kernel Class Constructor Access Modifier
            gurkanerdogdu

             


            I think the factory here just acts as an object that knows how to provide you with default configured Kernel.
            But you can instantiate it yourself (hence public ctor) and configure it differently.


            Ah, ok. I just wonder that generally factory methods are used for hiding the object creation details.

            Thanks;