EasyCFM.COM ColdFusion Forums / ColdFusion Applications / Some Basic Doubts. Please Help....

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Some Basic Doubts. Please Help....

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

anujgarg
03-23-2007 @ 11:26 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 11
Joined: Sep 2006

Hi

Plz give the answers for following:

1) Can we have multiple Applications.cfm file for a server to handle a single website?? What is the reason??

2) Can a PHP page be supported by CFML?
3) Difference between CFC and CFInclude
4) How to handle sessions in CFML// Is it through structures?? How?? I have no idea.
5) Advantage of <CFStoredProc> Over <CFQuery>
6)Difference b/w <CF_func> and <cfincludetemplate="func.cfm">

TIA

Anuj



Webmaster
03-23-2007 @ 4:23 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

1) Can we have multiple Applications.cfm file for a server to handle a single website?? What is the reason??

You can cetainly have multiple files... but not in the same folder Smile

so lets say you have an application.cfm at the root that defines things like dsn name, etc. the nyou have a members folder that has to be password protected.. you can do this:

<cfinclude template="../application.cfm" /> <!-- include the original settings --->

<cfparam name="session.memberid" default="0" />

<!--- since this is the members only area... make login required --->
<cfif session.memberid eq 0>
  <cflocation url="/members/login.cfm" />
</cfif>

make sense?

2) Can a PHP page be supported by CFML?
  No, PHP has its own engine. You would have to recode it in CFML.

3) Difference between CFC and CFInclude
  CFC's are used mostly to create objects and business logic. So lets say you have a query you use a lot... or some business logic that us sused through the application but based on criteria it will be different... you would use a CFC. CFIncludes is mostly to include files and/or logic that you want to separate. Of course this is a very very explanation.. what you can achieve with a CFC is a lot more complex (things like OOP [Object Oriented Programming] and much more.. but at a glance that is a brief explanation)

4) How to handle sessions in CFML// Is it through structures?? How?? I have no idea.
You would define sessions to be enabled in the <cfapplication> and then use <cfset session.[name] = />

5) Advantage of <CFStoredProc> Over <CFQuery>
cfquery is most cases is an inline query to the database... so you do code on your page and then send the request to the database. StoredProc will execute a stored procedure in the database (so the code is in the database; and not in your code) so StoredProcs are faster; but harder to debug when you have problems.

6)Difference b/w <CF_func> and <cfincludetemplate="func.cfm">
   When doign a custom tag call "<CF_" you will not have access to certain variable scopes (i.e. Variables.) but will will in fact have access to "Attributes." which are passed in via the <CF_name var="" /> method. Also you can nest custom tags to have parent tags, etc. when you include a template it will process is if the template was in the same file.. so it has access to the variables being set in the calling page.

Pablo Varando
Senior Application Architect
EasyCFM.COM, LLC.

904.483.1457 \\ mobile
webmaster@easycfm.com \\email

anujgarg
03-24-2007 @ 4:54 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 11
Joined: Sep 2006

thanks a lot for replying


Website Designed and Developed by Pablo Varando.