Where is the best place to put cfqueries?

Where is the best place to put cfqueries, in the <head> </head> or before the html tag? Thanks

So before the doctype tag? Thanks
I just doesn't really matter.  the doctype, head, body, etc only matter to the browser; the CF tags only matter to CF.  The browser doesn't see the CFML, and CF doesn't care about the mark-up one bit: it just ignores it.
The best place - as I said - is not in the same file at all.  But if you insist on slapping your business logic in with your display logic, then the only consideration is that you need to set your variables before you use them.  Other than that: it simply doesn't matter.
One consideration you might make is - even if it's all thrown into the same one file - at least separate the file itself into sections: have all your CFML code that gets your data at the top, and try to limit the CFML you have mixed in with the mark-up, eg: limit it to stuff like loops and conditionals.
But, seriously, separate your concerns.  Dan's pretty much just wrong when he said it's over-engineering. It's just sloppy to not to write tidy, well-maintained, well-organised code.
Adam

Similar Messages

  • Where is the best place to put custom functions?

    Hi,
    I have a composition which has a number of symbols. I have to call some custom methods externally and was wondering where is the best place to put the custom methods?
    I have seen posts that I should put the code in the CompositionReady event of the stage but I would like to put it a bit closer to the symbol.
    Is this the best place?
    Sham.

    Here is a case:
    It's a good idea if you well understand global and local variables.
    About complete event, you are right.

  • Where is the best place to put programs to start on X/Openbox startup?

    Hi,
    There are several places to put programs to startup when you start X or a WM.  I'm using Openbox and presently have placed these into my .xinitrc file, but I'm not sure this really the best place.  Openbox has a autostart file, which sorta looks like a better bet.
    Any suggestions would be great.
    Thanks,
    Jon

    Hadn't heard of consolekit; it's not clear to me from looking at their website what it's supposed to be offering? Maybe after it matures more, the documentation will improve, and all will become clear.
    When I used Openbox, I just launched everything such as conky from the Openbox autostart file. I guess if you had a weird set up such as some of your Openbox configs sitting on unmounted partitions, their mount commands would go in .xinitrc, otherwise autostart.sh seems better.
    Just IMO of course, do what you want on your own machine :-)
    Last edited by /dev/zero (2011-10-27 21:04:37)

  • Where is the best place to put music for itunes

    I have just downloaded Itunes
    I have a lot of music I want to add to the Itunes Program
    Where do I store the music I have in the Windows 7 there is a folder called music
    do I place all the folders into this (Music Folder)
    and then have Itunes find the music folder and add them into the program
    Is the best way to do it.
    Over time I will add more songs do I just keep placing them into the music folder and have Itunes fiund the new songs and add?
    I need your assistance
    THanks
    Mike

    iTunes will not find files, you need to add them to your library.
    launch iTunes, go preferences > advanced and verify the copy files ... when adding and keep ... organized options are checkmarked.
    next, look inside the iTunes folder for a subfolder called automatically add to iTunes. drop your music files in there. when iTunes has finished adding the files to your library, you may delete the original files.

  • The best place to put the global parameter

    hello:
    i am now studying the petstore1.3,and find that the global parameters are kept in the servlet context,i wonder if it is a good solution.in my project,i seldom use the servlet context,session context etc,i feel more like to put the global parameter in a singleton that is loaded when the app is started. i don't know where is the best place to put the global parameter,servlet context or singleton?

    thanks for your answer.
    1 do your mean that the singleton can be shared among the different "war"
    packages if both of them are within the same jvm?if yes,must they be in the
    same "ear" package?
    2 if my app is deployed in the weblogic cluster environment,which one can be
    shared? singleton or servlet context?

  • I need an Apple SuperDrive 8X Part No. 661-4279 for my MacBook Pro.  Where is the best place to order one?

    I need an Apple SuperDrive 8X Part No. 661-4279 for my MacBook Pro.  Where is the best place to order one?

    Some sites to check out.
    http://www.powerbookmedic.com/Apple-SuperDrive-DVD-Burner-Drive-8x---Macbook-Pro -p-16916.html
    http://www.macpartsonline.com/661-4279-superdrive-8x-double-layer-pata-15inch-2- 2-2-4-2-6ghz-macbook-pro-a1226.html
    http://www.dvwarehouse.com/661-4279-DVD-R/CD-RW-SuperDrive-8x-Dual-Layer-PATA-fo r-MacBook--MacBook-Pro---NEW-p-37374.html
    http://www.welovemacs.com/6614091r.html

  • Where's the Best Place....

    Hello once again,
    I have yet to purchase my MBP, and I am wondering from all of your experiences, where is the best place to buy a 1gig 3rd party RAM. Paying all that money for Apple's RAM isn't that way I want to go, but if there's no recommended 3rd party companies, I may need to cough over the bucks...
    thanks,

    Fair enough. I wasn't actually suggesting buying from Crucial.The best source for the 1gb Crucial was Newegg.com at $150 - but this is also for a chip that Apple are supplying as original ram so it's not a bad price. I didn't know Crucial sold Samsung - seems a bit odd as they are owned by Micron who also supply Apple as OEM. Business makes for strange bedfellows:)
    OWC sell their own branded ram for $112 or so and Samsung M470T295CZ3-CE6 (as also supplied by Apple) for $170. What I was saying was that this Samsung chip,
    http://eshop.macsales.com/item/Samsung/53SDR2SAM1GB/
    can be found for as little as $120 - so OWC are a tad expensive for this particular chip if that is the one you were thinking of buying.
    It sounds like you're going for the OWC own brand, so I can't recommend a cheaper source for that and they know a thing or two about ,macs so there's no reason to not trust their judgement.
    Best of luck
    Cheers.

  • Where is the best place for suggestiong requesting features?

    Where is the best place for suggesting/requesting features?
    If something like this already exists, please let me know.
    I often wish when I select a word to right click and choose dictionary to to find out the meaning of the word. Currently I have to copy, go to a dictionary web page, paste and search. And I spent a lot of time for that. I'm not that technically oriented to suggest how this can be achieved but just as an idea, may be Mozilla can partner with dictionary web sites by making a plug ins or include a dictionary with Firefox itself

    I am sure there are Extensions that do this.
    DictionarySearch - https://addons.mozilla.org/en-US/firefox/addon/68/
    Add-on search for Dictionary - https://addons.mozilla.org/en-US/firefox/search/?q=dictionary&cat=all&lver=any&pid=1&sort=&pp=20&lup=&advanced=
    Feedback - http://hendrix.mozilla.org/

  • Where's the best place to store email templates?

    Hi all;
    In a web app I store all my email templates in a files folder in the web app. Can't do that with a worker in a cloud service - no files. So where's the best place to store them? In a BLOB? And if so, is there a way to have files in my project get automatically
    written to BLOB entries when I publish?
    thanks - dave
    What we did for the last 6 months -
    Made the world's coolest reporting & docgen system even more amazing

    Hi,
    I think we could use azure blob to save files.
    >>is there a way to have files in my project get automatically written to BLOB entries when I publish?
    If you choose azure cloud service, you could write the upload code at role onstart method. If you choose Azure website, please consider use azure webjob to do this, refer to
    http://azure.microsoft.com/en-us/documentation/articles/websites-dotnet-webjobs-sdk-get-started/ for more details about webjob.
    Regards

  • Where is the best place to implement business logic in ADF application?

    I am using jdeveloper 11g R2 , JSF Facelet
    Where is the best place to implement business logic in ADF application?
    I mean something like service layer in Spring
    Appreciate your comments
    Regards
    Mohsen

    Depends on what your logic does and what data it deals with, but in general business logic is in the ADF BC layer.
    Some goes into entity objects - for things like attribute or row validation.
    Some goes into view objects - for things like calculation.
    Some goes into AM - for things like service methods for UI clients.

  • Where is the best place to download Histogram equalizers

    I found out on cs5 there is a histogram equalizer with in hdr toning...I also found out that there are plugins for histogram qualizers. I did download one called kamflex it was ok but it was noisy. From my learned friends on this site can you recommend others and if so where is the best place to get them. Pornada (free)
    Capt

    Usually for most image editing you really shouldn't need that type of plugin. (it's similar to Image>Adjustments>Equalize)
    Is there a specific problem your trying to solve?

  • Where  is the best place to save my projects?

    I dont know if I have been saving my Project right but I also have a external hard drives and I thought I was saving it their but I check it today and their is nothing on it . Where is the best place to save it or do I even need the external hard drive? Thanks

    No idea what you might have done wrong...
    By default your projects are saved in Macintosh HD/Users/~<name>/Music/Logic/ folder on your boot drive. Check it first.
    You can also try to open your project again using recent files list in Finder or in Logic itself. Then you can find the exact location of your project folder: in the Arrange select an Audio region and go Audio -> Show Selected File(s) in Finder. This will open Audio Files folder in the project folder (well, this will work only if external files are included in the project's assets).
    Another method will be using Spotlight (click on magnifying glass icon in the upper-right corner of the screen to open Spotlight and type in your the name under which you saved your project).

  • Where is the best place to buy the new ipad? Please help

    I am ready to buy a new ipad.  There is no apple store in my town but I will be close to one in a couple of days.  My town has Best Buy, Target, and Walmart.  Assuming I can find what I want... in case I have issues with it, where is the best place to purchase from??  (as far as ease of return, etc). Please advise.

    Dah*veed ..... I do not disagree with what you said about the AppleCare+ protection plan as it does state on the website that proof of purchase is required - IF ... You purchase over the phone. Actually, I did not expect to be able to do this over the phone, but as I said I received the paperwork today via email.
    I copied this from the website and I'm typing this on my new iPad so it may come out a little distorted but you can read the sentence at the bottom that says it can be done over the phone with proof of purchase. I gave the rep my serial number, confirmed my address and CC details and the deal was done. I even called back later in the day to make absolutely certain that I did in fact purchase the AppleCare+ plan that has the two incidents of accidental damage included for a $49.00 charge. The rep did in fact confirm that I did buy the correct plan that I wanted and I am looking at the printed paperwork confirming the whole thing.
    Maybe I just got lucky!
    iPad - AppleCare+
    Every iPad comes with one year of hardware repair coverage and 90 days of telephone technical support. AppleCare+ for iPad gives you two years of repair coverage and technical support from the original purchase date of your iPad. And it adds coverage for up to two incidents of accidental damage due to handling of your iPad, each subject to a $49 service fee.1
    How to get AppleCare+
    You must buy AppleCare+ within 30 days of your iPad purchase.
    There are three ways to buy:
    From the Apple Online Store: When you order the new iPad or iPad 2, you’ll have the option to add AppleCare+ to your cart before you check out.
    At an Apple Retail Store (requires a Genius Bar appointment, inspection of the iPad, and proof of purchase).
    By calling 1-800-275-2273 (requires proof of purchase).
    Learn more

  • Where is the best place to sell my old MacBook Pro?

    I have a 2008 MacBook Pro 2.4Ghz which is in need of a new logic board due to a faulty graphics card. Also in need of a new battery. Everything else is in perfect working order.
    Is there a market for spare parts for this model?
    Where is the best place to list/sell?
    What price should I be happy with?
    Cheers.

    Unfortunatly with that machine, logicboard/graphics problems are pretty common. Because of that, the only parts that are really in demand are working logicboards. The rest of it isn't in very high demand at all.

  • Where is the best place to get/read information of the pros and cons on updating my OS from Snow Leopard to the current OS?

    Where is the best place to get/read information on the pros and cons of updating my OS from Snow Leopard to the current OS?
    I have an iMac 27" intel, purchased Nov 2009.  I am currently using 10.6.8

    Apple OS 10.9 Mavericks:
    Quick overview:
    https://help.apple.com/osx-mavericks/whats-new-from-mountain-lion
    OS X Mavericks supports the following Macs that are already running a minimum of Snow Leopard:
    iMac (Mid-2007 or later)
    MacBook (13-inch Aluminum, Late 2008), (13-inch, Early 2009 or later)
    MacBook Pro (13-inch, Mid-2009 or later), (15-inch, Mid/Late 2007 or later), (17-inch, Late 2007 or later)
    MacBook Air (Late 2008 or later)
    Mac Mini (Early 2009 or later)
    Mac Pro (Early 2008 or later)
    Xserve (Early 2009)
    Transitioning your Mac from Mountain Lion to Apple's new OS X 10.9 Mavericks
    http://appleinsider.com/articles/13/10/23/transitioning-your-mac-from-mountain-l ion-to-apples-new-os-x-109-mavericks

Maybe you are looking for