Adobe Coldfusion 11 Tutorials | Getter & Setter Methods with Attributes | Chap-2 | Part-5



Adobe Coldfusion 11 Tutorials | Getter & Setter Methods with Attributes | Chap-2 | Part-5

Adobe Coldfusion 11 Tutorials | Getter & Setter Methods with Attributes | Chap-2 | Part-5

We are going to look at the structure of a function in Adobe Coldfusion. Perhaps, a function, or in object-oriented context, a method is a fundamental building block in every programming language. Likewise, Coldfusion takes two syntactical approach in method creation, first is the CFML way of using tags of cffunction and the second approach is using the function keyword along with a name, brackets for arguments followed by curly braces that is used to define the method body or the actions or behaviours that it will perform while the method is invoked or called after object creation. In the setter method, we passed in an argument. This argument can be accessed by using the built-in arguments structure of Adobe Coldfusion. The getter method likewise retrieves the value from the attribute that was initialized with an empty string in the constructor method. In here, we can observe that this attributes can are accessible inside method definition or declaration and additionally, we can only use the attributes from one component call to the other. Attributes can be used as encapsulated variables but objects will not the ability to access the internal attributes directly.

SUBSCRIBE….SHARE….LIKE

Comments are closed.