Ok i'll write up a little treatise on CFCs in a real estate app for
you - a simple one that just manages inserts, edits, deletes and
queries on a table of property listings.  I'll take one that i use for
my client (the one i think is the same as yours) and fictionalise it a
bit to protect the IP of my client.  You'll see how it works, and how
you can integrate it with your user interface code.      Also it will
mean i can share it with others if they want.   (I'd blog it but i'm
too lazy to maintain a blog - i dont have one.  I know what they're
like to keep going  - i had one years ago before they were called
blogs.).

There's a WHOLE LOT more you can learn but i'll keep it to the basics
for you and try to keep jargon out of it.

Another nice thing about having a defined pattern to your code, is
that you can have other stuff write a lot of the code for you.    I
have a little application I wrote to examine a database table,  and
write all the queries to add/delete/edit/read from it and produce the
CFCs for me  - that's too advanced for you just yet  but if you see
that at work, you can see one of the benefits of using patterns to
your code.   That's what some of these frameworks do - things lke
Transfer and Reactor for example recognise when you add a field to
your database table and re-write your CFCs to match.     Without ever
seeing that at work, I am sure you can see how that would be of
benefit to you as a developer where time represents dollars.
Coldspring is another tool - it knows how to instantiate your CFCs and
whenever you call for a CFC, Coldspring knows what to do and just
creates it for you, guaranteeing it feeds the CFC everything it needs
to know.   And it knows which CFCs to cache in memory and which to
destroy after each use. It's a marvel!

But for now lets leave all that stuff aside, with the understanding
you'll want to know about that a bit down the track.  I'll write some
stuff tonight for you and hopefully have it for you tomorrow.    It's
Saturday night and i dont have anything to do.  (jeez i'm OLD
already!!)

Man you've come a long way in a short time - from being in the
ColdFusion stone age (i.e. CF4 wasn't it?) only a few months ago, now
you're moving up to the cutting edge.    Believe me, when i jumped
into this OO pool, it revolutionised the way i write applications, and
made possible  - even easy - things i'd have scratched my head about
in the old days, thinking that was beyond my capabilities.

Cheers
Mike Kear
Windsor, NSW, Australia
Adobe Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month



On Sat, Jun 21, 2008 at 2:17 PM, Rick Faircloth
<[EMAIL PROTECTED]> wrote:
> Wow, Mike!  Thanks for the great intro primer!
>
> I'd be happy to look at your CFC's.  Perhaps they would clarify
> my understanding.
>
> I really just need to see an example from start to finish of a situation
> where there's a db, say "myDatabase", see how that is initialized with
> the "init" function, see how createObject is used in relation to
> functions within a CFC, and how the data is output.
>
> Some of that I'm grasping.  But I haven't been able to put together
> functioning, start-to-finish, code yet.  I'm using CFC's, but so far
> I can only make them work with <cfinvoke>... I seem to understand the
> code more intuitively.
>
> But the idea of putting objects into memory using createObject is
> fascinating and I hope I can get that working.  I'm having to do this
> "on-the-fly" however...trying to learn this on a current,
> "should-have-been-done-yesterday" project, so I have little time for
> trial and error.  (A frustrating way to work and, especially, to learn!)
>
> Anyway, whatever you care to share is appreciated!  And thanks again for
> taking the time to type up the primer!
>
> Rick
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307897
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to