Answered
CFC best practices
Hello. Please help me out with a little issue I have. I've
recently started working with CFC's and there is something that I
want to get clear. I have seen two different ways to write CFC's
(although I'm sure that there are many others). Let me get to the
point. The first method uses an init() function that acts as a
constructor.
The second way does not use the init() function. It just has the set and get methods and uses "This" to refer to them. I will attach both code snippets at the end. My question is. What is the best way (if there is any)? Are there advantages to one of the methods? if there is anything I left out that would make my question more clear please let me know. Thank you for your time.
The second way does not use the init() function. It just has the set and get methods and uses "This" to refer to them. I will attach both code snippets at the end. My question is. What is the best way (if there is any)? Are there advantages to one of the methods? if there is anything I left out that would make my question more clear please let me know. Thank you for your time.
