SunQuest
           ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old October 17th, 2004, 08:20 PM
cflocation cflocation is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 3 cflocation User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sharing Application Files

Hey Everyone

I have an application I have written and so far I have 3 different sites running it. The only thing different on all these sites is the data source name that coldfusion uses to get the data. I want to know if there is a way to have all the sites use the same files so every time I make a change I don’t have to upload it to three places.

I have been looking and can’t find anything that will help me. The first thing my application.cfm page does is set the data source and that’s the only piece of information I need to change. I tried a virtual directory in IIS but it will not carry over the Application variable into a virtual folder.

Any help would be greatly appreciated

Reply With Quote
  #2  
Old October 18th, 2004, 10:26 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,626 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 6 m 34 sec
Reputation Power: 53
The short answer is, of course there is...you should never have duplicate code if you can avoid it.

Now how you do this gets more complex depending on what you need to do. The easiest thing is probably to have the files that you want to reuse in a common directory, and then you can create a CF mapping and/or an IIS mapping to that "common" directory, and from your applications you just use cfinclude to call the common files. You could also consider creating custom tags to wrap up the logic that you want to reuse, or create a set of ColdFusion Components (CFCs) to encapsulate the common code if you prefer a more OO solution.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old October 18th, 2004, 03:09 PM
cflocation cflocation is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 3 cflocation User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I took some time last night and made a switch statement in the application.cfm to read the CGI.SERVER_NAME then set the data source according to that. Is it ok to have IIS reading these files for multiple sites at the same time.

Reply With Quote
  #4  
Old October 18th, 2004, 03:19 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,626 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 6 m 34 sec
Reputation Power: 53
Quote:
Originally Posted by cflocation
Is it ok to have IIS reading these files for multiple sites at the same time.
Web sites are by nature multithreaded, so it's up to you to handle race conditions or thread issues in your code. But given what you've explained so far I can't see any problems.

Reply With Quote
  #5  
Old October 18th, 2004, 07:06 PM
cflocation cflocation is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 3 cflocation User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for all your help.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Sharing Application Files


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway