3 Replies Latest reply on Nov 27, 2008 8:51 AM by Newsgroup_User

    Some CFC's Concept Problems For Me Instead?

    thenotorious_flag Level 1
      I did interviewed last time and repeatdly i asked the same question again & again:

      1. Does Coldfusion CFC Support Overriding & Overloading.

      2. Does Coldfusion CFC Can Be used as a Constructor

      3. Does the Clothes of Plymorphism and Encapsulation be added to the Coldfusion CFC's

      4. Why We Use Cfthrow and Cfrethrow

      5. Where are triggers Used in Coldfusion?

      Well To be honest, I do not know the answer of the above.

      I know inheritance is possible in CFC but above i am not clear much. I did try to find out in google but unlucky.

      If some of U Please know how to define above Please guide through here to all these concepts applied or not?

      Cheers
        • 1. Re: Some CFC's Concept Problems For Me Instead?
          Level 7
          > 1. Does Coldfusion CFC Support Overriding & Overloading.

          Overriding: yes. Overloading: no.


          > 2. Does Coldfusion CFC Can Be used as a Constructor

          Not really. There's a notion of a "pseudo constructor" which is any code
          within the CFC which is outwith any <cffunction> block. THat's called when
          the CFC is instantiated. It's not possible to parameterise this though. A
          de facto standard has been adopted by many people in that a CFC will ahev
          an init() method, which anyone suing the CFC *should* call when invoking
          the CFC, but there's nothing enforcing this.


          > 3. Does the Clothes of Plymorphism and Encapsulation be added to the
          > Coldfusion CFC's

          To a reasonable degree, yes.


          > 4. Why We Use Cfthrow and Cfrethrow

          You can look this one up. It's not a specific CF question, it's just a
          programming practices one.


          > 5. Where are triggers Used in Coldfusion?

          Um... they're not? Teriggers are a DB concept.

          HTH.

          --
          Adam
          • 2. Re: Some CFC's Concept Problems For Me Instead?
            thenotorious_flag Level 1
            Not really. There's a notion of a "pseudo constructor" which is any code
            within the CFC which is outwith any <cffunction> block. THat's called when
            the CFC is instantiated. It's not possible to parameterise this though. A
            de facto standard has been adopted by many people in that a CFC will ahev
            an init() method, which anyone suing the CFC *should* call when invoking
            the CFC, but there's nothing enforcing this.

            Can U Please elaborate tis Please?
            • 3. Re: Some CFC's Concept Problems For Me Instead?
              Level 7
              > Not really. There's a notion of a "pseudo constructor" which is any code
              > within the CFC which is outwith any <cffunction> block. THat's called when
              > the CFC is instantiated. It's not possible to parameterise this though. A
              > de facto standard has been adopted by many people in that a CFC will ahev
              > an init() method, which anyone suing the CFC *should* call when invoking
              > the CFC, but there's nothing enforcing this.
              >
              > Can U Please elaborate tis Please?

              I... don't know... what else to say. That's it.

              I'm not a search engine you know ;-)

              However: Google is.

              Or, hey, there's the documentation:
              http://livedocs.adobe.com/coldfusion/8/buildingComponents_01.html

              Read that lot, have a look around at what other people are saying about
              init() methods in CFCs and pseudo-constructors, and come back here if
              you've got some specific questions.

              I'm glad to help, but I'm reluctant to spoon-feed, if you know what I mean.

              --
              Adam