Re: Where to put your code
On Thu, Nov 18, 2010 at 12:16 AM, Dave Watts wrote: Adobe is a big company, with a bunch of products. Adobe's web site predates the Macromedia merger. Should they rewrite their site with CF to make it more prominent, or should they focus on building and selling their tools? Are the two mutually exclusive? =)p Yes, in the very real sense that there is a finite amount of resources. I'd much rather have Adobe hire more CF product developers and testers, etc, than pay developers to rewrite their site. I was mostly just poking fun, as I'm a two birds... kind of guy (to a fault). =) I do feel that there is a lot more to a successful product than coders and testers though. And I really think CFML is a bang'n web language. Maybe if the site is done, never to be modified or maintained, there's little direct benefit to a rewrite, partial or otherwise... *shrug* Resources being finite doesn't really change the ratio of bang:buck. =) ColdFusion isn't just a product. It's useful, too! I wonder (pure speculation), if seeing more CFML powered apps would somehow help sell more CFML engines, which would in turn pay for more CFML engine development? =)p There's a lot of ways to skin a cat, they say, and far be it for me to be telling anyone what to do. I just don't see it as an either/or type of deal, limited resources or no. I'm pretty good at rationalizing though. =) :Denny -- Music is a moral law. It gives soul to the universe, wings to the mind, flight to the imagination, and charm and gaiety to life and to everything. Plat ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339347 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
I'm pretty good at rationalizing though. =) +1 One of the best. =) G !-- Music is a moral law. It gives soul to the universe, wings to the mind, flight to the imagination, and charm and gaiety to life and to everything. Plat ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339348 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
On Wed, Nov 17, 2010 at 11:16 PM, Dave Watts dwa...@figleaf.com wrote: Yes, in the very real sense that there is a finite amount of resources. I'd much rather have Adobe hire more CF product developers and testers, etc, than pay developers to rewrite their site. Adobe, presumably, has developers who work on their site. The question isn't about taking away CF product developers, it is about what language to use to do that which is already being done...ie, building the Adobe website. There is no good reason, that I'm aware of, to not implement a gradual change plan, redoing one section of an app at a time as you update and refresh things and using a new language (CF in this case) to do so. It isn't something I would expect to happen overnight, nor should it. Rather a healthy policy of eating your own dog food should be put in place to utilize their own products (CF, Flex, etc) for new projects and ongoing development . Judah ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339355 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
Adobe, presumably, has developers who work on their site. The question isn't about taking away CF product developers, it is about what language to use to do that which is already being done...ie, building the Adobe website. There is no good reason, that I'm aware of, to not implement a gradual change plan, redoing one section of an app at a time as you update and refresh things and using a new language (CF in this case) to do so. It isn't something I would expect to happen overnight, nor should it. Rather a healthy policy of eating your own dog food should be put in place to utilize their own products (CF, Flex, etc) for new projects and ongoing development . Adobe has plenty of dog food, though - they have two CMS products that I'm aware of, both in J2EE. They have other products, like Contribute, which are arguably better suited to product information pages. They use CF and Flex in places (like the Adobe Exchange), and use other things in other places. And Adobe isn't adding new functionality to their site constantly - it's primarily an informational site, rather than an application. So, to me, saying Adobe should use CF for their entire site doesn't make a lot of sense. If I were an Adobe stockholder, I wouldn't want them to spend their money that way. I'm not, so I don't care much one way or the other. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339364 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Where to put your code
Hey Sean, Thanks, this doc looks great. It would be nice if we could get an updated version of this doc someday but for now this is a great point of reference. ;) Paul -Original Message- From: Sean Corfield [mailto:seancorfi...@gmail.com] Sent: Monday, November 15, 2010 7:44 PM To: cf-talk Subject: Re: Where to put your code On Mon, Nov 15, 2010 at 2:13 PM, Paul Alkema paulalkemadesi...@gmail.com wrote: Does anyone out there have any written coding standards or coding documentation that they would be willing to share? I would be interested in seeing what other development teams use as far as coding standards. Here's what my team developed / used back when I was at Macromedia: http://livedocs.adobe.com/wtg/public/ -- Sean A Corfield -- (904) 302-SEAN Railo Technologies, Inc. -- http://getrailo.com/ An Architect's View -- http://corfield.org/ If you're not annoying somebody, you're not really alive. -- Margaret Atwood ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339305 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
The key phrase from Sean is when I was at Macromedia. You'll need to chap at the Adobe web team door to get an updated version (although a lot of what is adobe.com seems to be moving away from CF). Andy On 17 November 2010 14:18, Paul Alkema paulalkemadesi...@gmail.com wrote: Hey Sean, Thanks, this doc looks great. It would be nice if we could get an updated version of this doc someday but for now this is a great point of reference. ;) Paul -Original Message- From: Sean Corfield [mailto:seancorfi...@gmail.com] Sent: Monday, November 15, 2010 7:44 PM To: cf-talk Subject: Re: Where to put your code On Mon, Nov 15, 2010 at 2:13 PM, Paul Alkema paulalkemadesi...@gmail.com wrote: Does anyone out there have any written coding standards or coding documentation that they would be willing to share? I would be interested in seeing what other development teams use as far as coding standards. Here's what my team developed / used back when I was at Macromedia: http://livedocs.adobe.com/wtg/public/ -- Sean A Corfield -- (904) 302-SEAN Railo Technologies, Inc. -- http://getrailo.com/ An Architect's View -- http://corfield.org/ If you're not annoying somebody, you're not really alive. -- Margaret Atwood ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339307 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
although a lot of what is adobe.com seems to be moving away from CF I noticed this the other day. Seems like Adobe isn't all that proud of CF. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339312 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
It's not that at all ... I believe Day is now powering all the ADC content etc (which makes perfect sense) and I know that the Partner area is moving over to be driven by Salesforce. And there's other jsp content mixed in there too. It's really no difference from us using Trac (powered by Python) for our ticket tracking system, or SugarCRM (PHP) for our ... CRM. There's great products out there already so why reinvent the wheel. Andy On 17 November 2010 15:53, Michael Grant mgr...@modus.bz wrote: although a lot of what is adobe.com seems to be moving away from CF I noticed this the other day. Seems like Adobe isn't all that proud of CF. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339313 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Where to put your code
What makes you think this? It looks to me like most files have a .html extension. I'm sure these html files are dynamic though, perhaps they're rendering ColdFusion in the html pages. http://www.codemonkeysteve.com/blog/2010/03/coldfusion-parsing-coldfusion-in -a-htm-extension-on-iis6/ I do agree that it seems silly to do this though. I would think that if a company is selling a product it seems like they should be using the product themselves and not try to mask that they are or are not using the product. I do know they have a lot of flex integration on the site. :) -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Wednesday, November 17, 2010 10:54 AM To: cf-talk Subject: Re: Where to put your code although a lot of what is adobe.com seems to be moving away from CF I noticed this the other day. Seems like Adobe isn't all that proud of CF. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339316 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
I meant the prominence of the product itself on the adobe site, not the implementation of the technology. On Wed, Nov 17, 2010 at 11:08 AM, Andy Allan andy.al...@gmail.com wrote: It's not that at all ... I believe Day is now powering all the ADC content etc (which makes perfect sense) and I know that the Partner area is moving over to be driven by Salesforce. And there's other jsp content mixed in there too. It's really no difference from us using Trac (powered by Python) for our ticket tracking system, or SugarCRM (PHP) for our ... CRM. There's great products out there already so why reinvent the wheel. Andy On 17 November 2010 15:53, Michael Grant mgr...@modus.bz wrote: although a lot of what is adobe.com seems to be moving away from CF I noticed this the other day. Seems like Adobe isn't all that proud of CF. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339332 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
Some of it is a little dated... http://blog.cutterscrossing.com/index.cfm/General-Coding-Guidelines Steve Cutter Blades Adobe Community Professional - ColdFusion Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer Co-Author of Learning Ext JS http://www.packtpub.com/learning-ext-js/book _ http://blog.cutterscrossing.com On 11/15/2010 4:13 PM, Paul Alkema wrote: Thanks for your feedback. You make some good points. Does anyone out there have any written coding standards or coding documentation that they would be willing to share? I would be interested in seeing what other development teams use as far as coding standards. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339334 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
Ah OK - gotcha well like it or not, things such as Creative Suite directly affect Adobe's stock price so it always gets top billing. And then of course there's Livecycle, which speaks for itself. I wouldn't worry about CF not being on the Adobe.com homepage On 17 November 2010 18:43, Michael Grant mgr...@modus.bz wrote: I meant the prominence of the product itself on the adobe site, not the implementation of the technology. On Wed, Nov 17, 2010 at 11:08 AM, Andy Allan andy.al...@gmail.com wrote: It's not that at all ... I believe Day is now powering all the ADC content etc (which makes perfect sense) and I know that the Partner area is moving over to be driven by Salesforce. And there's other jsp content mixed in there too. It's really no difference from us using Trac (powered by Python) for our ticket tracking system, or SugarCRM (PHP) for our ... CRM. There's great products out there already so why reinvent the wheel. Andy On 17 November 2010 15:53, Michael Grant mgr...@modus.bz wrote: although a lot of what is adobe.com seems to be moving away from CF I noticed this the other day. Seems like Adobe isn't all that proud of CF. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339337 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
I meant the prominence of the product itself on the adobe site, not the implementation of the technology. Adobe is a big company, with a bunch of products. Adobe's web site predates the Macromedia merger. Should they rewrite their site with CF to make it more prominent, or should they focus on building and selling their tools? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339342 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
On Wed, Nov 17, 2010 at 8:58 PM, Dave Watts wrote: ... Adobe is a big company, with a bunch of products. Adobe's web site predates the Macromedia merger. Should they rewrite their site with CF to make it more prominent, or should they focus on building and selling their tools? Are the two mutually exclusive? =)p :Denny -- Man never legislates, but destinies and accidents, happening in all sorts of ways, legislate in all sorts of ways. Plato ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339345 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
Adobe is a big company, with a bunch of products. Adobe's web site predates the Macromedia merger. Should they rewrite their site with CF to make it more prominent, or should they focus on building and selling their tools? Are the two mutually exclusive? =)p Yes, in the very real sense that there is a finite amount of resources. I'd much rather have Adobe hire more CF product developers and testers, etc, than pay developers to rewrite their site. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339346 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Where to put your code
I think that when working on a team of programmers that are all working on the same applications or the same website that it's important to have a programming standard or a guide. I think this goes with any language be it web or desktop applications. I think that it's ok for programmers to have their own style of programming style and own methods to programming however when multiple programmers get together they should be writing applications in the same style using the same guides or else applications and websites looks and unprofessional. I also think it really helps the programmers to work together and be in sync with one another. Ie; if you have a guide of where to put code you can know exactly the location of a script if your teammate wrote it. Do I really think there is a right of wrong in the discussion of where you should put code? Not really. I just think that when working on a team of developers that it is necessary to have guides like these so that all programmers are working consistently. : ) Paul ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339230 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
I agree that coding standards help. I am disagreeing with the ones you are proposing and your use of the word ideal. For example, I don't think the main use case of a cfinclude is to break up large pages into smaller chunks. I think custom tags can contain complex code. If all application logic, processes, and functions must only appear in CFCs, I think it would be challenging to create a site that is in full compliance with your guidelines. -Does all form validation processing code go in CFCs, including the client-side form validation processing logic? -Dealing with threading issues and locking is not simple ColdFusion and setting session variables could be considered application logic. Does code that sets session variables go in CFCs? How about the code to ensure thread safety? -How can you deny a user from getting access to a page without having code outside of the CFC? This security application logic could require a cflocation, cfinclude, or cfabort tag. Do cflocation tags go into the CFC? Yes you could do all these things in a CFC, but it is ideal? -Mike Chabot On Mon, Nov 15, 2010 at 9:11 AM, Paul Alkema paulalkemadesi...@gmail.com wrote: I think that when working on a team of programmers that are all working on the same applications or the same website that it's important to have a programming standard or a guide. I think this goes with any language be it web or desktop applications. I think that it's ok for programmers to have their own style of programming style and own methods to programming however when multiple programmers get together they should be writing applications in the same style using the same guides or else applications and websites looks and unprofessional. I also think it really helps the programmers to work together and be in sync with one another. Ie; if you have a guide of where to put code you can know exactly the location of a script if your teammate wrote it. Do I really think there is a right of wrong in the discussion of where you should put code? Not really. I just think that when working on a team of developers that it is necessary to have guides like these so that all programmers are working consistently. : ) Paul ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339238 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Where to put your code
Thanks for your feedback. You make some good points. Does anyone out there have any written coding standards or coding documentation that they would be willing to share? I would be interested in seeing what other development teams use as far as coding standards. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339240 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
Well, I've been using frameworks since Fusebox 2 came out, so I still tend to follow generic CF framework conventions, if you can call them that. * display a message, a menu, or data: dsp.user.cfm, and depending on the framework, all displays probably go in a /views subfolder; there may be a /views folder for each module if it's a complex application; even if it's a long template, it's all in one file, I would find it highly inefficient to have to hunt around across multiple files for all the output that makes up a single page, excluding headers, footers, nav, and other site-wide or module-wide wrappers, which are generally site-level includes or wrapper templates * display a form for data entry or editing: frm.user.cfm, again usually in the proper /views subfolder * for years now I've used event-driven MVC style frameworks, so I use index.cfm as the front side controller: there is generally a site-level one and then another in each module, and the index.cfm files take care of handling the request and marshalling the necessary CFCs and views * CFCs are then used to handle all sorts of things: utility methods I tend to put in a root /components/Util.cfc or something like that and utilities as well as any singleton (yes, I know other languages don't mean the same thing, but I'm talking about the quasi-accepted CF 'singleton' here) CFCs are generally loaded into the application scope, whether by Application.cfc or by individual controllers; these generally go into /com subfolders * CFCs that are more like objects, such as file formatters or true classes (properties + methods, instances are not singletons and may be passed around within the application), I generally put into a /model subfolder, mostly just to distinguish them from the application-scope components This type of arrangement allows me, for example, to have a root-level index.cfm simply include the index.cfm of another module and voila, the whole module is available to the application. It's well organized in terms of having to show other developers around the application, and it makes the separation of concerns nice and clear, in my opinion. YMMV On 11/15/2010 5:13 PM, Paul Alkema wrote: Thanks for your feedback. You make some good points. Does anyone out there have any written coding standards or coding documentation that they would be willing to share? I would be interested in seeing what other development teams use as far as coding standards. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339248 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
On Mon, Nov 15, 2010 at 2:13 PM, Paul Alkema paulalkemadesi...@gmail.com wrote: Does anyone out there have any written coding standards or coding documentation that they would be willing to share? I would be interested in seeing what other development teams use as far as coding standards. Here's what my team developed / used back when I was at Macromedia: http://livedocs.adobe.com/wtg/public/ -- Sean A Corfield -- (904) 302-SEAN Railo Technologies, Inc. -- http://getrailo.com/ An Architect's View -- http://corfield.org/ If you're not annoying somebody, you're not really alive. -- Margaret Atwood ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339256 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Where to put your code
Seriously? There are many thousands or hundreds of thousands of programs out there that were written before OOP even existed in many different languages, including your operating system. Perhaps YOU are not able to produce well written programs without OOP or CFC's, but that does not apply to everyone else on the planet, and many people still continue to do so. Russ -Original Message- From: Paul Alkema [mailto:paulalkemadesi...@gmail.com] Sent: 13 November 2010 13:19 To: cf-talk Subject: Re: Where to put your code I second this. : ) On Fri, Nov 12, 2010 at 8:05 PM, James Holmes james.hol...@gmail.comwrote: I'd argue that CF didn't allow for well written applications before CFCs came along. -- WSS4CF - WS-Security framework for CF http://wss4cf.riaforge.org/ On 13 November 2010 02:16, Dave Watts dwa...@figleaf.com wrote: Functions existed well before CFCs - does that mean that well-written applications predating the use of CFCs are now poorly-written? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339192 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
I second this. : ) On Fri, Nov 12, 2010 at 8:05 PM, James Holmes james.hol...@gmail.comwrote: I'd argue that CF didn't allow for well written applications before CFCs came along. -- WSS4CF - WS-Security framework for CF http://wss4cf.riaforge.org/ On 13 November 2010 02:16, Dave Watts dwa...@figleaf.com wrote: Functions existed well before CFCs - does that mean that well-written applications predating the use of CFCs are now poorly-written? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339179 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
I'd argue that CF didn't allow for well written applications before CFCs came along. That's absurd on its face. There are no well-written applications in any procedural languages, then? You need OO for a well-written application? Operating systems are written in C - nothing well-written in there? CFCs, OO, etc - these are things to help you map concepts outside of your program to the program itself. They are aids to the programmer. They may help programmers who are using shared concepts work together. They are not essential for good programming. Nice to have, maybe - but not essential. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339181 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
I'd argue that CF didn't allow for well written applications before CFCs came along. Swapping out well written applications for well made tools, I would argue that there were no well made tools before the advent of fire, flint, copper, bronze, iron, steel, interchangeable parts, computers etc. etc extrapolate, rearrange and fill in the blanks as needed. Humans are just as smart/ingenious/resourceful/creative (and of course, the flip side dumb, foolish, flawed etc) as they were since the beginning of recorded history. We just stand on the shoulders of those who came before us. G! On Fri, Nov 12, 2010 at 8:05 PM, James Holmes james.hol...@gmail.comwrote: I'd argue that CF didn't allow for well written applications before CFCs came along. -- WSS4CF - WS-Security framework for CF http://wss4cf.riaforge.org/ On 13 November 2010 02:16, Dave Watts dwa...@figleaf.com wrote: Functions existed well before CFCs - does that mean that well-written applications predating the use of CFCs are now poorly-written? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339186 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
When was the last time you wrote a web app with a flint axe? -- WSS4CF - WS-Security framework for CF http://wss4cf.riaforge.org/ On 14 November 2010 12:01, Gerald Guido gerald.gu...@gmail.com wrote: I'd argue that CF didn't allow for well written applications before CFCs came along. Swapping out well written applications for well made tools, I would argue that there were no well made tools before the advent of fire, flint, copper, bronze, iron, steel, interchangeable parts, computers etc. etc extrapolate, rearrange and fill in the blanks as needed. Humans are just as smart/ingenious/resourceful/creative (and of course, the flip side dumb, foolish, flawed etc) as they were since the beginning of recorded history. We just stand on the shoulders of those who came before us. G! On Fri, Nov 12, 2010 at 8:05 PM, James Holmes james.hol...@gmail.comwrote: I'd argue that CF didn't allow for well written applications before CFCs came along. -- WSS4CF - WS-Security framework for CF http://wss4cf.riaforge.org/ On 13 November 2010 02:16, Dave Watts dwa...@figleaf.com wrote: Functions existed well before CFCs - does that mean that well-written applications predating the use of CFCs are now poorly-written? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339187 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
When was the last time you wrote a web app with a flint axe? Right around PHP 3 or CF 2 :-) G! On Sun, Nov 14, 2010 at 12:02 AM, James Holmes james.hol...@gmail.comwrote: When was the last time you wrote a web app with a flint axe? -- WSS4CF - WS-Security framework for CF http://wss4cf.riaforge.org/ On 14 November 2010 12:01, Gerald Guido gerald.gu...@gmail.com wrote: I'd argue that CF didn't allow for well written applications before CFCs came along. Swapping out well written applications for well made tools, I would argue that there were no well made tools before the advent of fire, flint, copper, bronze, iron, steel, interchangeable parts, computers etc. etc extrapolate, rearrange and fill in the blanks as needed. Humans are just as smart/ingenious/resourceful/creative (and of course, the flip side dumb, foolish, flawed etc) as they were since the beginning of recorded history. We just stand on the shoulders of those who came before us. G! On Fri, Nov 12, 2010 at 8:05 PM, James Holmes james.hol...@gmail.com wrote: I'd argue that CF didn't allow for well written applications before CFCs came along. -- WSS4CF - WS-Security framework for CF http://wss4cf.riaforge.org/ On 13 November 2010 02:16, Dave Watts dwa...@figleaf.com wrote: Functions existed well before CFCs - does that mean that well-written applications predating the use of CFCs are now poorly-written? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339188 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
Or any version of Perl... -- WSS4CF - WS-Security framework for CF http://wss4cf.riaforge.org/ On 14 November 2010 13:40, Gerald Guido gerald.gu...@gmail.com wrote: When was the last time you wrote a web app with a flint axe? Right around PHP 3 or CF 2 :-) G! On Sun, Nov 14, 2010 at 12:02 AM, James Holmes james.hol...@gmail.comwrote: When was the last time you wrote a web app with a flint ax ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339189 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Where to put your code
Hi All, I recently had a discussion with some other programmers on my team dealing with where to put application code and when. This is a small little guide I wrote that I try to use and I wanted some second opinions on my coding logic. Thanks, Paul - When to put your code where. In my opinion this is the IDEAL location for code. Straight on CFM Page Should Contain: UI or presentation code. HTML, JavaScript, simple ColdFusion (IE; does var.foo exist output etc..). Should Not Contain: Application Logic. Processes or functions. Includes Should Contain: Code should contain same type of code as CFM pages however includes should be used to split large CFM pages into smaller segments. Should Not Contain: Application Logic. Processes or functions. Custom Tags Should Contain: Reusable UI or presentation code. HTML, JavaScript, simple ColdFusion. Code that's going to be used more than once. Should Not Contain: Application Logic. Processes or functions. CFC's Should Contain: Application Logic. Processes or functions. Should Not Contain: UI or presentation code. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339132 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Where to put your code
Oh yeah. Of course ideally we would be on an MVC framework but we can't do that due to internal reasons. This doc is for those not on an MVC. Don't want any non MVC haters to yell at me. Haha. Paul Alkema ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339133 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
I'd only modify it a little: Straight on CFM Page Should Contain: UI or presentation code. HTML, JavaScript, simple ColdFusion to implement UI/Presentation (IE; does var.foo exist output etc..). Should Not Contain: Application Logic. Processes or functions. Includes Should Contain: reusable ui code that doesn't require inputs (IE: headers, footers, sidebars, etc) Should Not Contain: Application Logic. Processes or functions. Custom Tags Should Contain: Reusable, Dynamic UI or presentation code. (IE generic headers that accept passed parameters for customization) HTML, JavaScript, simple ColdFusion. Code that's going to be used more than once. Should Not Contain: Application Logic. Processes or functions. CFC's Should Contain: Application Logic. Processes or functions. should not be dependent on any scoped variables Should Not Contain: UI or presentation code. On Fri, Nov 12, 2010 at 10:23 AM, Paul Alkema paulalkemadesi...@gmail.com wrote: Hi All, I recently had a discussion with some other programmers on my team dealing with where to put application code and when. This is a small little guide I wrote that I try to use and I wanted some second opinions on my coding logic. Thanks, Paul - When to put your code where. In my opinion this is the IDEAL location for code. Straight on CFM Page Should Contain: UI or presentation code. HTML, JavaScript, simple ColdFusion (IE; does var.foo exist output etc..). Should Not Contain: Application Logic. Processes or functions. Includes Should Contain: Code should contain same type of code as CFM pages however includes should be used to split large CFM pages into smaller segments. Should Not Contain: Application Logic. Processes or functions. Custom Tags Should Contain: Reusable UI or presentation code. HTML, JavaScript, simple ColdFusion. Code that's going to be used more than once. Should Not Contain: Application Logic. Processes or functions. CFC's Should Contain: Application Logic. Processes or functions. Should Not Contain: UI or presentation code. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339134 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Where to put your code
I agree with those additions. Thanks! -Original Message- From: Scott Stewart [mailto:webmas...@sstwebworks.com] Sent: Friday, November 12, 2010 10:46 AM To: cf-talk Subject: Re: Where to put your code I'd only modify it a little: Straight on CFM Page Should Contain: UI or presentation code. HTML, JavaScript, simple ColdFusion to implement UI/Presentation (IE; does var.foo exist output etc..). Should Not Contain: Application Logic. Processes or functions. Includes Should Contain: reusable ui code that doesn't require inputs (IE: headers, footers, sidebars, etc) Should Not Contain: Application Logic. Processes or functions. Custom Tags Should Contain: Reusable, Dynamic UI or presentation code. (IE generic headers that accept passed parameters for customization) HTML, JavaScript, simple ColdFusion. Code that's going to be used more than once. Should Not Contain: Application Logic. Processes or functions. CFC's Should Contain: Application Logic. Processes or functions. should not be dependent on any scoped variables Should Not Contain: UI or presentation code. On Fri, Nov 12, 2010 at 10:23 AM, Paul Alkema paulalkemadesi...@gmail.com wrote: Hi All, I recently had a discussion with some other programmers on my team dealing with where to put application code and when. This is a small little guide I wrote that I try to use and I wanted some second opinions on my coding logic. Thanks, Paul - When to put your code where. In my opinion this is the IDEAL location for code. Straight on CFM Page Should Contain: UI or presentation code. HTML, JavaScript, simple ColdFusion (IE; does var.foo exist output etc..). Should Not Contain: Application Logic. Processes or functions. Includes Should Contain: Code should contain same type of code as CFM pages however includes should be used to split large CFM pages into smaller segments. Should Not Contain: Application Logic. Processes or functions. Custom Tags Should Contain: Reusable UI or presentation code. HTML, JavaScript, simple ColdFusion. Code that's going to be used more than once. Should Not Contain: Application Logic. Processes or functions. CFC's Should Contain: Application Logic. Processes or functions. Should Not Contain: UI or presentation code. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339139 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
You cannot really apply such rules to everyone. If someone just has a very simple mostly flat, then using mvc frameworks and CFC's will probably be overkill and create 10 x more code is actually required. In those situations you are probably just going to use some cfm pages and maybe a few cfincludes for header, footer and menu etc. For large code-centric applications and when working within teams your rules work fine though. -- Russ Michaels www.cfmldeveloper.com - Supporting the CF community since 1999 FREE ColdFusion/Railo hosting for developers. blog: www.michaels.me.uk ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339140 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
Here is my opinion:* templates* Contains: object instances to render into HTML, conditionals for output, formatting methods Does Not Contain: dynamically rendered CSS, dynamically rendered JavaScript, patterns, methods. also any business, data and file management logic that can be written in a component and called from the template *cfIncludes* Contains: same as templates except intended for reuse (header, footer, object creation, etc) Does Not Contain: same as templates *custom tags* Contains: same as cfIncludes except objects can be passed into the tag as parameters and carry their own scope Does Not Contain: same as templates *components* Contains: objects, business logic, patterns, methods and inheritance/abstraction, data and file management logic Does Not Contain: any output or any dependence on scoped variables I'm a firm believer in CSS and JavaScript being outside of the document. If you are rendering dynamic JS or CSS, you're doing it wrong. There is a better and easier way. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339141 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Where to put your code
I work on a fairly large team for a large multi-million dollar ecommerce corporation. I can see if your building small application for small websites and you're not on a team of people working on the same website how it might not be ideal to have guidelines set up like these. I think in a team environment in order to avoid coding inconsistencies on large websites at least general guidelines are a must. :) -Original Message- From: Russ Michaels [mailto:r...@michaels.me.uk] Sent: Friday, November 12, 2010 12:20 PM To: cf-talk Subject: Re: Where to put your code You cannot really apply such rules to everyone. If someone just has a very simple mostly flat, then using mvc frameworks and CFC's will probably be overkill and create 10 x more code is actually required. In those situations you are probably just going to use some cfm pages and maybe a few cfincludes for header, footer and menu etc. For large code-centric applications and when working within teams your rules work fine though. -- Russ Michaels www.cfmldeveloper.com - Supporting the CF community since 1999 FREE ColdFusion/Railo hosting for developers. blog: www.michaels.me.uk ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339142 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
My only exceptions to these would be: Includes Should Not Contain: Application Logic. Processes or functions. A lot of times (depending on the app) I stick functions (UDFs) in an include. I have a lot of utility functions that (arguably) don't really need to be in a cfc. Custom Tags Should Contain: Reusable, Dynamic UI or presentation code. (IE generic headers that accept passed parameters for customization) I generally use custom tags as views for encapsulation purposes. What happens in Vegas, stays in Vegas. Then I stick the aforementioned functions in the request scope or a stuct and/or array to pass into the views. G! -- Gerald Guido http://www.myinternetisbroken.com Wait. We can't stop here. This is bat country. -- HST ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339143 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
while you may not use MVC on every app, sticking to certain guidelines like what code to put where, also known as includes vs custom tags vs cfc, along with the use of external JS and CSS will make any app development smoother.. On Fri, Nov 12, 2010 at 12:20 PM, Russ Michaels r...@michaels.me.uk wrote: You cannot really apply such rules to everyone. If someone just has a very simple mostly flat, then using mvc frameworks and CFC's will probably be overkill and create 10 x more code is actually required. In those situations you are probably just going to use some cfm pages and maybe a few cfincludes for header, footer and menu etc. For large code-centric applications and when working within teams your rules work fine though. -- Russ Michaels www.cfmldeveloper.com - Supporting the CF community since 1999 FREE ColdFusion/Railo hosting for developers. blog: www.michaels.me.uk ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339144 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Where to put your code
Hm, I respectfully disagree with putting functions in cfm pages entirely no matter how it's being pulled. I think there's a place for functions and that's in cfcs. You say you have a lot of utility functions that don't need to be in a cfc. If you have a lot of them, why not just create a cfc called utility and stick them all in one cfc? Also, if you stick functions and include them most likely your talking to that function using scoped variables which as other have mentioned is usually a bad practice to do using functions. Paul -Original Message- From: Gerald Guido [mailto:gerald.gu...@gmail.com] Sent: Friday, November 12, 2010 12:54 PM To: cf-talk Subject: Re: Where to put your code My only exceptions to these would be: Includes Should Not Contain: Application Logic. Processes or functions. A lot of times (depending on the app) I stick functions (UDFs) in an include. I have a lot of utility functions that (arguably) don't really need to be in a cfc. Custom Tags Should Contain: Reusable, Dynamic UI or presentation code. (IE generic headers that accept passed parameters for customization) I generally use custom tags as views for encapsulation purposes. What happens in Vegas, stays in Vegas. Then I stick the aforementioned functions in the request scope or a stuct and/or array to pass into the views. G! -- Gerald Guido http://www.myinternetisbroken.com Wait. We can't stop here. This is bat country. -- HST ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339146 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
You say you have a lot of utility functions that don't need to be in a cfc. If you have a lot of them, why not just create a cfc called utility and stick them all in one cfc? Huh... That is exactly what I thought to myself right after I hit send. i.e., huh that is kinda dumb It would be much easier to stick them in a cfc. I respectfully stand corrected. G! On Fri, Nov 12, 2010 at 1:05 PM, Paul Alkema paulalkemadesi...@gmail.comwrote: Hm, I respectfully disagree with putting functions in cfm pages entirely no matter how it's being pulled. I think there's a place for functions and that's in cfcs. You say you have a lot of utility functions that don't need to be in a cfc. If you have a lot of them, why not just create a cfc called utility and stick them all in one cfc? Also, if you stick functions and include them most likely your talking to that function using scoped variables which as other have mentioned is usually a bad practice to do using functions. Paul -Original Message- From: Gerald Guido [mailto:gerald.gu...@gmail.com] Sent: Friday, November 12, 2010 12:54 PM To: cf-talk Subject: Re: Where to put your code My only exceptions to these would be: Includes Should Not Contain: Application Logic. Processes or functions. A lot of times (depending on the app) I stick functions (UDFs) in an include. I have a lot of utility functions that (arguably) don't really need to be in a cfc. Custom Tags Should Contain: Reusable, Dynamic UI or presentation code. (IE generic headers that accept passed parameters for customization) I generally use custom tags as views for encapsulation purposes. What happens in Vegas, stays in Vegas. Then I stick the aforementioned functions in the request scope or a stuct and/or array to pass into the views. G! -- Gerald Guido http://www.myinternetisbroken.com Wait. We can't stop here. This is bat country. -- HST ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339147 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
While I might prefer to do things the way you describe, I hesitate to call these things best practices. Hm, I respectfully disagree with putting functions in cfm pages entirely no matter how it's being pulled. I think there's a place for functions and that's in cfcs. You do realize there really isn't a right or wrong answer to this, right? Functions existed well before CFCs - does that mean that well-written applications predating the use of CFCs are now poorly-written? You say you have a lot of utility functions that don't need to be in a cfc. If you have a lot of them, why not just create a cfc called utility and stick them all in one cfc? What does that buy you, exactly? The big value of CFCs for many people is that they let you adhere to OO conventions. But utility functions don't really follow those conventions anyway. Also, if you stick functions and include them most likely your talking to that function using scoped variables which as other have mentioned is usually a bad practice to do using functions. Why is that a bad practice? How are functions different from any other variables? And you might be just as likely to do this with CFCs as without - you can store those in these scopes as well. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339150 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
the power of CF is in its simplicity. A newbie can come along and just learn a handful of tags and functions to develop a web site. The next step up is CFC's, frameworks and OOP Some people simply will not want or need to learn anything beyond the handful of tags and functions if this is sufficient for them Don't lose sight of what makes ColdFusion great and suitable for all levels of skill. On Fri, Nov 12, 2010 at 5:56 PM, Scott Stewart webmas...@sstwebworks.comwrote: while you may not use MVC on every app, sticking to certain guidelines like what code to put where, also known as includes vs custom tags vs cfc, along with the use of external JS and CSS will make any app development smoother.. On Fri, Nov 12, 2010 at 12:20 PM, Russ Michaels r...@michaels.me.uk wrote: You cannot really apply such rules to everyone. If someone just has a very simple mostly flat, then using mvc frameworks and CFC's will probably be overkill and create 10 x more code is actually required. In those situations you are probably just going to use some cfm pages and maybe a few cfincludes for header, footer and menu etc. For large code-centric applications and when working within teams your rules work fine though. -- Russ Michaels www.cfmldeveloper.com - Supporting the CF community since 1999 FREE ColdFusion/Railo hosting for developers. blog: www.michaels.me.uk ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339157 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
In my option, putting functions and application logic in cfm files, include files, and custom tags is fine. The vast majority of ColdFusion Web sites allow developers to do this and I think adding these restrictions could lead to a worse outcome. If you hire an expert developer, and that expert developer thinks it is best to encapsulate some complex network communication and XML processing logic inside of a Java custom tag, then I think the best action is to let him do it instead of making him conform to some unnecessary restrictions. If you have a collection of utility functions, my recommendation is to not put these into a CFC because CFCs add overhead without adding much, if any, benefit. I prefer using include files and caching common functions in RAM when the application loads. If CFCs behaved more like objects in an OO language and did not have the overhead that they have, my opinion might be different. In at true OO language, I put functions into objects without hesitation. -Mike Chabot On Fri, Nov 12, 2010 at 10:23 AM, Paul Alkema paulalkemadesi...@gmail.com wrote: Hi All, I recently had a discussion with some other programmers on my team dealing with where to put application code and when. This is a small little guide I wrote that I try to use and I wanted some second opinions on my coding logic. Thanks, Paul - When to put your code where. In my opinion this is the IDEAL location for code. Straight on CFM Page Should Contain: UI or presentation code. HTML, JavaScript, simple ColdFusion (IE; does var.foo exist output etc..). Should Not Contain: Application Logic. Processes or functions. Includes Should Contain: Code should contain same type of code as CFM pages however includes should be used to split large CFM pages into smaller segments. Should Not Contain: Application Logic. Processes or functions. Custom Tags Should Contain: Reusable UI or presentation code. HTML, JavaScript, simple ColdFusion. Code that's going to be used more than once. Should Not Contain: Application Logic. Processes or functions. CFC's Should Contain: Application Logic. Processes or functions. Should Not Contain: UI or presentation code ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339170 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
Why not create the CFC in the application scope to cache it in RAM? -- WSS4CF - WS-Security framework for CF http://wss4cf.riaforge.org/ On 13 November 2010 06:22, Mike Chabot mcha...@gmail.com wrote: I prefer using include files and caching common functions in RAM when the application loads. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339172 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
I'd argue that CF didn't allow for well written applications before CFCs came along. -- WSS4CF - WS-Security framework for CF http://wss4cf.riaforge.org/ On 13 November 2010 02:16, Dave Watts dwa...@figleaf.com wrote: Functions existed well before CFCs - does that mean that well-written applications predating the use of CFCs are now poorly-written? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339173 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where to put your code
If people put utility functions in CFCs I definitely recommend caching these in RAM. However, what I see many people do is instantiating a large CFC that consists only of functions, calling one tiny function inside of it, then destroying the CFC, with no caching used at all. The majority of ColdFusion programmers struggle with the concept of CFCs and they don't use as much caching as they should. For the majority of CF programmers, I think UDF libraries are the safer path because they are harder to misuse and their use is less likely to bring down a server. I don't think I have ever seen a UDF library significantly impact the performance of a Web site. UDF libraries are faster and use less server resources, although if you are caching CFCs in the application or server scopes, the speed differences become minor. To clarify a possible misunderstanding, I'm not saying CFCs are bad. Rather, I am contesting the phrase ideal location when it comes to where to put functions. Using a UDF embedded in a cfm page or a collection of UDFs in an include file is fine with me. Using a CFC is fine with me as well, as long as attention is paid to the potentially server-crippling impact of instantiating too many CFCs. I wouldn't say that there is only one ideal way to structure a CF application. If there was only one correct way to do things, that one correct way would be both well documented and widely understood at this point in ColdFusion's history. Instead of the phrase ideal location, the phrase my preferred location in order to keep coding styles consistent throughout the application might be better. -Mike Chabot On Fri, Nov 12, 2010 at 8:04 PM, James Holmes james.hol...@gmail.com wrote: Why not create the CFC in the application scope to cache it in RAM? On 13 November 2010 06:22, Mike Chabot mcha...@gmail.com wrote: I prefer using include files and caching common functions in RAM when the application loads. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339177 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm