Reply to topic
Best pracctices CFC's ?
Gerd


Joined: 12 Oct 2004
Posts: 11
Location: Deltona, FL
Reply with quote
Hi,

Anybody have any tips pointers for best practices as far as locaction of CFC's that have methods that are used by both administators in a secure area and also by the public on the front end. Would like to use one CFC that manges users on the back end as well as the front.

Thanks
byron
Forum Admin

Joined: 07 Mar 2004
Posts: 160
Location: Newark, DE, USA
Reply with quote
I would suggest hide your CFC's as best as possible. And only allowing access to them publicly via a single point of entry, like a Listener CFC that handles all web service requests, yes it is an extra step for a web service, but can wind up being much more secure.
CFC's
kbrocx


Joined: 13 Oct 2004
Posts: 43
Location: Seattle
Reply with quote
Why not have one cfc for the front end and then just make another cfc that extends that one for the admin area. That way you'll haver all the functionality of the public cfc in the admin area without exposing the admin cfc to the public.
While using a cfc as a web service is a sometimes useful idea the overhead of a webservice compared to a cfc invocation would turn me off if you are talking about using the cfc internally.
Also holding general processing cfcs in session or application scope can really help speed things up significantly.
Gerd


Joined: 12 Oct 2004
Posts: 11
Location: Deltona, FL
Reply with quote
Thanks kbrocx,

Some great tips. Extending the front end cfc is this case is the way to go for sure.

Thanks again
loftboy
Forum Regular

Joined: 24 Jun 2004
Posts: 1129
Location: Colorado
Reply with quote
do a google for cfc best practices, i think raymond camden has a good one as well as maybe sean corfield from mm

u can make 1 cfc that manages everything but its more efficiant to seperate them a bit. also learn to call them into an object instead of just invoking them, will save conciderable overhead.

I "hear" there is some new cfc stuff in blackstone as well
kbrocx


Joined: 13 Oct 2004
Posts: 43
Location: Seattle
Reply with quote
Well, I suppose you could make one cfc that handles everything.
While you were at it I suppose you could just make one page that handles everything. And then you could put all the data in one nice long table! Wink
One of the main benefits of cfc's is there ability to take advantage of some of the features of object oriented languages. With one cfc you pretty much defeat many of the benefits of using cfc's in the first place.
For instance in the case that gerd presented in this post simply creating two cfc's and having one inherit from the other solved his problem. The admin cfc can simply inherit all the functions in the public cfc, overwrite any it needs changed, and add to it any functions specific to it's needs.
CFC's are the the best thing that happened to cf ever as far as I'm concerned. By leveraging their power we lowly cf developers ( Wink ) can finally enjoy some of the benefits of OOP. Razz
loftboy
Forum Regular

Joined: 24 Jun 2004
Posts: 1129
Location: Colorado
Reply with quote
yeah and we can also make the entire site on 1 page
Laughing

i try and make all my cfc funtions seperate, just keep it simple

we arent "lowly" we are just smart Razz
Gerd


Joined: 12 Oct 2004
Posts: 11
Location: Deltona, FL
Reply with quote
My 2 cents worth,

We all do things differently. No two people think alike.
I've yet to see to two programmers who follow the same train of thought.
My methods will differ from those of others, as your will yours as well.
Also each application has different needs that cover a variety of issue's such as security, functionality, server overhead etc.

My orignal question was aimed at the simple concept of efficent code reuse, getting away from spagehti code, and keeping the application secure. Using extended CFC's, in my opinion, is that way to go in this application as it meets the needs I described above and is a very logical approach. Why not make use of inheritance thats why it's there.

Thanks
loftboy
Forum Regular

Joined: 24 Jun 2004
Posts: 1129
Location: Colorado
Reply with quote
of course, thats the great thing about coding, can be done different way.

now, part of this ? will be answered in a better more efficiant way when blackstone arrives but cant be disclosed as of yet.

one of the great things about cfm is that it is really being opened up right now, ever since the mx release. That was the first time we also got cfc's, so they will only get bigger, badder & more powerful!
Gerd


Joined: 12 Oct 2004
Posts: 11
Location: Deltona, FL
Reply with quote
Yeah, the learning curve never stops. Now if I could just learn to write complex extensions like the guys over at interakt or webassist i'd be on to something.... Wink
Gerd


Joined: 12 Oct 2004
Posts: 11
Location: Deltona, FL
Reply with quote
One more thing.... What's with naming it Blackstone? How do you go from Coldfusion MX to Blackstone?
loftboy
Forum Regular

Joined: 24 Jun 2004
Posts: 1129
Location: Colorado
Reply with quote
just a code name, just like mx was code named red sky. it wont actually be called blackstone
Best pracctices CFC's ?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic