- ColdFusion 9 Developer Tutorial
- John Farrar
- 228字
- 2021-08-05 16:16:38
Object method access control
Generally, objects are not intended to create output other than returning actual variables. That is why the attributes output="false
" have been added all over the CFC code. You will also notice that there is an attribute called access="public
" in many of the methods. There are actually a number of settings for this. All of these indicate where the calling code must be for the method to run. Here is a list of the settings and definitions for each one:
- Public: This is the most common and default setting, if not declared. It means that any code on the server can call the object method and it will run.
- Private: In this case, the method may only be called from within the CFC. In practice, we would have taken our
setAttribute()
method and made it private. This method would normally be called only from within the actual CFC and never from outside the CFC. - Package: This is the condition where code only in the same directory may call the method. The term package comes from the object-oriented world and it is an interesting way to protect code integrity.
- Remote: Here is one of the most powerful aspects of ColdFusion. This is actually what is called a web service. Just setting this exposes the object to the outside world. We will cover more about this later.
推薦閱讀
- 常用工具軟件案例教程
- Hi!扁平化Photoshop扁平化用戶界面設計教程
- Flash CC動畫制作案例教程
- Quickstart Apache Axis2
- Photoshop CS6實戰從入門到精通(超值版)
- Indesign平面排版技術應用
- Choosing an Open Source CMS: Beginner's Guide
- Cinema 4D基礎與實戰教程
- Premiere Pro基礎與實戰教程
- MATLAB在日常計算中的應用
- Adobe創意大學Premiere Pro影視剪輯師標準實訓教材(CS6修訂版)
- Excel數據處理與分析:數據思維+分析方法+場景應用
- Microsoft SQL Server 2008 High Availability
- Joomla! 1.5 Top Extensions Cookbook
- Inkscape 0.48 Essentials for Web Designers