When I design in a similar context, I treat the application
scope as just another store of data, much like the database. From
this viewpoint, storing ord1234 in the database
and in Application.1234 is doing the same thing twice.
There is a second, perhaps, stronger, design consideration.
The variable Application.x could be applicable to your application
only if x passes what I call the "necessity" test. Does the
statement,
"My application's " , make sense when you replace by
a literal description of what x stands for? If so, then
Applcation.x could be of use to your application. If not, then x
should not be in the Application scope.
Some descriptions that pass the test are:
- data source
- number of visitors
- admin e-mail
Some descriptions that generally fail are:
- user's name
- order number
- shopping cart
Finally, my advice would be to generate random order numbers,
for example, like this
<cfset orderNumber = "ORD" &
Right(createuuid(),12)>,
and store them in the database alongside client data.
... View more