1. Trang chủ
  2. » Công Nghệ Thông Tin

ColdFusion MX Bible phần 5 pdf

124 265 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 124
Dung lượng 0,94 MB

Nội dung

456 Part IV ✦ ColdFusion MX Components, Web Services, and Flash Integration By now, you probably get the basic idea that, at its most basic level, a component is like a container for related functions, and invoking component functions is much like invoking local functions except that you must also specify the name of the component that contains the function. So . . . big deal? You bet! Even the most basic use of the simplest components changes your approach to ColdFusion development, because you’re now completely separating logic from presentation; you’re exposing logic as a set of simple, yet formal function calls available to any part of your application (even remote applications, as you see in Chapters 25 and 26); and you’re encapsulating the functions related to a single entity into a single component. And if you think components are just a substitute for a bunch of CFINCLUDEs, keep reading. . Separating logic from presentation The need to separate logic from presentation is more important now than it has ever been for a number of reasons, as outlined in the following list: ✦ The ever-increasing array of handheld devices and their widely varying display formats. ✦ The renewed interest in syndicated content that must form-fit various Web layouts. ✦ The trend away from delivering plain-text streams and HTML and toward delivering generalized XML, XHTML, WML, and other “pivot” formats (i.e, formats that acts as intermediate steps in a data conversion process) that are further processed into fin- ished content on target devices. ✦ The desire to easily expand very large corporate applications while minimizing new errors or anomalies into the software. ✦ The headlong rush into delivering better, faster Web applications through Flash MX Remoting technology. By encapsulating into a single component all the functionality related to an entity and then simply calling on that component whenever data is needed to be retrieved, updated, deleted, and so on, you build applications that help achieve the goals of targeting common functional- ity to multiple display formats and building Enterprise-scale applications that are straightfor- ward to develop and easy to maintain. Another benefit of such encapsulation is the focus that it naturally places on good design. If you’ve developed in earlier versions of ColdFusion, think for a moment how you approached pre-MX ColdFusion application design. Data was the stuff that you shoved into and pulled out of databases for the sole purpose of accomplishing some task spread out across a number of individual browser pages. Sure, you had CFINCLUDE and custom tags, and you could create snippets of reusable code if you were keen enough to spot duplicated code, but all your logic was still thinly spread out across multiple templates located who-knows-where. If you take the opposite approach and gather together all the functionality related to an entity into a single component, you begin to “think like the entity” and ask yourself, “What does a company need to do?” After the obvious partial answer of “Create, read, update, delete, and list,” you begin to uncover a few specialized needs such as “calculate the annual sales of the company” and “tell me how many people are employed by this company” — all of which can be incorporated into that one Company component. Before you even know what you’ve done, you’ve built a centralized source from which to request all operations and data related to companies, regardless of how the data is supplied to or requested from that source. Now, all you need to do is call this functionality and display the results. 26546228 ch22.F 1/30/03 10:53 AM Page 456 457 Chapter 22 ✦ Understanding ColdFusion MX Components Get used to passing messages So things are a little different from earlier versions of ColdFusion, eh? Now you have a formal input interface requiring data of specific types and a formal output interface returning data of a specific type — as you learn in Chapter 17, as you first start building user-defined functions by using the new CFFUNCTION tag. Now everything is done through messages: one message containing arguments going in and one message containing the single result variable coming out. This technique may seem a little odd at first, but this is precisely how object-oriented languages work. The Nickel Tour of objects Your telephone is an object; it is a specific instance of the general class of telephones. As do all other instances of the class telephones, your telephone has all the general properties of a tele- phone: a receiver to which you can listen, a transmitter into which you can speak, a control for dialing someone’s number, and so on. Any phone can also be expected to support a set of func- tions, or methods: picking up the receiver, dialing a number, ringing, hanging up, and so on. This Nickel Tour uses a fictional object-oriented syntax for teaching purposes. It’s similar to a simplified form of Java that doesn’t require formal data typing or other complications. That telephone object that you hold in your hand is the combination of all the properties that describe it and the methods that it can perform. In the physical world, your telephone was manufactured in a factory. In the object-oriented world, your telephone is conceptually manu- factured as follows: yourTelephone = new Telephone(); Now you have an object named yourTelephone that is an instance of the class Telephone. In object-oriented terms, you have just instantiated a Telephone object named yourTelephone. yourTelephone contains all the properties and methods that any new Telephone would have because it was manufactured in the Telephone “factory” (that is, instantiated from the Telephone class). In the physical world, you pick up your telephone’s receiver and dial a number with your fin- ger. In the object-oriented world, you tell your telephone to pick up its own receiver and then you tell your telephone to dial the number for you, conceptually, as follows: yourTelephone.OffHook(); yourTelephone.DialNumber(‘1-770-446-8866’); Your friend Stan Cox has a telephone, too, as follows: stansTelephone = new Telephone(); But Stan isn’t calling Productivity Enhancement as you are; he’s trying to find a hot date with a woman who shares his main interest in life, as the following example indicates: stansTelephone.OffHook(); stansTelephone.DialNumber(‘1-900-4CF-CHIX’); Clearly, your telephone and Stan’s telephone can do the same kinds of things because they are both objects of the Telephone class, but each telephone might do the same thing in a dif- ferent way (such as dial a different number) because each is a separate, distinct instance of a Telephone. Your instance of a Telephone is named yourTelephone, and Stan’s instance of a Telephone is named stansTelephone. Each instance is a complete, standalone copy of all the properties and methods that any Telephone has. Note 26546228 ch22.F 1/30/03 10:53 AM Page 457 458 Part IV ✦ ColdFusion MX Components, Web Services, and Flash Integration Not all telephones are exactly alike Stan’s telephone is similar to most other telephones, but his probably has a few functions that a public telephone doesn’t have, and his probably doesn’t have some of the functions of Larry Ellison’s telephone (such as Oracle-based speed dial). Stan was so enamored with his date that he has asked the factory to invent a Stan-specific telephone with a special speed-dial function, as the following code describes: class StanPhone extends Telephone { SpeedDial(theNumber) { this.OffHook(); if (theNumber == ‘1’) { this.DialNumber(‘1-900-4CF-CHIX’); } } } And Stan wants the factory to manufacture one of these phones for him, as follows: stansnewTelephone = new StanPhone(); Now, whenever Stan wants to talk with a beautiful, intelligent ColdFusion programmer of the female persuasion, all he must do is the following: stansnewTelephone.SpeedDial (‘1’); Stan’s very special telephone extends the capabilities of a normal telephone with an addi- tional method named SpeedDial(), which in turn makes use of the methods available to any telephone ( OffHook() and DialNumber()). Notice the prefix this used in the preceding code example to call the inherited methods OffHook() and DialNumber(). If you guessed that this refers to this instance, you’re right. Because the StanPhone class simply extends the Telephone class, all the methods available to the Telephone class are automatically a part of the StanPhone class and, as such, are available in all instances of the StanPhone class. Sometimes you don’t need a telephone at all The methods that we’ve discussed so far operate on a specific instance of an object. Dialing a number on stansnewTelephone, for example, just dials it on that one instance of a tele- phone. If stansnewTelephone didn’t exist, you couldn’t dial a number from it. These meth- ods are known as instance methods. Some methods don’t operate on a specific instance of an object, but instead operate with respect to the entire class of objects. If Stan called the telephone manufacturer and asked how many telephones had been manufactured to date, for example, the manufacturer may ask itself the following: telephonesManufacturedToDate = Telephone.GetCount(); The GetCount() function in this code queries the manufacturer’s database and totals the number of telephones manufactured in all production runs to the present date. These methods are known as class methods because they operate on the entire class of objects and not on just a single instance of an object. 26546228 ch22.F 1/30/03 10:53 AM Page 458 459 Chapter 22 ✦ Understanding ColdFusion MX Components So there you have the Nickel Tour of objects— just enough terminology and explanation so that you can make sense of a discussion of ColdFusion components and understand at least a little bit of the discussions comparing CFCs to true objects. If you want more — and you know that you do — learn Java. Your career is sure to thank you. Components are similar to objects Listing 22-2 encapsulates into a single component all the functionality related to a company. Every time that you need to do something to or get something from a company, you invoke one of the Company component’s functions and pass in the CompanyID used to identify the tar- get company; then your functions go out and manipulate that company’s data in the database. None of these functions do anything with data associated with the component itself; all these functions directly manipulate the database without any regard to the concept of an instance. In other words, these component functions are the equivalent of class methods in traditional object-oriented terms. To create component functions that are the equivalent of instance methods, an instance of the component needs data or properties directly associated with it, and these instance methods must work with the properties rather than directly with the database. If an instance of a com- ponent is created, it contains a scope named This, which is the rough equivalent of the this prefix that we mention in the section “Not all telephones are exactly alike,” a little earlier in this chapter, in that This refers in this case to This instance. (The difference in the capitaliza- tion of This is due to the difference in syntax between ColdFusion and Java, which I used in the Nickel Tour.) So suppose that, inside your component, you set a variable in the This scope, as follows: <cfset This.CompanyName = “Productivity Enhancement”> In this code, you create a property for This instance of the Company component. And suppose that you then create a component function named GetCompanyName() that simply returns that property, as follows: <cffunction name=”GetCompanyName” ReturnType=”String”> <cfreturn This.CompanyName> </cffunction> You’ve now given the caller what it wants directly from the properties of an instance of the component. In other words, GetCompanyName() is an instance method rather than a class method. Before you can set a component property, you must get the data from somewhere — typically from a database query — and this query requires processing overhead. So setting component properties becomes practical only if those properties are going to persist longer than a single component-function call — otherwise, you may just as well manipulate the database each time that a function is called. We get into the details of designing effective persistent components and instance methods in the section “Persistent components,” a little later in this chapter; then you build one step by step in Chapter 23. But for starters, we show you in the following sections how to create an instance of a component that persists longer than a single function call. 26546228 ch22.F 1/30/03 10:53 AM Page 459 460 Part IV ✦ ColdFusion MX Components, Web Services, and Flash Integration Invoking a Component Function If you invoke a component function by using the CFINVOKE tag, ColdFusion creates an instance of that component and calls the function named in the Method attribute. In essence, ColdFusion instantiates an object of the class of that component, but the name of that object is invisible to you. (It’s internally referenced by ColdFusion Server.) If you use CFINVOKE to call three of a component’s functions in a single ColdFusion template, as shown in Listing 22-3, ColdFusion Server creates three separate instances of that component to give you what you want, and that’s not very efficient. Listing 22-3: Repetitively instantiating a component <cfinvoke component=”Company” method=”GetCompany” returnvariable=”companyRecord1”> <cfinvokeargument name=”CompanyID” value=”8”> </cfinvoke> <cfinvoke component=”Company” method=”GetCompany” returnvariable=”companyRecord2”> <cfinvokeargument name=”CompanyID” value=”9”> </cfinvoke> <cfinvoke component=”Company” method=”GetCompany” returnvariable=”companyRecord3”> <cfinvokeargument name=”CompanyID” value=”10”> </cfinvoke> The correct way to call a component’s functions multiple times from a single template is to separately instantiate an object with a formal name and then call the functions of that one instance as you need them. Listing 22-4 shows this principle in action. Notice that the compo- nent attribute of the CFINVOKE tag references an instance of the component rather than the component itself. Listing 22-4: Instantiating a component and repetitively invoking its methods <cfobject name=”myCompany” component=”Company”> <cfinvoke component=”#myCompany#” method=”GetCompany” returnvariable=”companyRecord1”> 26546228 ch22.F 1/30/03 10:53 AM Page 460 461 Chapter 22 ✦ Understanding ColdFusion MX Components <cfinvokeargument name=”CompanyID” value=”8”> </cfinvoke> <cfinvoke component=”#myCompany#” method=”GetCompany” returnvariable=”companyRecord2”> <cfinvokeargument name=”CompanyID” value=”9”> </cfinvoke> <cfinvoke component=”#myCompany#” method=”GetCompany” returnvariable=”companyRecord3”> <cfinvokeargument name=”CompanyID” value=”10”> </cfinvoke> You can pass arguments to component functions by incorporating them directly into the CFINVOKE tag. This is the same technique shown in Chapter 17. You create a single instance of the Company component that persists for as long as the cur- rent page request lasts; then you simply call the functions of that one instance as many times as you need. After the current page request ends, ColdFusion automatically destroys the instance that you create. (In the following section, you learn how to make your component instances live longer.) Using the CFOBJECT tag isn’t the only way to instantiate an object. The CreateObject() function returns an object as well. The following three lines of code, for example, produce the same results: <cfobject name=”myCompany” component=”Company”> <cfset myCompany = CreateObject(“Component”, “Company”)> <cfscript>myCompany = CreateObject(“Component”, “Company”);</cfscript> Similarly, using CFINVOKE isn’t the only way to invoke a component function. After you create an instance of a component, you can call its methods by using simple dot notation. Listing 22-5, for example, returns the list of companies produced by the ListCompanies function to a variable named listOfCompanies. Listing 22-5: Invoking a component function by using dot notation <cfscript> myCompany = CreateObject(“Component”, “Company”); listOfCompanies = myCompany.ListCompanies(‘A’); </cfscript> <cfdump var=”#listOfCompanies#”> In fact, Listing 22-5 is probably the most popular way of working with component functions for ColdFusion developers who are versed in object-oriented languages, as the syntax is very close to the way that both Java and C++ instantiate objects and call their methods. Note 26546228 ch22.F 1/30/03 10:53 AM Page 461 462 Part IV ✦ ColdFusion MX Components, Web Services, and Flash Integration You can directly access component functions via forms and URLs, but the results are basi- cally worthless. Instead of defining a return value to pass from your function to the function call that invokes it, you must push displayable content directly out of the body of the func- tion, as shown in Listing 22-6. Listing 22-6: Using direct function output instead of a return value <cffunction name=”OutputTest” output=”yes”> <cfquery name=”companyRecs” datasource=”#Request.MainDSN#”> SELECT CompanyID, CompanyName, Address, City, State, ZipCode, Comments FROM Company ORDER BY CompanyName </cfquery> <cfoutput query=”companyRecs”> <p><b>#CompanyName#</b>:<br>#Comments#</p> </cfoutput> </cffunction> This kind of coding is nasty stuff, folks. Don’t do it. The real power of content-producing func- tions, whether they are local to a template or encapsulated within a component, comes from returning content contained in a complex variable of a specific data type and then merging the content with presentation code. Separating logic from presentation (and, by extension, data from presentation) should be your mantra. If you absolutely must create a function that directly outputs content, remove the ReturnType attribute from the CFFUNCTION tag and add Output=”Yes”. Never have both a return type and direct output in the same function. The Output attribute actually has the following three states: ✦ Output=”Yes” treats the entire function as if it were inside a CFOUTPUT tag pair. ✦ Output=”No” treats the entire function as if it were inside a CFSILENT tag pair. ✦ Eliminating the Output attribute entirely enables explicit CFOUTPUT tags inside the function to leak output to the caller. We haven’t been explicit about the Output attribute yet because this is a learning chapter, and we want to eliminate as much extraneous code as possible so that you can focus your concentration on specific topics. Chapter 23, on the other hand, is a doing chapter, where you start actually building these little monsters, so starting in that chapter, we explicitly specify Output=”No” for all component functions, which is a best practice. 26546228 ch22.F 1/30/03 10:53 AM Page 462 463 Chapter 22 ✦ Understanding ColdFusion MX Components Persistent Components In the preceding sections of this chapter, you learn how to create a named instance of a com- ponent, you find out about the basics of instance properties in a component’s This scope, and you learn the differences between class methods and instance methods. Now to put these theories into action! The instance of the component that you create in Listing 22-5 persists only as long as the page request and then ColdFusion Server automatically destroys it. If you want to work with a persistent component past a single page request, you simply must create it in a persistent scope that lives longer than one request, as shown in Listing 22-7. Listing 22-7: Persisting an instance of a component in a long-lived scope <cfscript> Session.myCompany = CreateObject(“Component”, “Company”); listOfCompanies = Session.myCompany.ListCompanies(‘A’); </cfscript> <cfdump var=”#listOfCompanies#”> Listing 22-7 is just Listing 22-5 modified to create the instance of the Company component in the Session scope rather than in the Variables (local) scope. Now this instance persists as long as the user’s session does, which means that its properties do, too. This means that you can execute one ColdFusion template that creates an instance of the Company component, go have a cup of coffee, execute a second ColdFusion template that invokes a function of that component, go place a bid on eBay, execute a third ColdFusion template that invokes another function of that component, and so on, until you pause longer than your session timeout permits and the instance is destroyed. This is why we refer to Company as a long-lived persistent component. Components can also be persisted in the Application scope as well. Just remember that all users of your application use the same instance of your component, so locking becomes even more critical and performance bottlenecks potentially become more of a concern if your component manipulates properties in its This scope. We bet that, right now, you’re thinking, “I’m clustering my application, which means that I don’t use Session variables anywhere, so I’m going to persist my component instance by serializing it with WDDX (see Chapter 30 for details) and storing it in the Client scope.” That’s a clever idea, but unfortunately, it doesn’t work. If you serialize a component instance, the properties in the This scope serialize just fine, but you lose all your functions, so on deserialization, all you get back are the properties. Why use a persistent component? Why use a persistent component? Good question! Why create an “object-wannabe” that car- ries its own data (properties) around with it? A few practical applications of persistent com- ponents do exist, but one in particular clearly stands out. As you may remember from Chapter 8, if an attribute must be present to effectively describe an entity, that attribute cannot contain a NULL value. You can never, therefore, insert a partial record into a database table. If one or more of these non- NULL values must be calculated from 26546228 ch22.F 1/30/03 10:53 AM Page 463 464 Part IV ✦ ColdFusion MX Components, Web Services, and Flash Integration currently unavailable values, or if the value is discovered or created late in some user task, you need a temporary staging area to store your partial data, and a persistent component’s properties fit the bill nicely for this purpose. So one good application for a long-lived persistent component is a wizard that collects data throughout a complicated process and then calls component functions that insert or update the component’s properties into the database after you collect sufficient data to form each entity completely. You begin to build a partial Company wizard in the next section, to see the basics of how a persistent component can be useful; then you complete the wizard in Chapter 23 to see how you’d deploy it as a complete solution. The elements of a persistent component The following list describes what you need to create a persistent component that makes use of its properties: ✦ A granular locking mechanism bound to the component. ✦ An Initialization() function that creates the component’s properties. ✦ A GetEntity() function that retrieves data from the database. ✦ A FlushEntityToDatabase() function that sends data to the database. The names of the preceding functions are only generalizations. You may name your functions anything you want. Some developers also create specific component functions to formally set and get specific properties or collections of properties. We discuss these “setters and getters” in the section “Using setters and getters,” a little later in this chapter. A granular locking mechanism bound to the component First, because your component persists in a shared memory scope (Session or Application), you need to pay attention to locking. As we mention in Chapter 12, locking an entire scope creates a bottleneck through which all requests to that scope’s variables must pass. To prevent such bottlenecks, we use named locks with persistent components. We use the CreateUUID() function to generate our lock name — which ensures that our lock name is unique from any other lock name — and we bind our lock name to the component itself by storing it in a component property, as follows: This.lockName = CreateUUID(); But where should we execute this line of code? We need our lock name to become available as soon as we create an instance of the component, but we must execute this code only once to prevent our lock name from changing, as we must refer to the lock name in calls to the component. Fortunately, an initialization area inside every component serves this purpose. Any code that you place between the CFCOMPONENT tag and the first CFFUNCTION tag executes only once if an instance of the component is created through either CFOBJECT or CreateObject() or through a direct call to an uninstantiated component from CFINVOKE. 26546228 ch22.F 1/30/03 10:53 AM Page 464 465 Chapter 22 ✦ Understanding ColdFusion MX Components So we place our lock-naming code in the component’s initialization area, as follows: <cfcomponent> <cfscript> This.lockName = CreateUUID(); </cfscript> <cffunction . . . > </cfcomponent> We explain why and where to use locks with persistent components in the section “Where to apply locking,” just a bit later in this chapter, but for now, we’re going to move on to the other parts that make up a persistent component. An initialization() function that creates the component’s properties After a persistent component is first instantiated, it should contain all the properties that it’s ever to have during its lifecycle. The values of these properties, of course, change as you add and modify data in the tasks that make use of the component, but they must start off with some value — typically an empty string or zero, depending on the property’s data type. In this wizard example, you initialize these properties by using an InitCompany() function, as follows: <cfcomponent> <cfscript> This.lockName = CreateUUID(); InitCompany(); </cfscript> <cffunction name=”InitCompany” returntype=”void”> <cfscript> This.companyID = 0; This.companyName = “”; This.address = “”; This.city = “”; This.state = “”; This.zipCode = “”; This.comments = “”; </cfscript> <cfreturn> </cffunction> <cffunction . . . > </cfcomponent> You’re going to come back after you complete the next section and expand this function, but for now, you should get the basic idea of how to initialize persistent component properties from this example. 26546228 ch22.F 1/30/03 10:53 AM Page 465 [...]... functions; all ManagerBonus() must do is return Bonus() multiplied by 1. 15, as follows: Listing 22-11 shows inheritance in action Notice how the properties and functions of both Emp and Manager are directly accessible from Manager 483 2 654 6228 ch22.F 484 1/30/03 10 :53 AM Page 484 Part IV ✦ ColdFusion MX Components, Web Services, and Flash Integration Listing 22-11: Accessing... Stan Cox’s telephone — Fooster — turns out to be scamming everyone Through creative trading contracts 2 654 6228 ch22.F 1/30/03 10 :53 AM Page 4 85 Chapter 22 ✦ Understanding ColdFusion MX Components with various “hot-talk” services and bundling service options with Fooster’s Model ADHCC (AutoDial Hot ColdFusion Chicks) Telephone, Fooster alleged nonexistent profits that made its stock price soar sky-high... component only: Standard Bonus, Fooster-style: #embezzlerServices.Bonus(“012-34 -56 78”)# empProperty: #embezzlerServices.empProperty# foostersOwnProperty: #embezzlerServices.foostersOwnProperty# 4 85 2 654 6228 ch22.F 486 1/30/03 10 :53 AM Page 486 Part IV ✦ ColdFusion MX Components, Web Services, and Flash Integration The result of executing Listing 22-13... you’ll add a WizardDeleted process, as shown in Figure 23 -5 489 2 754 6228 ch23.F 490 1/30/03 11 :56 AM Page 490 Part IV ✦ ColdFusion MX Components, Web Services, and Flash Integration Model Company Controller DeleteEmployee View EmployeeDeleted Employee Page1Ctrl EmployeeList Page2Ctrl Page3Ctrl Page4Ctrl Page1 Page2 Page3 Page4 WizardDeleted Figure 23 -5: The finished application flow The elements of an application... 471 2 654 6228 ch22.F 472 1/30/03 10 :53 AM Page 472 Part IV ✦ ColdFusion MX Components, Web Services, and Flash Integration } else { This.companyID = 0; This.companyName = “”; This.address = “”; This.city = “”; This.state = “”; This.zipCode = “”; This.comments = “”; This.isNewCompany = TRUE; } After you assign a value to a local variable named CompanyInitRec within a function, ColdFusion. .. This.zipCode> And you can call these getter functions as follows: #Session.myCompany.GetCity()#, #Session.myCompany.GetState()# 2 654 6228 ch22.F 1/30/03 10 :53 AM Page 4 75 Chapter 22 ✦ Understanding ColdFusion MX Components #Session.myCompany.GetZipCode()# Notice that you don’t need to lock your calls to the getter functions, because all locking is handled... name=”SetZipCode” returntype=”void” output=”No”> Because your locking... Understanding MVC architecture Working around component caveats Documenting components ✦ ✦ ✦ ✦ 2 754 6228 ch23.F 488 1/30/03 11 :56 AM Page 488 Part IV ✦ ColdFusion MX Components, Web Services, and Flash Integration After you’re finished with this chapter, we invite you to experiment with what you’ve built Modify it and see how ColdFusion reacts Add some validation and an exception-handling framework to see how your... output=”No” 2 654 6228 ch22.F 1/30/03 10 :53 AM Page 477 Chapter 22 ✦ Understanding ColdFusion MX Components roles=”ADMIN,CLERK”> DELETE Company WHERE CompanyID = #Arguments.CompanyID# By adding roles=”ADMIN,CLERK” to the DeleteCompany() function, ColdFusion. .. CompanyInitRec.city; This.state = CompanyInitRec.state; This.zipCode = CompanyInitRec.zipCode; This.comments = CompanyInitRec.comments; 2 654 6228 ch22.F 1/30/03 10 :53 AM Page 467 Chapter 22 ✦ Understanding ColdFusion MX Components But this method doesn’t serve you well at all, because it hard-codes CompanyID 10 into the initialization function Passing an argument to the initialization . results. 2 654 6228 ch22.F 1/30/03 10 :53 AM Page 456 457 Chapter 22 ✦ Understanding ColdFusion MX Components Get used to passing messages So things are a little different from earlier versions of ColdFusion, . all the properties and methods that any Telephone has. Note 2 654 6228 ch22.F 1/30/03 10 :53 AM Page 457 458 Part IV ✦ ColdFusion MX Components, Web Services, and Flash Integration Not all telephones. of objects and not on just a single instance of an object. 2 654 6228 ch22.F 1/30/03 10 :53 AM Page 458 459 Chapter 22 ✦ Understanding ColdFusion MX Components So there you have the Nickel Tour of objects—

Ngày đăng: 14/08/2014, 01:21

w