Mach II was RE: RE: cfc vs php rule of thumb

2003-08-26 Thread Mauricio Giraldo
>Do my Mach II pages help?
>http://www.corfield.org/index.php?fuseaction=machii.why
>http://www.corfield.org/index.php?fuseaction=machii.concepts

They certainly do. Thanks a lot

- mga
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm


Re: cfc vs php rule of thumb

2003-08-26 Thread Paul Hastings
> You can easily use the native Java resource bundle handling classes if you
> know a little java.  If you don't, Benoit Hediard wrote a couple UDFs to
do

never been able to get them to work via mx (probably too little java
know-how). i have my own udf--now cfc, its easy enough to read a properties
file & parse based on "=" as delimiter (key=value, key becomes part of some
structure which is loaded into some shared scope). just wished for something
native.

> similar things (probably based on the java classes).  I'm not sure exactly
> how to get them, but they are somewhere at www.benorama.com.  If you
> download his blogMX sample app, they will probably be included.

well he's a better man than me ;-) thanks i'll look.


~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


RE: cfc vs php rule of thumb

2003-08-26 Thread Barney Boisvert
Either put them in a superclass of your CFCs (which may or may not be
possible), or put a CFINCLUDE tag in your init() method that sets all the
variables.  You might be able to put it in the "constructor" (outside any
method body), but I'm not sure.

---
Barney Boisvert, Senior Development Engineer
AudienceCentral
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax   : 360.647.5351

www.audiencecentral.com


> -Original Message-
> From: Mauricio Giraldo [mailto:[EMAIL PROTECTED]
> Sent: None
> To: CF-Talk
> Subject: cfc vs php rule of thumb
>
>
> Hello
>
> When developing in PHP, it is common to have something like this
> in a class
> document:
>
> // start
> include 'my_config_file.php';
>
> class MyClass {
>   // properties and functions
> }
> // end
>
> Where my_config_file.php is a file that has constants and other shared
> variables. I am familiar with CFCs also but am not sure what would be the
> right way to go on this issue. It is good to have an external file with
> common variables, and sometimes people have them inside
> Application.cfm but
> you don't always want to have them there.
>
> Can anyone shed any light on this issue?
>
> Thanks
>
>
> - mga
>
> _
> MSN 8: Get 6 months for $9.95/month http://join.msn.com/?page=dept/dialup
>
>
> 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm


cfc vs php rule of thumb

2003-08-26 Thread Mauricio Giraldo
>
>  
>  
>  
>

I guess this would be the answer (did not know u could cfinclude right away). But the 
other posts raised some interesting questions: 

Didn't quite understand the INI suggestion (Raymond Camden)
Is it recommendable to put CFCs in the application scope? (Barney Boisvert) how will 
things work when using:
 
 

Thanks

Mauricio

~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm


Re: Mach II was RE: RE: cfc vs php rule of thumb

2003-08-26 Thread Sean A Corfield
On Monday, Aug 25, 2003, at 12:40 US/Pacific, Mauricio Giraldo wrote:

>> http://www.mach-ii.com/
>
> I've been clicking around the mach-ii site over the past days but 
> haven't understood it completely (yet). Downloading PDFs right now. 
> Are the UML diagrams made with gModeler? I suggest a question for the 
> Mach-II FAQ:
>
> What is Mach-II?

Do my Mach II pages help?
http://www.corfield.org/index.php?fuseaction=machii.why
http://www.corfield.org/index.php?fuseaction=machii.concepts

Sean A Corfield -- http://www.corfield.org/blog/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm


Re: cfc vs php rule of thumb

2003-08-26 Thread Paul Hastings
> know a little java.  If you don't, Benoit Hediard wrote a couple UDFs to
do
> similar things (probably based on the java classes).  I'm not sure exactly

noipe, same approach as me.


~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com


RE: cfc vs php rule of thumb

2003-08-26 Thread Barney Boisvert
You can easily use the native Java resource bundle handling classes if you
know a little java.  If you don't, Benoit Hediard wrote a couple UDFs to do
similar things (probably based on the java classes).  I'm not sure exactly
how to get them, but they are somewhere at www.benorama.com.  If you
download his blogMX sample app, they will probably be included.

HTH,
barneyb

---
Barney Boisvert, Senior Development Engineer
AudienceCentral
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax   : 360.647.5351

www.audiencecentral.com


> -Original Message-
> From: Paul Hastings [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 25, 2003 7:21 PM
> To: CF-Talk
> Subject: Re: cfc vs php rule of thumb
>
>
> > and simple to write and parse (using the getProfileSections and
> > getProfileString functions).  They are much less verbose than XML and
>
> they don't handle unicode, too bad as they would make provide pretty good
> substitutes for resource bundle functionality. cf really needs something
> like getResourceBundle().
>
>
> 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm


Mach II was RE: RE: cfc vs php rule of thumb

2003-08-26 Thread Mauricio Giraldo
>http://www.mach-ii.com/

I've been clicking around the mach-ii site over the past days but haven't understood 
it completely (yet). Downloading PDFs right now. Are the UML diagrams made with 
gModeler? I suggest a question for the Mach-II FAQ: 

What is Mach-II?

I've read a lot of blogs telling how great Mach-II is (event-based CFCs or something) 
but I have no idea yet what it really is. Maybe PDFs will help.

Thanks

- mga

~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com


Mach II was RE: RE: cfc vs php rule of thumb

2003-08-26 Thread Mauricio Giraldo
>http://www.mach-ii.com/

I've been clicking around the mach-ii site over the past days but haven't understood 
it completely (yet). Downloading PDFs right now. Are the UML diagrams made with 
gModeler? I suggest a question for the Mach-II FAQ: 

What is Mach-II?

I've read a lot of blogs telling how great Mach-II is (event-based CFCs or something) 
but I have no idea yet what it really is. Maybe PDFs will help.

Thanks

- mga

~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm


cfc vs php rule of thumb

2003-08-26 Thread Mauricio Giraldo
Hello

When developing in PHP, it is common to have something like this in a class
document:

// start
include 'my_config_file.php';

class MyClass {
  // properties and functions
}
// end

Where my_config_file.php is a file that has constants and other shared
variables. I am familiar with CFCs also but am not sure what would be the
right way to go on this issue. It is good to have an external file with
common variables, and sometimes people have them inside Application.cfm but
you don't always want to have them there.

Can anyone shed any light on this issue?

Thanks


- mga

_
MSN 8: Get 6 months for $9.95/month http://join.msn.com/?page=dept/dialup


~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


cfc vs php rule of thumb

2003-08-26 Thread Mauricio Giraldo
>
>  
>  
>  
>

I guess this would be the answer (did not know u could cfinclude right away). But the 
other posts raised some interesting questions: 

Didn't quite understand the INI suggestion (Raymond Camden)
Is it recommendable to put CFCs in the application scope? (Barney Boisvert) how will 
things work when using:
 
 

Thanks

Mauricio

~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


cfc vs php rule of thumb

2003-08-26 Thread Mauricio Giraldo
Hello

When developing in PHP, it is common to have something like this in a class
document:

// start
include 'my_config_file.php';

class MyClass {
  // properties and functions
}
// end

Where my_config_file.php is a file that has constants and other shared
variables. I am familiar with CFCs also but am not sure what would be the
right way to go on this issue. It is good to have an external file with
common variables, and sometimes people have them inside Application.cfm but
you don't always want to have them there.

Can anyone shed any light on this issue?

Thanks


- mga

_
MSN 8: Get 6 months for $9.95/month http://join.msn.com/?page=dept/dialup


~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm


Re: cfc vs php rule of thumb

2003-08-26 Thread Paul Hastings
> and simple to write and parse (using the getProfileSections and
> getProfileString functions).  They are much less verbose than XML and

they don't handle unicode, too bad as they would make provide pretty good
substitutes for resource bundle functionality. cf really needs something
like getResourceBundle().


~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


Re: cfc vs php rule of thumb

2003-08-26 Thread Christian Cantrell
On Monday, August 25, 2003, at 11:51 AM, Patricia G. L. Hall wrote:

> I've seen you talk about the ini way of doing things before and I 
> thought
> it was an interesteing way to carry on.  I'm pretty sure you've 
> mentioned
> ini on your blog, but have you ever blogged its use specifically?

I actually think INI files, or initialization files, are a great way to 
externalize simple application configuration.  They are somewhere 
between defining variables in your Application.cfm file, and creating a 
configuration file in XML.  For simple apps (or even complex apps that 
don't require a lot of configuration), they work great and are quick 
and simple to write and parse (using the getProfileSections and 
getProfileString functions).  They are much less verbose than XML and 
more human-readable.  Where you tend to run into trouble is when you 
try to create your own "namespaces" with dot notation or something as 
your files start to get complex.  If you don't need the relational 
nature of XML, however, and you don't mind other developers making fun 
of you for not using XML, INI files are often a good solution.

Christian

~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


RE: cfc vs php rule of thumb

2003-08-25 Thread Raymond Camden
Nope, but now I guess I have a reason to. :) Again, I think xml is a
better way of doing it, but I can certainly write something up if people
are interested.


===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email: [EMAIL PROTECTED]
Blog : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -Original Message-
> From: Patricia G. L. Hall [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 25, 2003 9:52 AM
> To: CF-Talk
> Subject: RE: cfc vs php rule of thumb
> 
> 
> I've seen you talk about the ini way of doing things before 
> and I thought it was an interesteing way to carry on.  I'm 
> pretty sure you've mentioned ini on your blog, but have you 
> ever blogged its use specifically?
> 
> -Patti
> 
> >> Didn't quite understand the INI suggestion (Raymond Camden)
> >
> > CF has the ability to read ini files, which are standard 
> (on Windows) 
> > file formats that look kinda like this
> >


~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm


RE: cfc vs php rule of thumb

2003-08-25 Thread Patricia G. L. Hall
I've seen you talk about the ini way of doing things before and I thought
it was an interesteing way to carry on.  I'm pretty sure you've mentioned
ini on your blog, but have you ever blogged its use specifically?

-Patti

>> Didn't quite understand the INI suggestion (Raymond Camden)
>
> CF has the ability to read ini files, which are standard (on Windows)
> file formats that look kinda like this
>
> [sectionA]
> settingOne=foo
> settingTwo=goo
>
> [sectionB]
> Etc
>
> XML files are probably preferable, but ini files are easy enough to
> read, and again, easy to use in CF. No need to read/parse the file, just
> tell CF to grab setting X from section Foo in file X.
>
>> Is it recommendable to put CFCs in the application scope?
>> (Barney Boisvert) how will things work when using: > application.myCFC = createObject(...) />
>> 
>
> In general, I'd put the CFCs in cache just so you don't have to
> constantly recreate them everytime you need to use them. Once in the
> application scope, they don't act any different from any other
> application scope var.
>
> 
> ===
> Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
> (www.mindseye.com)
> Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)
>
> Email: [EMAIL PROTECTED]
> Blog : www.camdenfamily.com/morpheus/blog
> Yahoo IM : morpheus
>
> "My ally is the Force, and a powerful ally it is." - Yoda
>
>
> 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com


RE: cfc vs php rule of thumb

2003-08-25 Thread Raymond Camden
> Didn't quite understand the INI suggestion (Raymond Camden)

CF has the ability to read ini files, which are standard (on Windows)
file formats that look kinda like this

[sectionA]
settingOne=foo
settingTwo=goo

[sectionB]
Etc

XML files are probably preferable, but ini files are easy enough to
read, and again, easy to use in CF. No need to read/parse the file, just
tell CF to grab setting X from section Foo in file X.

> Is it recommendable to put CFCs in the application scope? 
> (Barney Boisvert) how will things work when using:  application.myCFC = createObject(...) /> 
>  

In general, I'd put the CFCs in cache just so you don't have to
constantly recreate them everytime you need to use them. Once in the
application scope, they don't act any different from any other
application scope var.


===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email: [EMAIL PROTECTED]
Blog : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 


~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


Mach II was RE: RE: cfc vs php rule of thumb

2003-08-25 Thread Mauricio Giraldo
>http://www.mach-ii.com/

I've been clicking around the mach-ii site over the past days but haven't understood 
it completely (yet). Downloading PDFs right now. Are the UML diagrams made with 
gModeler? I suggest a question for the Mach-II FAQ: 

What is Mach-II?

I've read a lot of blogs telling how great Mach-II is (event-based CFCs or something) 
but I have no idea yet what it really is. Maybe PDFs will help.

Thanks

- mga
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


cfc vs php rule of thumb

2003-08-25 Thread Mauricio Giraldo
>
>  
>  
>  
>

I guess this would be the answer (did not know u could cfinclude right away). But the 
other posts raised some interesting questions: 

Didn't quite understand the INI suggestion (Raymond Camden)
Is it recommendable to put CFCs in the application scope? (Barney Boisvert) how will 
things work when using:
 
 

Thanks

Mauricio
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com


Mach II was RE: RE: cfc vs php rule of thumb

2003-08-25 Thread Mike Brunt
Mauricio, I suggest you take a look at Mach II at.

http://www.mach-ii.com/

There is a .pdf file there that explains Mach II well also the Mach II infrastructure 
and some sample code/apps.

Kind Regards - Mike Brunt

Original Message ---
There are a couple of different answers to this question. What follows
are just a few ideas, and may not always work best depending on your
situation.

1) One way to have a CFC read in 'config' information is to simply
define them as probably always did, application variables, and read them
from the CFC. Ie, have the cfc use Application.DSN for queries. This was
problematic before 6.1 though if the CFC itself was cached. Also, in
general, a CFC should not directly touch Application variables outside
the CFC. If you ever rename the Application variables, you would have to
update your CFCs to correct them. In general, I try to make my CFCs
never use anything 'on the outside'.

2) Hard code the values in the CFC, or  them. Your CFC can
very easily either do



or



Another option, and one I use on my blog, is to use an ini file.

3) Why not make a CFC that represents your application, and stores the
values itself. Ie, an "Application" CFC. One style I've used in the past
is to have one CFC responsible for my application settings. So I could
ping it to get the app DSN, root path, etc. These values would be gotten
at startup and cached in the CFCs that used them.

This is just a few ideas, but I hope it helps.


===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email: [EMAIL PROTECTED]
Blog : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -Original Message-
> From: Mauricio Giraldo [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 25, 2003 11:52 AM
> To: CF-Talk
> Subject: cfc vs php rule of thumb
> 
> 
> Hello
> 
> When developing in PHP, it is common to have something like 
> this in a class
> document:
> 
> // start
> include 'my_config_file.php';
> 
> class MyClass {
>   // properties and functions
> }
> // end
> 
> Where my_config_file.php is a file that has constants and 
> other shared variables. I am familiar with CFCs also but am 
> not sure what would be the right way to go on this issue. It 
> is good to have an external file with common variables, and 
> sometimes people have them inside Application.cfm but you 
> don't always want to have them there.
> 
> Can anyone shed any light on this issue?
> 
> Thanks
> 



~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


RE: cfc vs php rule of thumb

2003-08-25 Thread Barney Boisvert
Related to Ray's #3, if the number of configuration items is reasonably
small, you can pass them into the CFC's init() method, if you use one, and
then cache it in the CFC's instance variables.  That's how I usually do
DSNs:






---
Barney Boisvert, Senior Development Engineer
AudienceCentral
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax   : 360.647.5351

www.audiencecentral.com


> -Original Message-
> From: Raymond Camden [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 25, 2003 10:59 AM
> To: CF-Talk
> Subject: RE: cfc vs php rule of thumb
>
>
> There are a couple of different answers to this question. What follows
> are just a few ideas, and may not always work best depending on your
> situation.
>
> 1) One way to have a CFC read in 'config' information is to simply
> define them as probably always did, application variables, and read them
> from the CFC. Ie, have the cfc use Application.DSN for queries. This was
> problematic before 6.1 though if the CFC itself was cached. Also, in
> general, a CFC should not directly touch Application variables outside
> the CFC. If you ever rename the Application variables, you would have to
> update your CFCs to correct them. In general, I try to make my CFCs
> never use anything 'on the outside'.
>
> 2) Hard code the values in the CFC, or  them. Your CFC can
> very easily either do
>
> 
>
> or
>
> 
>
> Another option, and one I use on my blog, is to use an ini file.
>
> 3) Why not make a CFC that represents your application, and stores the
> values itself. Ie, an "Application" CFC. One style I've used in the past
> is to have one CFC responsible for my application settings. So I could
> ping it to get the app DSN, root path, etc. These values would be gotten
> at startup and cached in the CFCs that used them.
>
> This is just a few ideas, but I hope it helps.
>
> 
> ===
> Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
> (www.mindseye.com)
> Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)
>
> Email: [EMAIL PROTECTED]
> Blog : www.camdenfamily.com/morpheus/blog
> Yahoo IM : morpheus
>
> "My ally is the Force, and a powerful ally it is." - Yoda
>
> > -Original Message-
> > From: Mauricio Giraldo [mailto:[EMAIL PROTECTED]
> > Sent: Monday, August 25, 2003 11:52 AM
> > To: CF-Talk
> > Subject: cfc vs php rule of thumb
> >
> >
> > Hello
> >
> > When developing in PHP, it is common to have something like
> > this in a class
> > document:
> >
> > // start
> > include 'my_config_file.php';
> >
> > class MyClass {
> >   // properties and functions
> > }
> > // end
> >
> > Where my_config_file.php is a file that has constants and
> > other shared variables. I am familiar with CFCs also but am
> > not sure what would be the right way to go on this issue. It
> > is good to have an external file with common variables, and
> > sometimes people have them inside Application.cfm but you
> > don't always want to have them there.
> >
> > Can anyone shed any light on this issue?
> >
> > Thanks
> >
>
>
> 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm


Re: cfc vs php rule of thumb

2003-08-25 Thread Critz
oi Mauricio!!


  
  
  


?


-- 
Currently Playing: Jimmy Buffett - Son of a Son of a Sailor


Monday, August 25, 2003, 1:52:20 PM, you wrote:

MG> Hello

MG> When developing in PHP, it is common to have something like this in a class
MG> document:

MG> // start
MG> include 'my_config_file.php';

MG> class MyClass {
MG>   // properties and functions
MG> }
MG> // end

MG> Where my_config_file.php is a file that has constants and other shared
MG> variables. I am familiar with CFCs also but am not sure what would be the
MG> right way to go on this issue. It is good to have an external file with
MG> common variables, and sometimes people have them inside Application.cfm but
MG> you don't always want to have them there.

MG> Can anyone shed any light on this issue?

MG> Thanks


MG> - mga

MG> _
MG> MSN 8: Get 6 months for $9.95/month http://join.msn.com/?page=dept/dialup

MG> 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


RE: cfc vs php rule of thumb

2003-08-25 Thread Raymond Camden
There are a couple of different answers to this question. What follows
are just a few ideas, and may not always work best depending on your
situation.

1) One way to have a CFC read in 'config' information is to simply
define them as probably always did, application variables, and read them
from the CFC. Ie, have the cfc use Application.DSN for queries. This was
problematic before 6.1 though if the CFC itself was cached. Also, in
general, a CFC should not directly touch Application variables outside
the CFC. If you ever rename the Application variables, you would have to
update your CFCs to correct them. In general, I try to make my CFCs
never use anything 'on the outside'.

2) Hard code the values in the CFC, or  them. Your CFC can
very easily either do



or



Another option, and one I use on my blog, is to use an ini file.

3) Why not make a CFC that represents your application, and stores the
values itself. Ie, an "Application" CFC. One style I've used in the past
is to have one CFC responsible for my application settings. So I could
ping it to get the app DSN, root path, etc. These values would be gotten
at startup and cached in the CFCs that used them.

This is just a few ideas, but I hope it helps.


===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email: [EMAIL PROTECTED]
Blog : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -Original Message-
> From: Mauricio Giraldo [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 25, 2003 11:52 AM
> To: CF-Talk
> Subject: cfc vs php rule of thumb
> 
> 
> Hello
> 
> When developing in PHP, it is common to have something like 
> this in a class
> document:
> 
> // start
> include 'my_config_file.php';
> 
> class MyClass {
>   // properties and functions
> }
> // end
> 
> Where my_config_file.php is a file that has constants and 
> other shared variables. I am familiar with CFCs also but am 
> not sure what would be the right way to go on this issue. It 
> is good to have an external file with common variables, and 
> sometimes people have them inside Application.cfm but you 
> don't always want to have them there.
> 
> Can anyone shed any light on this issue?
> 
> Thanks
> 


~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com


cfc vs php rule of thumb

2003-08-25 Thread Mauricio Giraldo
Hello

When developing in PHP, it is common to have something like this in a class
document:

// start
include 'my_config_file.php';

class MyClass {
  // properties and functions
}
// end

Where my_config_file.php is a file that has constants and other shared
variables. I am familiar with CFCs also but am not sure what would be the
right way to go on this issue. It is good to have an external file with
common variables, and sometimes people have them inside Application.cfm but
you don't always want to have them there.

Can anyone shed any light on this issue?

Thanks


- mga

_
MSN 8: Get 6 months for $9.95/month http://join.msn.com/?page=dept/dialup

~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm