Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Don Vaillancourt #1
CFComponent extends confusion
Has any one figured out the proper behaviour of the EXTENDS attribute to
CFCOMPONENT. I haven't been able to find out how this attribute is
supposed to work.
I have written components that extend other components, that's simple
enough.
We did a test to see how CFMX6.1 finds components when using the extend
attribute and although what we've done works, we don't know why.
For example we created the following component /folder_a/test.cfc which
extends a component in /folder_b/base_test.cfc.
The EXTENDS attribute of test.cfc contains "folder_b.base_test.cfc".
We then wrote a script /folder_a/test.cfm that instantiates this
component. And wonderfully, it works.
My question is why?
How does CFMX6.1 know to find the component in /folder_b/base_test.cfc.
Our setup doesn't have a mapping that points to the root of folder_a or
folder_b.
Anyone have any clue?
Thank You
--
Don Vaillancourt
Director of Software Development
WEB IMPACT INC.
phone: 416-815-2000 ext. 245
fax: 416-815-2001
email: [email]donv@web-impact.com[/email] <mailto:donv@webimpact.com>
web: [url]http://www.web-impact.com[/url]
address: [url]http://www.mapquest.ca[/url]
<http://www.mapquest.com/maps/map.adp?country=CA&addtohistory=&formtype=address& searchtype=address&cat=&address=99%20Atlantic%20Av e&city=Toronto&state=ON&zipcode=M6K%203J8>
Web Impact Inc. <http://www.web-impact.com>
This email message is intended only for the addressee(s) and contains
information that may be confidential and/or copyright.
If you are not the intended recipient please notify the sender by reply
email and immediately delete this email.
Use, disclosure or reproduction of this email by anyone other than the
intended recipient(s) is strictly prohibited. No representation is made
that this email or any attachments are free of viruses. Virus scanning
is recommended and is the responsibility of the recipient.
Don Vaillancourt Guest
-
How to extends a datagrid
Hi, I want to write my own datagrid. I defined it as: import mx.controls.DataGrid; class MyDataGrid extends DataGrid { } -
CFC extends
I have an application which uses about 7 CFC's that takes care of all my business logic. However they do not relate to each and i would like to... -
class extends TextFields
I want to create a class that extends TextField, but there is no way (that I can see) to impliment this. I can't set the AS2.0 class the way I can... -
import and extends issue
I have a class that I declared in a file: Classes/charts/BaseChart.as as class charts.BaseChart { ... I then have a sub-class in file:... -
[PHP] PHP class and extends
You can do one of 2 things. 1. You can comment out the ExecuteQuery Function in the child class. 2. When you call the function in the child... -
Stressed_Simon #2
Re: CFComponent extends confusion
CFCs are always referenced from the route. You can get away with relationally referencing them on occasion but can lead to problems so it is best avoided.
Stressed_Simon Guest
-
Don Vaillancourt #3
Re: CFComponent extends confusion
That's my question. What is the root?
If you read my previous email, you'll noticed that there is no hint of a
root. All mappings that were pointing to the root of my website which
could be c:\inetpub\wwwroot were changed to point to somewhere else and
still the example worked.
Stressed_Simon wrote:--> CFCs are always referenced from the route. You can get away with relationally referencing them on occasion but can lead to problems so it is best avoided.
Don Vaillancourt
Director of Software Development
WEB IMPACT INC.
phone: 416-815-2000 ext. 245
fax: 416-815-2001
email: [email]donv@web-impact.com[/email] <mailto:donv@webimpact.com>
web: [url]http://www.web-impact.com[/url]
address: [url]http://www.mapquest.ca[/url]
<http://www.mapquest.com/maps/map.adp?country=CA&addtohistory=&formtype=address& searchtype=address&cat=&address=99%20Atlantic%20Av e&city=Toronto&state=ON&zipcode=M6K%203J8>
Web Impact Inc. <http://www.web-impact.com>
This email message is intended only for the addressee(s) and contains
information that may be confidential and/or copyright.
If you are not the intended recipient please notify the sender by reply
email and immediately delete this email.
Use, disclosure or reproduction of this email by anyone other than the
intended recipient(s) is strictly prohibited. No representation is made
that this email or any attachments are free of viruses. Virus scanning
is recommended and is the responsibility of the recipient.
Don Vaillancourt Guest
-
Don Vaillancourt #4
Re: CFComponent extends confusion
Here is a URL that a colleage of mine found:
A couple of the Macromedia guys posted comments, but the use of EXTENDS
is still extremely vague.
[url]http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/buildi12.htm[/url]
Don Vaillancourt wrote:--> Has any one figured out the proper behaviour of the EXTENDS attribute to
> CFCOMPONENT. I haven't been able to find out how this attribute is
> supposed to work.
>
> I have written components that extend other components, that's simple
> enough.
>
> We did a test to see how CFMX6.1 finds components when using the extend
> attribute and although what we've done works, we don't know why.
>
> For example we created the following component /folder_a/test.cfc which
> extends a component in /folder_b/base_test.cfc.
>
> The EXTENDS attribute of test.cfc contains "folder_b.base_test.cfc".
>
> We then wrote a script /folder_a/test.cfm that instantiates this
> component. And wonderfully, it works.
>
> My question is why?
>
> How does CFMX6.1 know to find the component in /folder_b/base_test.cfc.
>
> Our setup doesn't have a mapping that points to the root of folder_a or
> folder_b.
>
> Anyone have any clue?
>
> Thank You
>
>
Don Vaillancourt
Director of Software Development
WEB IMPACT INC.
phone: 416-815-2000 ext. 245
fax: 416-815-2001
email: [email]donv@web-impact.com[/email] <mailto:donv@webimpact.com>
web: [url]http://www.web-impact.com[/url]
address: [url]http://www.mapquest.ca[/url]
<http://www.mapquest.com/maps/map.adp?country=CA&addtohistory=&formtype=address& searchtype=address&cat=&address=99%20Atlantic%20Av e&city=Toronto&state=ON&zipcode=M6K%203J8>
Web Impact Inc. <http://www.web-impact.com>
This email message is intended only for the addressee(s) and contains
information that may be confidential and/or copyright.
If you are not the intended recipient please notify the sender by reply
email and immediately delete this email.
Use, disclosure or reproduction of this email by anyone other than the
intended recipient(s) is strictly prohibited. No representation is made
that this email or any attachments are free of viruses. Virus scanning
is recommended and is the responsibility of the recipient.
Don Vaillancourt Guest
-
mpwoodward *TMM* #5
Re: CFComponent extends confusion
On 2005-06-09 10:57:14 -0500, Don Vaillancourt <donv@webimpact.com> said:
A few comments--first, the order in which CF looks for components in> Here is a URL that a colleage of mine found:
>
> A couple of the Macromedia guys posted comments, but the use of EXTENDS
> is still extremely vague.
>
> [url]http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/buildi12.htm[/url]
that link above is actually pretty helpful for the discussion. Unless
I'm misunderstanding your question is what the "root" of the site is,
so I'll focus on that. Just bear in mind that list in the link
outlines where CF looks.
The "root" would be the docroot of the web server (e.g.
C:\Inetpub\wwroot by default on Windows). So let's say you have the
following directory structure:
mydocroot
mycfcs
cfcgroup1
Now let's say IN the mycfcs directory you have a CFC called base.cfc.
To instantiate that component you would do this:
CreateObject("component", "mycfcs.base");
CF goes to inside the mydocroot directory, finds mycfcs, then in there
finds base.cfc and knows that's the correct component.
Next let's say in cfcgroup1 you have a component child.cfc that extends
base. That would be done this way:
<cfcomponent displayname="Child" extends="mycfcs.base">
<!--- etc. --->
Note that you don't need the ".cfc" at the end of your extends
statement. So what CF does with the extends statement is starts at
your web server's docroot (i.e. inside the mydocroot directory) and
just traverses down the dot notation (aka package notation) until it
finds the CFC specified.
Let me know if that doesn't make sense or didn't address your question.
Matt
--
Matt Woodward
[email]mpwoodward@gmail.com[/email]
Team Macromedia - ColdFusion
mpwoodward *TMM* Guest
-
Don Vaillancourt #6
Re: CFComponent extends confusion
You pretty much confirmed what I had figured out.
But in regards to the root. When I started working with ColdFusion on
version 4.5 the manual stated that ColdFusion had no knowledge of a
webroot. CF was oblivious to C:\InetPub\wwwroot\ which is why I have
this problem understanding what root is.
But from what you've said and what's on that link, CFMX knows the
webroot of the current cfm module it is currently executing.
Is that correct?
mpwoodward *TMM* wrote:--> On 2005-06-09 10:57:14 -0500, Don Vaillancourt <donv@webimpact.com> said:
>>>> Here is a URL that a colleage of mine found:
>>
>> A couple of the Macromedia guys posted comments, but the use of
>> EXTENDS is still extremely vague.
>>
>> [url]http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/buildi12.htm[/url]
>
> A few comments--first, the order in which CF looks for components in
> that link above is actually pretty helpful for the discussion. Unless
> I'm misunderstanding your question is what the "root" of the site is, so
> I'll focus on that. Just bear in mind that list in the link outlines
> where CF looks.
>
> The "root" would be the docroot of the web server (e.g.
> C:\Inetpub\wwroot by default on Windows). So let's say you have the
> following directory structure:
>
> mydocroot
> mycfcs
> cfcgroup1
>
> Now let's say IN the mycfcs directory you have a CFC called base.cfc.
> To instantiate that component you would do this:
> CreateObject("component", "mycfcs.base");
>
> CF goes to inside the mydocroot directory, finds mycfcs, then in there
> finds base.cfc and knows that's the correct component.
>
> Next let's say in cfcgroup1 you have a component child.cfc that extends
> base. That would be done this way:
> <cfcomponent displayname="Child" extends="mycfcs.base">
> <!--- etc. --->
>
> Note that you don't need the ".cfc" at the end of your extends
> statement. So what CF does with the extends statement is starts at your
> web server's docroot (i.e. inside the mydocroot directory) and just
> traverses down the dot notation (aka package notation) until it finds
> the CFC specified.
>
> Let me know if that doesn't make sense or didn't address your question.
>
> Matt
Don Vaillancourt
Director of Software Development
WEB IMPACT INC.
phone: 416-815-2000 ext. 245
fax: 416-815-2001
email: [email]donv@web-impact.com[/email] <mailto:donv@webimpact.com>
web: [url]http://www.web-impact.com[/url]
address: [url]http://www.mapquest.ca[/url]
<http://www.mapquest.com/maps/map.adp?country=CA&addtohistory=&formtype=address& searchtype=address&cat=&address=99%20Atlantic%20Av e&city=Toronto&state=ON&zipcode=M6K%203J8>
Web Impact Inc. <http://www.web-impact.com>
This email message is intended only for the addressee(s) and contains
information that may be confidential and/or copyright.
If you are not the intended recipient please notify the sender by reply
email and immediately delete this email.
Use, disclosure or reproduction of this email by anyone other than the
intended recipient(s) is strictly prohibited. No representation is made
that this email or any attachments are free of viruses. Virus scanning
is recommended and is the responsibility of the recipient.
Don Vaillancourt Guest



Reply With Quote

