|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
| View Poll Results: How Are You Structuring Your Apps? | |||
| Ad-Hoc Page-Pased (adduser.cfm, listusers.cfm, etc.) | | 25 | 58.14% |
| MVC/Framework (Fusebox, Model-Glue, Mach-II) | | 11 | 25.58% |
| MVC + Tiered Model (service layer, business objects, data layer, etc.) | | 5 | 11.63% |
| MVC + IOC Container / ORM (ColdSpring, Reactor, etc.) | | 2 | 4.65% |
| Voters: 43. You may not vote on this poll | |||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
I'm curious as to how the average reader of these forums is architecting their ColdFusion applications. To expand on the poll options:
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.
__________________
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 Last edited by kiteless : March 24th, 2006 at 01:53 PM. |
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
|||
|
|||
|
Quote:
|
|
#4
|
||||
|
||||
|
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.
__________________
MostarDesigns.com |
|
#5
|
|||
|
|||
|
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.).
|
|
#6
|
|||
|
|||
|
Quote:
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. |
|
#7
|
|||
|
|||
|
kiteless!!!!please help me i know you can!
i hv a relational database which involves me recording the availabilaty of holiday houses and also taking bookings from customers. What data needs to be stored in which tables and fields for me to achieve this!so that i can also search the data base for houses available at particular weeks?please help!
you can also contact me @ (E-Mail address blocked: See forum rules) thanks! Elliot Last edited by elliotgilford58 : January 7th, 2007 at 04:50 PM. Reason: wanted 2 add my email addy |
|
#8
|
|||
|
|||
|
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.
|
|
#9
|
|||
|
|||
|
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.
|
|
#10
|
|||
|
|||
|
Quote:
|
|
#11
|
|||
|
|||
|
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. |
|
#12
|
||||
|
||||
|
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.. |
|
#13
|
||||
|
||||
|
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 |
|
#14
|
|||
|
|||
|
It depends
Quote:
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>
|