ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development
View Poll Results: How Are You Structuring Your Apps?
Ad-Hoc Page-Pased (adduser.cfm, listusers.cfm, etc.) 33 58.93%
MVC/Framework (Fusebox, Model-Glue, Mach-II) 15 26.79%
MVC + Tiered Model (service layer, business objects, data layer, etc.) 6 10.71%
MVC + IOC Container / ORM (ColdSpring, Reactor, etc.) 2 3.57%
Voters: 56. You may not vote on this poll


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:
  #1  
Old March 24th, 2006, 01:48 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,100 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 4 h 29 m 54 sec
Reputation Power: 966
Arrow How Are You Structuring Your Apps?

I'm curious as to how the average reader of these forums is architecting their ColdFusion applications. To expand on the poll options:
  1. Ad-Hoc Page-Based: each user action is its own page that is called directly in the URL, i.e. listusers.cfm, adduser.cfm, deleteuser.cfm, etc.
  2. Model-View-Controller / Framework: UI Controller framework such as Fusebox, Model-Glue, Mach-II, etc.
  3. Model-View-Controller + Tiered Model Layers: UI Controller framework plus a tiered model including service layer, business object layer, data layer, etc.
  4. Model-View-Controller + IOC Containers / ORM: UI Controller framework plus inversion of control containers like ColdSpring and/or object-relational mapping frameworks like Reactor

Please respond to the poll and comment here with your thoughts or approach on structuring an applicaiton. I'm interested to see how most folks are doing this and why.

Last edited by kiteless : March 24th, 2006 at 01:53 PM.

Reply With Quote
  #2  
Old June 28th, 2006, 10:05 PM
parkerst parkerst is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 3 parkerst User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 35 sec
Reputation Power: 0
Ad-Hoc Page-Based is much simpler to follow when a developer wishes to take over or work upon my project when I am not in the office. Other methods seem far too complex for no real benefit.

Reply With Quote
  #3  
Old December 17th, 2006, 05:25 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,100 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 4 h 29 m 54 sec
Reputation Power: 966
Quote:
Originally Posted by parkerst
Ad-Hoc Page-Based is much simpler to follow when a developer wishes to take over or work upon my project when I am not in the office. Other methods seem far too complex for no real benefit.
Ad-Hoc Page-Based is less complex but does not scale well to large applications and does not result in very maintainable applications. This would be akin to developing a Java application where all the code is in the main() method. Less complex? Probably. Scalable and maintainable? No.

Reply With Quote
  #4  
Old December 17th, 2006, 07:38 PM
Panther893's Avatar
Panther893 Panther893 is offline
Green-River-Media.com
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2004
Posts: 858 Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 2 h 35 m 48 sec
Reputation Power: 61
Send a message via MSN to Panther893 Send a message via Skype to Panther893
I think my method is ad-hoc also but I devide it all up i keep my main global vars in the application.cfm page, use my index.cfm page just for the template stuff (wrapper of the content) include my content (cfinclude statement with pageid variable being called from the url) menu is included also as is the footer, basically all info that is generated or that remains static is included in the index.cfm template file, that allows me to change one part of the site from one file and not have to change a million of them. here is an example of what i mean with my newest CMS, http://v2.getmanaging.com it has 3 different sites (home, fm, cm) but yet they all use the same source files (same menu, content etc) but different index.cfm files where i change the layout and 2 variables that controll the include path of files and what content is displayed on the sites.
__________________
Web Developer
Green-River-Media.com

Reply With Quote
  #5  
Old December 17th, 2006, 08:13 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,100 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 4 h 29 m 54 sec
Reputation Power: 966
Yes, encapsulating the business logic from the display code is absolutely essential. When done properly, the same domain model can supply data to numerous views (not just separate sites, but web services, AJAX calls, Flash/Flex remoting calls, etc.).

Reply With Quote
  #6  
Old January 2nd, 2007, 12:43 PM
roger_v roger_v is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 19 roger_v User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 19 m 12 sec
Reputation Power: 0
Quote:
Originally Posted by kiteless
I'm curious as to how the average reader of these forums is architecting their ColdFusion applications. To expand on the poll options:
  1. Ad-Hoc Page-Based: each user action is its own page that is called directly in the URL, i.e. listusers.cfm, adduser.cfm, deleteuser.cfm, etc.
  2. Model-View-Controller / Framework: UI Controller framework such as Fusebox, Model-Glue, Mach-II, etc.
  3. Model-View-Controller + Tiered Model Layers: UI Controller framework plus a tiered model including service layer, business object layer, data layer, etc.
  4. Model-View-Controller + IOC Containers / ORM: UI Controller framework plus inversion of control containers like ColdSpring and/or object-relational mapping frameworks like Reactor

Please respond to the poll and comment here with your thoughts or approach on structuring an applicaiton. I'm interested to see how most folks are doing this and why.


I just started on a project here in the north-east and the way I'll be structuring the app would I think fall under ad-hoc page based architecture. All the globals are defined in application.cfm and like a previous poster described, the index.cfm is used more or less as a wrapper.

Is there a resource where I can read up on the pros and cons of all these architectures? thnx.

Reply With Quote
  #7  
Old January 7th, 2007, 05:19 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,100 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 4 h 29 m 54 sec
Reputation Power: 966
If you have a specific question I'm happy to try to help, but if you're asking me to architect your application for you I'm afraid the answer will be no.

Reply With Quote
  #8  
Old January 9th, 2007, 02:16 PM
rtpdesigns rtpdesigns is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 9 rtpdesigns User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 25 m 31 sec
Reputation Power: 0
One thing I did in the begining

In my early days of CF before I learned the oop approach to coding cf I would do something I found very useful. I would create my own version of a fusebox but very list. I would have a directory called queries, and a directory called modules. And using a switch case statement in the application file I would decided which queries and modules were needed for each page. For example I would create a page called index.cfm index.cfm would have the main design of the site then based on the switch case in the application file the content section of the page would be filled in. I would use url params for what page I was on like index.cfm?page=about this was a fairly easy way to start seperating logic from presentation and let you learn a little deep cf coding. Try adding things to your case statement to chage the page titles of each page, and track user viewing stats. It will give you a bit more of the fundementals of a structured development project. Now I personally use model-glue as I love the RAD i get from using it. But be creative and try to come up with your own way of seperating logic from presentation. It will help you learn in the long run. But trust me cfc's are the way to go. AD-HOC is not very developer friendly.

Reply With Quote
  #9  
Old January 9th, 2007, 04:31 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,100 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 4 h 29 m 54 sec
Reputation Power: 966
Quote:
Originally Posted by roger_v
I just started on a project here in the north-east and the way I'll be structuring the app would I think fall under ad-hoc page based architecture. All the globals are defined in application.cfm and like a previous poster described, the index.cfm is used more or less as a wrapper.

Is there a resource where I can read up on the pros and cons of all these architectures? thnx.
There really is no central resource that I am aware of, but a simple search for any of these will provide numerous results. There are also mailing lists available for all of these (Fusebox, Mach-II, Model-Glue, Reactor, ColdSpring, and others). Hope that helps!

Reply With Quote
  #10  
Old February 1st, 2007, 04:50 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 273 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 19 m 28 sec
Reputation Power: 9
Since picking up Fusebox I'll never go back to ad-hoc.

The ability for anyone to look at my app, know exactly where everything is and how it is managed is by far the greatest positive.

I will be beginning to pick up Mach-ii and I am very excited to start programing in OO.

Reply With Quote
  #11  
Old May 21st, 2007, 08:54 AM
Nixforce's Avatar
Nixforce Nixforce is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: Durban, South Africa
Posts: 70 Nixforce User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 14 h 7 m 16 sec
Reputation Power: 9
Smile Im doing it Adhoc

I have build site using Fusebox, and enjoyed it.. but now doing it adhoc as i cant remember the logic i plan (due to short term memory loss, after an accident). I did using Fusebox to build an online pharmacy, a banner management system and an online lottery, but it was quiet a few years ago..
Will probably go back to fusebox if my memory allows it..

Reply With Quote
  #12  
Old July 30th, 2007, 01:24 PM
marron79's Avatar
marron79 marron79 is offline
Rut row Raggy!
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2001
Location: Tornado Alley
Posts: 560 marron79 User rank is Sergeant (500 - 2000 Reputation Level)marron79 User rank is Sergeant (500 - 2000 Reputation Level)marron79 User rank is Sergeant (500 - 2000 Reputation Level)marron79 User rank is Sergeant (500 - 2000 Reputation Level)marron79 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 10 h 3 m 58 sec
Reputation Power: 29
I use CF for all my database admin stuff. Not sure which method I'm using, though. Maybe ad-hoc? I have a folder for each database table and within each folder are do.cfm and form.cfm scripts. The "form" script renders the form to add or edit entries and the "do" script does all the database stuff.
__________________
Matt

Reply With Quote
  #13  
Old August 10th, 2007, 11:37 AM
cozmotrouble cozmotrouble is offline
Duck herder
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: My crib
Posts: 5 cozmotrouble User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 49 m 58 sec
Reputation Power: 0
Send a message via AIM to cozmotrouble
It depends

Quote:
Ad-Hoc Page-Based is much simpler to follow when a developer wishes to take over or work upon my project when I am not in the office. Other methods seem far too complex for no real benefit.


No wonder CF'ers get no respect.


I use a MVC framwork like Mach II for the most stuff and depending on the scale of the project, I will use a service layer, business object layer and ORM. But even for quick and dirty "add hoc" stuff I will use cfcgenerator to generate my data layer (bean, gateway, DAO) just to not have to rewrite all my queries if I need to make changes to the database structure (Which I most likely will). That way if I add a field to the database I don't have to add it to and insert, updated and select queries. I just re-generate the CFC's. 9 times out of 10 all I need to do is add the new databse field to a form and/or a view page. I suppose I could use ORM but that would be over kill for simple stuff.

I use cfcgenerator btw http://code.google.com/p/cfcgenerator/

And all I need to do to snag data from the data base I just add 2 lines of code.

Code:

<cfscript>
	GettblCPE_Method =  CreateObject("component" , "intranet.components.tblCPE_MethodGateway").init(Application.dsn); 
	Get_tblCPE_Method = GettblCPE_Method.getByAttributesQuery(orderby= "Description");

</cfscript> 



And then I can use a generic controller to handle my CRUD functions. With this all I need to do is swap out the name of the table I am using. For this I am using "hrlinks". To change it to "hrdocs" I do a simple search and replace for that string and I have a basic CRUD app with out writing a line of code.


Code:
<cfscript>
	// Create the bean
   obj_hrlinks = CreateObject("component", "intranet.components.hrlinks").init(); 
   // Create the crud Object 
   crudObject = CreateObject("component", "intranet.components.hrlinksDAO").init(Application.dsn);
   // Put the url and form vars into structure to reduce code
   tmp_argumentCollection=StructNew();   
   
	if (action EQ "links_deleted" ) {
		tmp_argumentCollection=URL;
		}
	else{
		 tmp_argumentCollection=form;
		}
	// Populated the bean 
	varcontainer = obj_hrlinks.init(argumentCollection = tmp_argumentCollection);
	// perfom the crud operation
	 if (action EQ "links_added"  ) {
			GET_links = crudObject.create(varcontainer);
			}
	else if(action EQ "links_edited") {
			GET_links = crudObject.update(varcontainer);
			}
		else{ 
			GET_links = crudObject.delete(varcontainer);
		}
</cfscript> 

Reply With Quote
  #14  
Old August 10th, 2007, 12:50 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,100 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 4 h 29 m 54 sec
Reputation Power: 966
You might consider using ColdSpring. It makes dealing with the dependencies in your model much easier, and also gives you the ability to do AOP and remote proxy generation.

Reply With Quote
  #15  
Old August 10th, 2007, 02:59 PM
cozmotrouble cozmotrouble is offline
Duck herder
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: My crib
Posts: 5 cozmotrouble User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 49 m 58 sec
Reputation Power: 0
Send a message via AIM to cozmotrouble
I am not sure I follow

Quote:
Originally Posted by kiteless
You might consider using ColdSpring. It makes dealing with the dependencies in your model much easier, and also gives you the ability to do AOP and remote proxy generation.



Funny you should mention that. I have been looking at ColdSpring but I haven't gotten my head around how it works as of yet. I had a dim light bulb go off but I am not sure how I would go about using it.

Given the example I posted, basically using the off the shelf CFC's that cfcgenerator generates, how would I use ColdSpring? Would I not have to instantiate the bean in order to populate it. Could I just instantiate the hrlinksDAO.cfc directly and use that object to populate the bean or vice versa (since the DAO is dependent on the bean)?

Is this even close?

And thank you in advance for taking the time to answer my question.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > How Are You Structuring Your Apps?

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap