Under Construction! |
|||||||||
In the beginning... When I first started I had an original template of the existing call logging system, so the skeleton of functionality was already there. I just had to improve on it. In reality though and if I were to program another application, I would stress the importance of planning. Even if you spend a whole week planning, it will still save you time in the long run. I cannot stress this enough. Considerations when planning a Cold Fusion application: 1) Who will be using your application? The first thing I had to understand is how to use cookies. Cookies are variables that are resident on the user browser machine. You can set them to time out at a certain time or if the time out is not defined, then the cookie expires when the user closes their browser This is the first pitfall I encountered... Originally, I used cookies for all my variables until the application kept growing and I needed more and more variables. The problem is that most browsers will only allow 20 cookies for each domain. Once that limit is reached, your variables will start to write over each other- a nasty situation to be in. To solve this problem and make your application truly scalable, you should use session or client variables supported by cold fusion. To set up the variables, you must first invoke the application.cfm page. This page allows all the pages in a directory and sub directories to use application/client/session variables. In your root directory of your application, create a page called applicaion.cfm and use the CFAPPLICATION tag to invoke the variables: <!-- application.cfm <cfapplication name="application_name" clientmanagement="no" sessionmanagement="Yes"> Where cleintmanagement enables use of client variables and sessionmanagement enables use of the session variables. Also in this file you can set up application variables which are variables that are available to every page in your application. The following is an example of an application variable: <cfset application.var_name = "value"> There is further information on variables and application files in the cfdocs. Session or Client Variables? The difference between session and client variables is as follows: Client variables: These variables live in the registry. Since it lives there, they are accessed faster, but have limited space. Session variables: These live in the server's memory. They are slightly slower, but do not have the size restrictions of the client variables. In my opinion, session variables are the way to go. I found this out because in my application, I have large text input fields holding thousands of characters of information. I then assign this information to a session variable to run through a spell checker. Originally, I had this set up with client variables, but if the text was too long I had errors. switching to session variables solved this problem. It is important to remember though that a combination of session, client and cookie variables may prove to hold the best solution for your application. Just be sure to take the time to think about what role the variable will play in the future and what extremes it may have to endure. |
|||||||||
|
|||||||||
|