Re: Replacement for CFX_fMAKETREE

2002-08-11 Thread Joseph Flanigan

When moving to MX I could not get CFMAKETREE to work at all!! Nor would 
cfx_maketree handle QueryNew structures.

So I decided to dump the entire applette approach and switched to using 
javascript to display the tree. There is a script called omentree that is 
very easy to use. (just search in google for omentree).  I found for nodes 
less that 500, it was faster and no java engine to deal with and no CFIDE 
paths to configure and no Flash.  With a little study of the javascript, 
you can make changes to fit your application.

The one thing it requires is that whether node is a folder or not. When 
looking at our code that built the tree table, adding another field bit 
field called folder was easy to determine. Another requirement is that the 
display tree has one root. If the query sorts the name field in 
alphabetical order before sending to omentree it displays the names in that 
order. It actually does the serialization on the browser when a click is 
made on the folder.

Joseph

At 09:36 PM 8/11/2002, you wrote:
>Hi -
>
>I'm new to cftalk, although i used to participate a while ago, so aprdon
>me if this request is not new.
>
>I have decided to move my website to an ISP (God forbid) because I want
>CMX functionaly and I am tired of running my own self-built servers
>(it's too expensive and time-consuming, although you are the man in
>charge).
>
>The problem is I have chosen Crystaltech as my host. They offer
>excellent service, but on the bottom side they charge $10 per month to
>install CFX tags, which is beyond my budget since this is a non-profit
>site.
>
>Now, the ONLY cfx tag I need is cfx_fmaketree, as I depend on this to
>build the main cftree navigation for the site's content management
>system.
>
>Are there any good alternatives (CFML) to this tag? CF_MAKETREE simply
>doesn't work for me, it is unable to structure my query.
>
>Any help would be very welcome...if I can get this part to work I am
>finished with a week's worth of converting from CF5 to CFMX (it was
>quite a horrible task, after all - no code rewriting, but lots of
>database concatenation (from four separate dbs into one...)).
>
>With kind regards,
>Tormod Guldvog
>Editor, Hypography Sci-Tech
>http://www.hypography.com/
>
>
>
__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: CMS Solutions (Friendly URL's)

2004-01-02 Thread Joseph Flanigan
>  One needs short relevant file
>names in a short shallow URL corresponding to actual content in the
>document to make the biggest impact in the search engine rankings.

John:

  Your statement is interesting. Do you have some references that support 
your statement?

Joseph

>
>--

--
Switch_box
www.Switch-box.org
MediaFirm, Inc.
PO Box 2171
Loveland, CO 80539

[EMAIL PROTECTED]
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Favorite CF Variable Tricks and Techniques

2004-02-13 Thread Joseph Flanigan
At 11:46 AM 2/13/2004, you wrote:
>I wouldn't use a blanket request scope, changing all form and url to 
>request scoped variables.

Request scope is the best place to keep all actor message variables because 
like URL, FORM and FLASH structures Request structure is global.

The discussion might be, "Why should an application transform URL, FORM and 
FLASH to Request?" I have two responses to that question. First, security. 
All incoming messages should be checked for hack syntax, like 
cf_inputfilter. In our code, this is run before any application 
logic.  After the checks, all messages are moved to Request scope. This way 
any programmer working on the application does not have hack check 
attributes.

Second. Ubiquitous namespace availability for actor messages. This means 
that actor messages  exist everywhere and are available to any scope in the 
application.  On http://www.cflib.org/udf.cfm?ID=976  is a UDF, 
RequestInOut, that copies URL, FORM and FLASH to Request.IN structure. In 
doing so, the application programmer can focus on message content without 
concern for which input structure did CF use.

One topic not discussed much is the actor output structures. RequestInOut 
prepares Request.OUT structure for response messages to the actor. For 
example, in the FLASH interface, a statement, FLASH.Result = 
Request.OUT,   moves the application output to FLASH.  Even HTML style code 
benefits from Request.OUT structures when using separate display layers and 
logic layers.

I have heard the comment "overloading the request scope"   When programming 
for actor messages, this statement is nonsense. In fact, CF benefits from 
qualified variables. It is better to code, 
value="#Request.OUT.name#">

Understand, I am not saying use Request.IN or Request.OUT, that is a 
programming style. What I am saying it that Request scope, because it is 
global, is the best place to handle actor messages for both incoming and 
response messages.

Moving actor message to Attributes scope? If using the Request scope, that 
would be redundant.

>
>--
>[
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Switch_box

2001-03-30 Thread Joseph Flanigan



I would like to invite the members of cf-talk to visit www.switch-box.org 
to examine and comment on the Switch_box framework technique for Cold 
Fusion. The technique focuses on building agile applications by separating 
application structure from program functions. This separation then allows a 
data directed execution specification that navigates the structure to 
arrive at the function. The idea of data directed execution means an 
application can be flexible to change. Which in turn means that when a 
business rule changes to cause application changes, the application can be 
modified with less stress on the existing programming.

Here is a PowerPoint presentation on "Agile Programming in Cold Fusion"
 http://www.switch-box.org/tools/library/docs/Agile_Cold_Fusion.ppt

If you don't have a PowerPoint viewer you can download at:
http://office.microsoft.com/2000/downloaddetails/Ppview97.htm


Thank you

Joseph Flanigan
--
Switch_box
www.Switch-box.org
MediaFirm, Inc.
PO Box 2171
Loveland, CO 80539

[EMAIL PROTECTED]


~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Switch_box

2001-03-30 Thread Joseph Flanigan

The www.switch-box.org site is basically freeware with the standard 
copyrights caveats.

The site is for technical demonstration of the concept. Generally, the code 
is open source.

There are no products for sale on the site.

You can make a production site using Switch_box.

To run a Switch_box site you need:
   Custom tags:
formURL2attributs.cfm from fusebox.org
switchbox.cfm from switch-box.org (free, open source)

The free Build-Your-Own-Box (BYOB) wizard will generate site ready Cold 
Fusion code based on the structure of your application. It is a very very 
fast way to build an application. Just cut and paste the results into 
Studio, save the different files to your site and execute.

Fusebox applications can be coded in Switch_box.

More questions?
Joseph


At 09:24 AM 3/30/2001, you wrote:


>I would like to invite the members of cf-talk to visit www.switch-box.org
>to examine and comment on the Switch_box framework technique for Cold
>Fusion. The technique focuses on building agile applications by separating
>application structure from program functions. This separation then allows a
>data directed execution specification that navigates the structure to
>arrive at the function. The idea of data directed execution means an
>application can be flexible to change. Which in turn means that when a
>business rule changes to cause application changes, the application can be
>modified with less stress on the existing programming.
>
>Here is a PowerPoint presentation on "Agile Programming in Cold Fusion"
>  http://www.switch-box.org/tools/library/docs/Agile_Cold_Fusion.ppt
>
>If you don't have a PowerPoint viewer you can download at:
> http://office.microsoft.com/2000/downloaddetails/Ppview97.htm
>
>
>Thank you
>
>Joseph Flanigan
>--
>Switch_box
>www.Switch-box.org
>MediaFirm, Inc.
>PO Box 2171
>Loveland, CO 80539
>
>[EMAIL PROTECTED]
>
>
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: OT But Urgent - SQL Server maxing out CPU??????

2001-04-08 Thread Joseph Flanigan

A client had something similar a while back. It turned out that transaction 
locks were not
being closed. You might check the locks under current activity.

At 12:27 PM 4/8/2001, you wrote:
>Hi all
>
>Sorry for the OT post, but I REALLY need some help on this one -
>
>We've got a reasonably beefy Win2K server (dual P-III 500MHz, 640MB RAM)
>which has CF 4.5.2 and SQL Server 7.0 on it. We've got all the latest
>service packs, latest MDAC drivers, no unlocked writes to App variables, we
>don't use session variables, we use query caching with a max of 200 cached
>queries.
>
>It's been running fine for two months, with no problems - managed to go
>without a reboot for a whole six weeks - then last week, all of a sudden,
>the SQL service started maxing out the CPU. I've had a similar situation
>where I inherited some appallingly written old sites that were written
>before I joined the company, with unlocked writes to app variables all over
>the place. They killed the server almost every day, but the problem stopped
>as soon as I fixed them, and in that case it was the CF service that maxed
>out, NOT the SQL service. There's nothing on this server except new sites
>with all app variables locked.
>
>Now the puzzler is that nothing has changed on the machine in the last four
>weeks. The highest number of simultaneous web users on it was 30, so it's
>not being hammered hard or anything. We do run some pretty complex queries
>and stored procedures, but I spent two days last week optimising everything,
>and it's still dying.
>
>This is the real killer - as soon as we stop the SQL service, the CPU usage
>goes back to normal (10-20%), and the memory usage returns to about 200M.
>But, as soon as we start the SQL service again, it goes right back up to
>100% CPU within about 2 seconds. We limited SQL to just using the one CPU,
>so we can just about keep the server alive, but only just.
>
>I'm tearing my hair out over this - why would the machine suddenly start
>dying when nothing has changed
>
>Anyone got any suggestions? Anyone? Please? HELP!!
>
>Alistair Davidson
>Senior Developer
>Rocom New Media
>www.rocomx.net
>
>"There is no spoon"
>
>
>
>
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



CF-SQL Code Generator Testers Needed

2004-02-21 Thread Joseph Flanigan
I am looking for some testers for a new code generation tool.

If you have CFMX and SQL Server, do I have a tool for you!

The Switchbox CF-SQL code generation tool rocks when working with database 
defined objects and namespaces.

Need a CFC for one or more stored procedures using CFSTOREDPROC?

Need to translate database defined namespaces back into your ColdFusion 
application?

Need to create insert and update stored procedures? And make them CF 
compatible?

Need a SQL insert procedure that returns Identity values?

Need to access several data source names for code generation?

Need to generate a CFC that has insert, select, update, delete and actor 
table wrapper functions using CFQUERY?

Need a database style guide?

Need a CFC to access INFORMATION_SCHEMA views?

Need code to handle actor request and response messages using a common 
namespace?

Need CF data structures defined by database table column parameters?

Need to generate 1000s of lines of code FAST!  Like taking all the stored 
procedures and making one CFC that has a CFFUNCTION for each procedure? Or 
generating CF namespaces for one or all the tables and views in the database?

Need to imbed best practices in your CF code?

Need to spend more time on database design rather than on ColdFusion coding?

Need a tool that all your programmers can use without special licenses for 
each programmer?

Demo at: 
http://www.switch-box.org/CFSQLTool/test1/

If you have CFMX and SQL Server 2000 and want to be a tester, send me a note:
[EMAIL PROTECTED]

--
Switch_box
www.Switch-box.org
MediaFirm, Inc.
PO Box 2171
Loveland, CO 80539

[EMAIL PROTECTED]
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




CFSQL Tool Test

2004-03-03 Thread Joseph Flanigan
There are still slots open for anyone wishing to help test a CF SQL Server 
code generation tool.

The tool will:
 look up data source names
 generate CFCs for one or more stored procedures using cfstoredproc in 
functions
 generate Insert and Update stored procedures
 generate CF namespaces defined by SQL table definitions
 build a CFC for a table that has functions for insert, select, update, 
delete and actor
 easy, easy to use and setup

See a beta 2 demo here:
 http://www.switch-box.org/cfsqltool/demo/

If you don't have time to test, I invite you to try the table wrapper CRUD 
wizard.
Be wild and crazy. Pick a table. Check off all the boxes. And hit generate.

Test requirements:
    Windows 2000
    CFMX 6.1
    SQL Server 2000

  Joseph

--
Switch_box
www.Switch-box.org
MediaFirm, Inc.
PO Box 2171
Loveland, CO 80539

[EMAIL PROTECTED]
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Software Life Cycle Development Templates

2004-03-04 Thread Joseph Flanigan
Ian:

In Switch_box, there is a free tool called the Logical Framework Tool 
(LFT). With it a project manager can design the application for structure 
of objects, methods, and actor messages using a tree menu. The tool allows 
multiple top levels called design. Using the tree, add objects nodes that 
form the structure of the application. And in each object, define nodes 
that name of the methods. Using the cut and paste tools, objects and 
methods can be moved from design to design or even within the design from 
level to level. There is even a code generator that will write all the 
structure templates and empty templates for the methods.

All the data from the LFT is stored in a database as a logical model. There 
is no need for XML models, template models, modeling languages or graphic 
drawings of the design. The framework is the tree. If some CF code is 
necessary, run the generator for object or method nodes. All members of the 
design team can work from the same on-line model. Because the model is kept 
in a database, the project manager has all the benefits of the database to 
manage, track, organized, plan and design. When an add, delete, change or 
cut and paste is done on the tree, the changes are made in the database. 
All records are stamped with who and when. Each node on the tree comes with 
a form that captures design information. Since the code is open source GPL, 
the forms can be changed to fit the user's business needs.

The real work in an application is in the methods. The LFT separates 
structure from function. Need to change the structure, change the tree. 
Structure can be automatically generated. That allows all programmer 
resource for methods. (With my new CFSQL tools, a lot of the method code 
for database can be generated with some checkbox selection.)

For software life cycle iterations, create a new top level design then copy 
the logical framework for the previous design and paste into the new 
design. All the sub-node object and methods from the old design are now the 
starting point for the new design while keeping the old design in tact. 
Switch_box itself is an object oriented execution (OOE) framework in which 
the execution instructions come from a request message. Each request 
message is compared to the logical model and runs the plan defined in the 
LFT model. The software cycle benefit to this strategy is reduction of the 
change cost using the OOE strategies from different designs by reusing the 
same structures.

Joseph

At 01:09 PM 3/3/2004, you wrote:
>I'm taking the "opportunity to excel" here at work and trying to bring 
>some order to our web application development.  For the last year we have 
>been a team of two experienced CF developers, the previous year there was 
>only one.  Pretty much working ad hock on projects as they came along with 
>little formal documentation.  A single developer was pretty much 
>completely responsible for each project.  This has worked well enough for 
>the mostly smallish projects we have done to date.
>
>Success has lead to more confidence by management and they are beginning 
>to authorize more ambitious projects that will be beyond the scope of what 
>a single developer can do in a reasonable amount of time.  Cool stuff with 
>1+ man years of development.
>
>To accommodate these projects our team is expanding.  We are adding 3 
>junior CF developers to the team. I believe we need to grow up and become 
>more professional.  Start applying a standard, formal software development 
>process.  Allowing multiple team members with different skill levels to 
>work on these large projects.
>
>What I'm looking for are Software Life Cycle documentation templates, 
>preferably free.  When I've tried to Google for this stuff I only find 
>examples that somebody wants to sell me (or even more costly entire 
>consulting packages).  I'm hoping some of you may have worked, or better 
>yet managed, larger teams responsible for creating ColdFusion web 
>applications and are willing and able to share some templates for 
>Requirements, Design, Detailed Design type documentation or maybe know of 
>a good resource where I might get these type of templates.
>
>Also any nice suggestions for basic information on web application project 
>management would be most appreciated.  I've had overviews of analysis and 
>design in classes, read about why formal processes good in many places, 
>but this will be the first time I've ever tried to be anything like a 
>"senior" developer after some seven years of mostly solo and duet work.
>
>scary, Scary, SCARY thought on many levels.
>
>Thanks for reading my combination plea/rant.
>Eternal thanks for any information.
>
>--
>Ian Skinner
>Web Programmer
>BloodSource
>www.BloodSource.org
>Sacramento, CA
>
>"C code. C code run. Run code run. Please!"
>  - Cynthia Dunning
>
>Confidentiality Notice:  This message including any
>attachments is for the sole use of the intended
>recipient(s) and may

Re: Using Stored Procedures in CF

2004-03-05 Thread Joseph Flanigan
Brian:

http://www.switch-box.org/cfsqltool/ is a new tool that makes working with 
CF and stored procedures easy. The tool works with CFMX and SQL Server.  We 
are still beta testing, but it will be GPL'd on the exchange when the 
testing is done. Because we are still testing, you may see some strange output.

Originally I wrote some CF to help do stored procedures for inserts with 
CF5. Since then it has expanded to this version what is CFMX.

If you are new to stored procedures or even experienced, the tool has a 
wizard for generating insert and update procedures. Another wizard can be 
run that will generate a CFFunction. It even documents the function by 
adding a copy of the procedure's SQL.

CFMX CFC's really makes working with stored procedures much easier than 
other CF versions.

So to learn the CF coding,
1. Make an insert stored procedure.

A. pick the MindTargetSQL database and run the Build Insert procedure.
B. The bottom left menu will load a list of all the tables in the DB.
C. Select a table -- tContacts
D. The table column selection menu will appear in the main exhibit frame.
E. Use the checked boxes the wizard picks and check the RS box for ContactID

The SQL code will show in a textarea box. This is ready for your DBA.

2. Build the CF Code.

A. In the top right frame select MindTargetSQL and User Stored Procedure 
CFC wizard.
B. On the left menu, choose pr_tContacts_INS
C. In the exhibit frame, click on Show Generated Code.
 (How about that? 3-click-coding. A new term. And a challenge.)

The popped  window has all the CF code to run a stored procedure and some 
pre-defined namespaces. While the code is CFMX, a few hacks and it can be CF5.

Now, one of the neat features of CFMX is the CFC.

Try this: back in the left menu, select all the pr_tContacts procedures and 
hit submit.

Wa-la in the exhibit frame pop window is a CFC with cffunctions for the 
procedures you just submitted.

Joseph


Joseph

At 07:12 AM 3/5/2004, you wrote:
>Hi all...In my 7 years of using CF, I have never used a stored 
>procedure.  Can anyone help me understand how I need to code it?  For 
>example purposes, lets just say I have 2 values that I need to pass to 
>it.  How would this be coded?
>
>Thanks much,
>
>Brian
>
>--
>[
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Frameworks

2004-03-11 Thread Joseph Flanigan
Bret-
  Switch-box is a framework. The CF5 version of the files are on the 
developer exchange. The all framework code works with CFMX6 and CFMX 6.1. 
The framework development tool will not work with CF6 because it uses 
CFTree. There the version on the exchange uses Access, but on request I can 
provide the same but using SQL Server. Also, the framework development tool 
uses _javascript_ instead of CFTree.

Switch-box gets little press largely because I don't spend  time promoting 
it.  Nevertheless here are some things to consider when choosing your 
framework.
  -- the single biggest problem with building a Web application is actor 
messages. It is not CF code, nor DB design, nor Web page layout, nor 
networks, nor performance.
  -- a message into a Web application is a trigger for some execution strategy
  -- Switch-box's premise is an Object Orient Execution strategy triggered 
by the message.
  -- Switch-box defines message vectors as the format for detailing the 
execution strategy.
  -- Switch-box enables semantic messaging by using named symbols for the 
message.
  -- Execution strategies are managed as database elements

In Switch-box 3.1, I introduced the Logical Framework Tool (LFT). This tool 
builds the entire execution framework as a logical model in database 
tables. This feature of putting the model in database provides an 
environment for managing the design and the messages.  The LFT has built-in 
copy, cut, paste, and generate for object nodes. The copy and paste means 
you can spend your time designing a execution plan in one design then move 
that design to another design. Since the design is a logical model, the 
design cost is nearly invisible. (If you do nothing else with the LFT, you 
might like to study the code for database nested trees and cut, copy and 
paste in trees.)

The LFT's code generation lets you build an implementation code-frame that 
demonstrates the logical design.  The code-frame uses the Switch-box custom 
tags. Since the LFT generates the code-frame, these tags require no extra 
programming.  In the Switch-box methodology,  structure is distinguished 
from function. Designers build the structure framework,  programmers 
build  the function.

Getting back to messages. When a request message arrives at the 
application, the code-frame goes to work. The first thing for the 
code-frame does is query the logical-frame to make sure the message request 
is defined and if so is it active and does the requester have permission. 
If these tests fail, in the logical-frame is redirection message. If the 
message is valid, then the execution vector is forwarded back to the 
code-frame for execution. The early test on the request message is a 
Switch-box feature that saves resources. It also allows building some 
business rules right into the framework itself.

Technical note. Switch-box message vectors use a dotted notation like other 
OO implementations. The difference is that the dot is a switch operator not 
a dot operator. File directory path slashes are closer to switch operator 
notions than dot operators.

Joseph

At 11:49 AM 3/9/2004, you wrote:
>Hi All-
>
>I know this was discussed a bit a couple weeks ago, but I would like to
>rehash it a little. I'm working for a local government agency here and
>to this point, there really has not been any sort of framework or coding
>standards present in the Web department. One of my first tasks is to
>help decide what framework to adopt, and also to be able to train the
>rest of the developers on it.
>
>I've used Fusebox for years and have been very happy with it, but at the
>same time I want to give everything a fair chance as I help this
>organization make the decision. I've done some googling and come up with
>the following frameworks for ColdFusion, and am wondering if any of you
>have experience, opinions, or additions with/to these frameworks.
>
>- Fusebox
>- MachII
>- Blackbox (http://www.cfblackbox.com)
>- BatFink (http://www.mossyblog.com/downloads.cfm)
>- onTap (http://www.turnkey.to/ontap/)
>- SmartObjects
>
>Thanks in advance,
>
>-Bret
>
>--
>[
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Frameworks

2004-03-12 Thread Joseph Flanigan
Yes. Good database design and efficient application interface is essential 
to a well functioning Web application that uses a database. There are 
thousands of techniques available to make great application. Perhaps your 
experience relates to applications that did not tap into those techniques.

In your reviews, what techniques and tools do you use to analyze and manage 
actor messages?

At 06:56 PM 3/12/2004, you wrote:
> > Switch-box gets little press largely because I don't spend
> > time promoting it.  Nevertheless here are some things to
> > consider when choosing your framework.
> >   -- the single biggest problem with building a Web
> > application is actor messages. It is not CF code, nor DB
> > design, nor Web page layout, nor networks, nor performance.
>
>Without commenting on the usefulness of switch-box, which I'm not qualified
>to do, I would disagree with your characterization of "the single biggest
>problem" with web applications. In my experience, as one who has reviewed
>hundreds of problematic web applications, the "single biggest" problem is
>all things database-related: database schema design, inefficient database
>access, insufficient caching of database records (and other generated output
>for that matter). Admittedly, I'm stretching to classify this as a single
>problem, but there it is.
>
>Dave Watts, CTO, Fig Leaf Software
>http://www.figleaf.com/
>phone: 202-797-5496
>fax: 202-797-5444
>
>--
>[
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Could not find the ColdFusion Component

2004-05-24 Thread Joseph Flanigan
Could not find the ColdFusion Component   - one fix I found for MX 61. on W2K

When trying to do CreateObject using Web root object notation like used in 
MachII, the error Could not find the ColdFusion Component occurred.  To 
make a long debug story short, the problem was with an  old CF mapping. In 
the CF Administrator mappings was a map, "/" to C:\Inetpub\wwwroot

This machine was upgraded from CF5, gosh knows the origin of the 
mapping.  A CFMX developer edition does not have this mapping.

The fix is to remove the / mapping.

Joseph



--
Switch_box
www.Switch-box.org
MediaFirm, Inc.
PO Box 2171
Loveland, CO 80539

[EMAIL PROTECTED]
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




CFMX-SQL Server CFC Code Generation Tool

2004-06-15 Thread Joseph Flanigan
General Availability of CFMX SQL Tool CFC Code  and Stored Procedure Code 
Generation Tool, Version 1.5+

MediaFirm's CFMX / MS SQL Server Tool is released for general use and 
available for download.

Download: http://www.switch-box.org/CFSQLTool/download License  is GNU-GPL, 
Open Source, without $ charge.
The download is a zip of about 200K.  -- There is lots of code to explore.

This tool sets a milestone for code generation!  It is packed with features 
that will save many hours of coding and debugging.

CFSQLTool is a set wizards for CF and SQL code generation and execution 
using SQL Server meta-data from tables, views and stored procedures
   - generates CFC, cffunctions and CF namespace variables
   - generates SQL and executes stored procedures
   - general purpose SQL batch tool for running SQL scripts.

Code generators require CFMX and SQL Server 2000. It uses CFFactory for 
data source name selection. The SQL Batcher feature can run with any CF 
data source. Minimum system is Windows 2000, IIS, CFMX 6.1 developer 
edition and SQL Server MSDE.

The wizards include:
    SQL Batcher - something like Query Analyzer but uses CFQuery.
    Table Wrapper - CFC generator with cffunctions for CRUD List and Actor 
using CFquery.
    Table Wrapper application - Generates a CF application that uses the 
table wrapper CFC
    Stored Procedure Suite - Generates CRUD stored procedures and loads 
procedures to DB, better than Query Analyzer
    Stored Procedure Wizard - Show, Run, Drop Procedures.
Generates CF name spaces 
defined by procedure variables
  Generates a CFC for stored procedures 
with cffunctions used cfstoredproc
Table Defined Name Spaces  - 
bangs out a collection of CF variable names defined by SQL Server data 
definitions

There are several pages of documentation including a SQL name spaces style 
guide.

Below is an image of the Table Wrapper Wizard Selector form. Its allows 
designing a suite of queries that generates a CFC using simple check boxes. 
It shows more detail about the table's constraints than other DB IDE 
tools.  The wizard counts generation iterations. This makes it easy to 
design multiple queries that can be cut and pasted into the Wrapper CFC.

The Stored Procedure Suite Wizard uses a similar selector form, but 
generates stored procedures instead. If you do stored procedures, it will 
not believe how easy it is do them with this tool!

SQL Batcher is a versatile tool just because it is easy to run SQL and see 
a CFDump of the results. SQL Batcher will load and run a .SQL batch file. 
In the download is an example contacts DB SQL batch file that SQL Batcher 
can run to build a contacts data base with tables and views. It runs the 
same in Query Analyzer as it does with SQL Batcher. The result report, 
counts each batch block, reports the execution time, code block executed 
and results.

219d07a2.jpg
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




CFSQLTool Q and A

2004-06-16 Thread Joseph Flanigan
These seems to be  common questions.
  What are Table Defined Data Structures?
  What are Table Wrappers?

Answers:

CFSQLTool at its heart is a namespace tool where the CF variable's 
namespace is defined by database names and datatypes for tables, views, 
columns and procedures, In effect, the tool  reverse engineers SQL data 
definitions (meta-data names and data types) into CF data structures and 
generates query functions using these data structures.  By using the same 
namespace definitions for both SQL and CF, the programming tasks are 
simplified because the names are the same.

Table Defined Data Structures. The table defined data structure wizard 
generates a list of different CF data structures that can be cut and pasted 
into CF code. The source for the CF structure names is defined by the 
database's SQL meta-data names.  ( My use of the word data structures is 
borrowed from the traditional meaning that considers all program variables 
to be data structures.)  The 3 most useful structures are:
  -- a named CF structure variable that matches the tables column's 
definition and named using the table's name
   -- Request.IN* - is a CF structure whose key names are the same as the 
table's column names. There are 3 reasons for this structure. First, 
looking backward from the database, the tool does not know which CF input 
structures would be used, the name is easy to search and replace, use of 
FORM, URL and FLASH input structures directly is not best practice.
   -- Request.OUT - like Request.IN. it's key names are the same as the 
table's columns. Its use is for sending replies back to the browser.
   * See http://www.cflib.org/udf.cfm?ID=976 for more information about 
Request.IN and Request.OUT.

Table Wrappers. The term CRUD refers to create (insert), read (select), 
update and delete. A table wrapper is a library of functions that has 
procedures for CRUD. The tool has 2 ways to build table wrappers.
 -- Stored Procedures. The stored procedure suite wizard helps build 
CRUD stored procedures for a table that can be added to the database. Then, 
using the User Stored Procedure Wizard, you can select the table's stored 
procedures and build a CFC.
   -- Ad hoc queries. CFQuery tags primarily are for doing ad hoc 
SQL  queries. The table wrapper wizard selector makes it easy to design 
CRUD functions into a CFC. In addition it builds functions for list, 
actor  in and actor out.

Both the stored procedure suite and the ad hoc table wrapper wizards allow 
changing cffunction names for any selector choices. By running the wizard 
multiple times, it is possible to quickly create a CFC wrapper that has 
many query functions. For example, consider a contacts table. The number of 
queries can be extensive. select by last name, select by state, update 
status, insert name, update name. The tool's wizards makes it easy to 
design and generate cffunctions for a table's wrapper CFC. The 
CFC's  cffunctions can be any mix of stored procedures queries and ad hoc 
queries.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: CF_ColoredCode

2004-10-16 Thread Joseph Flanigan
I edited the original cf_coloredcode make it a UDF. You can fine the UDF in 
the file SBTools_gbl.cfml as function colorcode(). Most of the code that 
the tool generates uses this function so it seems to work just fine.

Download here:  http://www.switch-box.org/CFSQLTool/Download/

Joseph

At 01:50 PM 10/15/2004, you wrote:
>Does anyone have (or know where I can download) the latest version of Dain 
>Anderson's CF_ColoredCode?  cfcomet.com is down...
>
>Thanks,
>
>Brad
>
>--
>[Todays Threads] 
>[This Message] 
>[Subscription] 
>[Fast 
>Unsubscribe] [User Settings] 
>[Donations 
>and Support]
>
>--
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Execute Query string w CFQUERYPARAM

2004-10-18 Thread Joseph Flanigan
The technique of assigning a SQL  query to variable and then resolving the 
variable in the cfquery is called the folded string technique. Since 
cfqueryparam is a sub-tag of cfquery it cannot be used in a folded string 
outside the cfquery. The function of cfqueryparam is to do data type 
binding between CF and the database. So forget trying to used cfquaryparam 
outside a cfquery. There are other approaches that work better.

1. Don't use cfquery for inserts, use stored procedures. Inserts, updates 
and deletes always work best using stored procedures. But that is not 
always an option.

2. Put the query in a cffunction and pass parameters to the query. By 
wrapping the query inside a cffunction and passing the insert values as a 
structure into to function uses pass-by-reference, there is minimum moving 
of  variable data and it still uses cfqueryparam for data binding.

3. Use SQL variables to build folded strings. If you still want to use 
folded strings, then build the string using SQL variables. For data 
binding, declare the SQL variable  and its  data type then set the SQL 
variable to the CF variable value.

Below are examples of both the folded string and the cffunction using your 
table example. I like the cffunction approach. It is what my CFSQLTool 
generates. In the tool is wizard for running stored procedure that uses a 
variation on folded strings. So both techniques work.

Joseph





DECLARE @product int
SET @product = #product#

DECLARE @c_productDesc varchar(50)
SET @c_productDesc = '#c_productDesc#'

DECLARE @active bit
SET @active = #active#

   INSERT INTO  tblProducts
 (
   product ,
  c_productDesc ,
   active
 )
   VALUES
 (
  @product,
  @c_productDesc,
  @active
 )




   #PreserveSingleQuotes(DansQuery)#




  
required="yes" >
  
   

  
maxrows=-1 >
   BEGIN TRANSACTION
   INSERT INTO tblProducts
    (
    [product],
    [c_productDesc],
    [active]
    )
    VALUES
    (
    
cfsqltype="CF_SQL_INTEGER" >,
    
cfsqltype="CF_SQL_varchar" >,
    
cfsqltype="CF_SQL_bit" NULL="#isNull(theParams.$active)#" >
    )

   COMMIT TRAN
  



At 08:33 AM 10/18/2004, you wrote:
>I have a variable that contains the following:
>
>Insert into tblProducts (product,c_productDesc,active)
>Values
>,
>,
>
>
>I want to execute this string inside a cfquery tag. 1st problem is,
>when I am building the string and looping over an array, if I try to
>use < and > in the string, my string ends up being empty. If I replace
>that with @lt; and @gt;, the string is built OK, as displayed abouve,
>but get an ODBC error on the @.
>
>I have played around with evaluating and DE, but cannot get past this
>point. Is this possible?
>
>
>Dan O'Keefe
>
>--
>[Todays Threads] 
>[This Message] 
>[Subscription] 
>[Fast 
>Unsubscribe] [User Settings] 
>[Donations 
>and Support]
>
>--
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Execute Query string w CFQUERYPARAM

2004-10-18 Thread Joseph Flanigan
 > Why it is better in your opinion to use stored procedures for 
insert/update/deletes?

The quick answer is that stored procedures are pre-complied execution plans.

To run in the  database engine, every SQL statement is compiled into 
something the database people call execution plans. These plans are the 
code that change and read data. Whenever a query is run that changes the 
structure of tables, efficient query plans result in the best performance 
of the database. A rule I follow is that if any changes are made that 
result in any table index being changed then use stored procedures. Insert 
and deletes always change indexes, most of the time updates do too.

SQL passed in a cfquery has to be complied into a query plan on the fly 
every time. (Yes some db engines can remember a previous ad hoc query but 
the DB still has to prove the previous is the same.)  Whereas, when using 
stored procedures, the CF/DB interface needs only to pass values and not 
the query and the values.

Likewise to insert, updates and deletes, any select query that uses 
un-parameterized joins should be a made a database view. A  view is a 
stored query, that is pre-complied execution plan. Rarely should a cfquery 
include join statements.

Joseph

At 02:47 PM 10/18/2004, you wrote:
>Joseph,
>
>I was just curious why it is better in your opinion to use stored
>procedures for insert/update/deletes?
>
>Aaron
>
>
>On Mon, 18 Oct 2004 14:41:22 -0600, Joseph Flanigan
><[EMAIL PROTECTED]> wrote:
> > The technique of assigning a SQL  query to variable and then resolving the
> > variable in the cfquery is called the folded string technique. Since
> > cfqueryparam is a sub-tag of cfquery it cannot be used in a folded string
> > outside the cfquery. The function of cfqueryparam is to do data type
> > binding between CF and the database. So forget trying to used cfquaryparam
> > outside a cfquery. There are other approaches that work better.
> >
> > 1. Don't use cfquery for inserts, use stored procedures. Inserts, updates
> > and deletes always work best using stored procedures. But that is not
> > always an option.
> >
> > 2. Put the query in a cffunction and pass parameters to the query. By
> > wrapping the query inside a cffunction and passing the insert values as a
> > structure into to function uses pass-by-reference, there is minimum moving
> > of  variable data and it still uses cfqueryparam for data binding.
> >
> > 3. Use SQL variables to build folded strings. If you still want to use
> > folded strings, then build the string using SQL variables. For data
> > binding, declare the SQL variable  and its  data type then set the SQL
> > variable to the CF variable value.
> >
> > Below are examples of both the folded string and the cffunction using your
> > table example. I like the cffunction approach. It is what my CFSQLTool
> > generates. In the tool is wizard for running stored procedure that uses a
> > variation on folded strings. So both techniques work.
> >
> > Joseph
> >
> > 
> >
> > 
> > 
> > DECLARE @product int
> > SET @product = #product#
> >
> > DECLARE @c_productDesc varchar(50)
> > SET @c_productDesc = '#c_productDesc#'
> >
> > DECLARE @active bit
> > SET @active = #active#
> >
> >   INSERT INTO  tblProducts
> > (
> >   product ,
> >  c_productDesc ,
> >   active
> > )
> >   VALUES
> > (
> >  @product,
> >  @c_productDesc,
> >  @active
> > )
> > 
> > 
> >
> > 
> >   #PreserveSingleQuotes(DansQuery)#
> > 
> >
> > 
> > 
> >   > required="yes" >
> >  
> >   
> >
> >   > maxrows=-1 >
> >   BEGIN TRANSACTION
> >   INSERT INTO tblProducts
> >(
> >[product],
> >[c_productDesc],
> >[active]
> >)
> >VALUES
> >(
> > > cfsqltype="CF_SQL_INTEGER" >,
> > > cfsqltype="CF_SQL_varchar" >,
> > > cfsqltype="CF_SQL_bit" NULL="#isNull(theParams.$active)#" >
> >)
> >
> >   COMMIT TRAN
> >  
> > 
> > 
> >
> > At 08:33 AM 10/18/2004, you wrote:
> > >I have a variable that contains the following:
> > >
> > >Insert into tblProducts (product,c_productDesc,active)
> > &

Re: Execute Query string w CFQUERYPARAM

2004-10-18 Thread Joseph Flanigan
  > Why it is better in your opinion to use stored procedures for
insert/update/deletes?

The quick answer is that stored procedures are pre-complied execution plans.

To run in the  database engine, every SQL statement is compiled into
something the database people call execution plans. These plans are the
code that change and read data. Whenever a query is run that changes the
structure of tables, efficient query plans result in the best performance
of the database. A rule I follow is that if any changes are made that
result in any table index being changed then use stored procedures. Insert
and deletes always change indexes, most of the time updates do too.

SQL passed in a cfquery has to be complied into a query plan on the fly
every time. (Yes some db engines can remember a previous ad hoc query but
the DB still has to prove the previous is the same.)  Whereas, when using
stored procedures, the CF/DB interface needs only to pass values and not
the query and the values.

Likewise to insert, updates and deletes, any select query that uses
un-parameterized joins should be a made a database view. A  view is a
stored query, that is pre-complied execution plan. Rarely should a cfquery
include join statements.

Joseph




~|
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.houseoffusion.com/banners/view.cfm?bannerid=11

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:181799
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Execute Query string w CFQUERYPARAM

2004-10-18 Thread Joseph Flanigan
 > I am curious do you make a SP for each query need.  Meaning for example 
do you have a separate SP for inserts that go into table A, B, or C.  Or do 
you have one single SP that handles all three based upon what is fed into it?

The simple answer is, yes every insert is its own procedure. Yes. every 
delete is its own procedure.  Yes, nearly every update is a procedure. Yep, 
that's a lot of procedures. Nope, it is not a programming problem. No there 
is not one procedure to handle alternate procedures.

This a good leading question as why I built  CFSQLTool  -- inserts -- and 
why each requires it's own procedure. Oh, there are people trying to do 
schema analysis of meta-data to do one-fit-all queries, but these seem more 
difficult to manage for support.  My approach with CFSQLTool was to make it 
as easy and as fast as possible to generate procedures. While, the tool 
does both stored procedure and ad hoc queries using the same techniques, 
stored procedures should be used for inserts and deletes.

CFSQLTool has something called an insert predictor. (I don't know of any 
other SQL tool that has this feature, it is what got me started writing 
CFSQLTool in the first place.)  The insert predictor looks at the schema 
for the table and makes a guess based on some simple rules to build a 
proper insert statement.

The insert predictor should always propose  a correct insert statement for 
the table based on the data model.  If the table uses identity columns as 
the primary key, the delete predictor proposes a delete statement.  Also, 
the update predictor overstates a proposed update statement but is accurate 
for editing.  The select predictor has no pre-defined constraints (where 
clause), these can be added with the user interface.

I designed CFSQLTool for programmers. It writes both cfquery and stored 
procedure style queries using checkboxes to modify code generation. This 
approach allows code design from the application prospective but still 
proposes queries based on the schema. Tools that exclusively use the schema 
for query proposals limit application design.

Joseph




~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=36

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:181806
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Execute Query string w CFQUERYPARAM

2004-10-19 Thread Joseph Flanigan
Mark thanks for the posting.

The article makes a couple of good points but does it does not dismiss 
performance gains. The article illustrates using select queries in 
unplanned manner.

When a procedure is complied, columns that depend on indexes are 
represented in the compile. These indexes become part of the execution 
plan. When a procedure is used in an unplanned manner, like the article 
describes, slower performance should be expected. Just from reading the 
information that the author presented, it appears the use of the indexes 
was in an unplanned manner.  At the end of the article the author modified 
the procedure to use case statements to regain the performance.

This is a very good article in that it demonstrates the importance of using 
execution plans that match query parameters.


At 08:02 AM 10/19/2004, you wrote:
>Hey - in regards to this topic I found an insiteful article in a Builder.com
>newsletter. Sometimes an SP doesn't give you the performance gains you think
>it could because of the query cache.  I couldn't find a link to it on
>builder so I posted it on my blog.
>
>http://blog.mxconsulting.com/
>
>-Mk

http://www.switch-box.org/CFSQLTool/Download/

Switch_box  MediaFirm, Inc.
www.Switch-box.org  Loveland, CO  USA


~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=34

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:181884
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Field Naming

2004-10-19 Thread Joseph Flanigan
The are so many options on which styles to follow, the approach I recommend 
is to pick a something, document it and follow your document.

For my clients that I do database design work for, as part of the 
deliverable, I give them a copy of the style guide we used to develop the 
database.

If you want to see the style guide we use, it is included with the 
documentation for CFSQLTool. To get you started, you may wish to take it 
and modify to meet your needs. I make no claims as to if it best or better 
practice, just that it works good for us.

There is no separate download for the style guide, but if you download the 
tool, ( http://www.switch-box.org/CFSQLTool/Download/  ) unzip the file and 
look in the docs folder you will find the file 
docs_Databases_Style_Practices.cfml

Create Table Pajamas,

Joseph





~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=35

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:181894
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Announcement. CFSQLTool 1.7 Available

2004-12-15 Thread Joseph Flanigan
CFSQLTool version 1.7 is available for download. It is still open source
and no charge. http://www.switch-box.org/CFSQLTool/Download/

This release includes a new  code generation wizard for building a CFC
Service that can be used to dynamically instance data access layer wrapper
CFCs by setting the wrapper CFC as an object of the service. There are some
other improvements.

The release note has more information.
http://www.switch-box.org/CFSQLTool/doc_1_7_ReleaseNotes.html




~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187785
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Thread-safe CFCs

2004-12-25 Thread Joseph Flanigan
What is the problem with using CFC this. variables? Are they not thread 
safe?  Where does MM document they are not thread safe? Is there example 
code that would cause a thread failure using this. variables?

Yes, the getter/setter proponents seem to think a function call is better 
CF and it is effective encapsulating. But for the code in me I cannot 
figure out why. It just seems to me that getter/setter for individual 
instance variables is a lot of extra runtime memory allocations, that in 
itself can cause memory leaks or thread failures.

Functions in a CFC have namespaces just like this. scope variables.  By CF 
definition, all function names are CF variable namespaces. The difference 
between public instance variables and private instance variables is when 
memory allocation occurs, loadtime or runtime. this. scope allocations 
happen at loadtime. Private variable allocation happen at runtime.

The CFC this. variables are an extremely powerful feature in a CFC. If the 
application uses CFC this scope, CFC variable namespace act as a 
pass-by-name reference. The getter/setter functions  most often use 
pass-by-value for individual instance variables. Whereas by using the CFC 
this. scope and simple expression statements, variable assignments conserve 
memory allocations because the CFC variable space is a CF data structure. 
(Note. Memory allocation is a runtime compiler function not memory use nor 
memory availability.)

The good old equal sign in a statement is really a built-in function that 
is an elegant "setter".  By adding user getter/setter  functions individual 
instance variables complicates CFC data structure. The difference between 
an equal expression and a function call is when memory allocation occurs. 
Equal-expression memory space happens at loadtime and for the most part is 
fixed for that application execution. Getter/setter functions force dynamic 
memory allocation at runtime which causes changes in the application memory 
stack. It is these changes in memory stacks that expose risks for thread 
failures.

Those of you who read this and who are encapsulation fans will not agree 
with me recommending the use of this. scope. So while I am on the topic, 
encapsulation means discrimination by design. It means declaring object 
definition and discarding all other possibilities.  getter and setters is 
not encapsulation, it just one of many means to effect 
discrimination.  Declaring a CFC defined with this scope instance variable 
is encapsulation by structure not by value.


At 12:34 AM 12/25/2004, you wrote:
>On Fri, 24 Dec 2004 21:26:18 -0600, Jared Rypka-Hauer - CMG, LLC
><[EMAIL PROTECTED]> wrote:
> > Right... This is for moving from say... the DB to the screen via a
> > single method call i.e. thisUser.get(12)
> > thisUser.fname
>
>You're relying on the public "this" scope in order to be able to
>directly access data members from outside the object. A lot of people
>think this is a bad idea and you should use "variables" scope instead
>and provide 'get' functions for the attributes:
>
>#thisUser.getFName()#
>
>This prevents accidental modification of data within the object.
>
> > where inside the CFC this.fName = query.fname and this.fName =
> > query.lName and init(12) is passing the table's pkey value (possibly a
>
>So you'd either say:
> variables.fName = query.fName;
> variables.lName = query.lName;
>or:
> setFName(query.fName);
> setLName(query.lName);
>if you used public or private set methods instead.
>
> > I've got that THIS thing down fine. I guess it's the difference
> > between private instance data and function-private variables that has
> > me a little puzzled.
>
>
> 
> 
> 
>
>
>None of x, y or z can be accessed from outside the object. x is
>created fresh for every call of foo() (and is therefore thread safe).
>y and z are created on the first call but the same y and z are updated
>on subsequent calls (for the same instance).
>
>If the instance is in application scope, x is still local but y and z
>are effectively application scope variables.
>
> > And even at that, I can see why one would choose to use function
> > private variables for somethings,
>
>"function local" - private means something else.
>--
>Sean A Corfield -- http://www.corfield.org/
>Team Fusebox -- http://www.fusebox.org/
>Breeze Me! -- http://www.corfield.org/breezeme
>Got Gmail? -- I have 6 invites to give away!
>
>"If you're not annoying somebody, you're not really alive."
>-- Margaret Atwood
>
>

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188785
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffus

Re: Thread-safe CFCs

2004-12-25 Thread Joseph Flanigan
What is the problem with using CFC this. variables? Are they not thread
safe?  Where does MM document they are not thread safe? Is there example
code that would cause a thread failure using this. variables?

Yes, the getter/setter proponents seem to think a function call is better
CF and it is effective encapsulating. But for the code in me I cannot
figure out why. It just seems to me that getter/setter for individual
instance variables is a lot of extra runtime memory allocations, that in
itself can cause memory leaks or thread failures.

Functions in a CFC have namespaces just like this. scope variables.  By CF
definition, all function names are CF variable namespaces. The difference
between public instance variables and private instance variables, besides 
scoping rules, is when
memory allocation occurs, loadtime or runtime. this. scope allocations
happen at loadtime. Private variable allocation happen at runtime. Function 
names are public variables, the
function internal variables are private.

The CFC this. variables are an extremely powerful feature in a CFC. If the
application uses CFC this scope, CFC variable namespace act as a
pass-by-name reference. The getter/setter functions  most often use
pass-by-value for individual instance variables. Whereas by using the CFC
this. scope and simple expression statements, variable assignments conserve
memory allocations because the CFC variable space is a CF data structure.
(Note. Memory allocation is a runtime compiler function not memory use nor
memory availability.)

The good old equal sign in a statement is really a built-in function that
is an elegant "setter".  By adding user getter/setter  functions individual
instance variables complicates CFC data structure. The difference between
an equal expression and a function call is when memory allocation occurs.
Equal-expression memory space happens at loadtime and for the most part is
fixed for that application execution. Getter/setter functions force dynamic
memory allocation at runtime which causes changes in the application memory
stack. It is these changes in memory stacks that expose risks for thread
failures.

Those of you who read this and who are encapsulation fans will not agree
with me recommending the use of this. scope. So while I am on the topic,
encapsulation means discrimination by design. It means declaring object
definition and discarding all other possibilities.  getter and setters is
not encapsulation, it just one of many means to effect
discrimination.  Declaring a CFC defined with this scope instance variable
is a means of encapsulation by structure not by value.


~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188786
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54