Blog

Luis Majano

July 13, 2009

Spread the word


Share your thoughts

This topic has been going on for a while, where some people have come up with the idea of having a private request collection that is unaffected by the incoming URL/FORM/REMOTE variables but still have access to it via the request context object.  You already CAN do this by just building a simple request context decorator.  However, some people think that this could be a cool core addition.  I am starting to think so also, so here are my thoughts on the topic.

The purpose of this post is for all ColdBox users to have an opinion on this feature and brainstorm as a community.

The request context object will be modified to support an internal private collection that can be accessible by the following methods; basically the same methods for the normal collection but with a private argument:

  • valueExists(key,[private:boolean='false'])
  • setValue(key,value,[private:boolean='false'])
  • getValue(key,[default],[private:boolean='false'])) and getTrimValue()
  • paramValue(key,value,[private:boolean='false'])
  • removeValue(key,[private:boolean='false'])
  • getCollection([private:boolean='false']) or getPrivateCollection()
  • clearCollection([private:boolean='false'])

Also, all views and layouts inherit an 'rc' scope for easy request collection access.  Now, a secondary scope will be added in order to leverage the separate private collection, so help choose the name:

  1. prc
  2. privateRC
  3. private
  4. $rc (MyFavorite)
  5. None of the above? Then put a comment for it?

That's it folks.  This is the roadmap for this feature.  What do you like, what don't you like? What would you change? What would you like to see?

Add Your Comment

(5)

Jul 14, 2009 00:15:00 UTC

by Will B.

I would absolutely like to see this. There are a lot of things that we put into RC to have them available to various area that really aren't form/url/etc. Things like objects, data structures related to layout, client customization. I'm big on this. I don't care for the $rc style, but "prc" would be pretty awesome. Or privateRC, or even CUSTOM via a setting, if possible. (Maybe not the best thought.) - WB

Jul 14, 2009 01:29:11 UTC

by zac spitzer

an interesting spin would be to make this private scope also accessible via the normal rc scope, but taking precedence over the rc scope i.e. if rc.userID and $rc.userID are defined, the later would be returned?

Jul 14, 2009 09:04:00 UTC

by Will B.

@Zac: To my way of thinking, that is irrelevant. You cannot access RC scoped variables without the 'rc.' prefix now. The way I understood it, there's be rc, rc1, rc2, rcn or whatever. Probably not numbered, but you get the idea. Unlike form, url, and variables, the "rc" scope is not built in, therefore not implicit.

Jul 14, 2009 11:00:54 UTC

by Luis Majano

@zac, Although interesting, this would just be a performance hog. I think separation is key. I like that 'rc' is implicitly created already, so by prefixing it with a $, means it is private, plus they stand out more. $rc.xeh

Jul 14, 2009 14:39:27 UTC

by Erik-Jan Jaquet

I think that will be an addition of great value. Like Will, we put a lot of objects etc in the RC scope that will perfectly fit in a private collection. For the time being I will look into a request decorator, also a great idea. As for your questions, I like getPrivateCollection a lot. I also like prc or PrivateRC. I am not sure if I like the $ idea, because to me this is confusing with JQuery, which I use a lot. I know one is J and one is CF, but on a quick glance in the code, it can look confusing, in my opinion.

Recent Entries

Must-See Into the Box 2025 Sessions for CommandBox Users!

Must-See Into the Box 2025 Sessions for CommandBox Users!

Power Up your CommandBox experience and practices at Into the Box 2025

Want to get hands-on with the new CommandBox features or learn how others are pushing it to the next level? These are the must-see sessions at ITB 2025 if you're a CommandBox user:

Maria Jose Herrera
Maria Jose Herrera
April 21, 2025
Must-See ITB 2025 Sessions for TestBox Users!

Must-See ITB 2025 Sessions for TestBox Users!

Are you a fan of TestBox or looking to level up your testing game in 2025? Whether you're just getting started with unit testing or you're already building advanced specs for ColdBox and BoxLang apps, Into the Box 2025 has an exciting lineup tailored just for you. Into the Box 2025 has an exciting lineup tailored just for you. With the recent launch of TestBox 6.3.0 we have amazing new tools, features and tips and tricks to get your testing experience to the next level, review our sessions and test like a pro efficiently and easy!

From hands-on testing strategies to BoxLang innovations, here are the sessions you won’t want to miss this May — and why they matter to you as a TestBox user.

Maria Jose Herrera
Maria Jose Herrera
April 17, 2025
The Into the Box 2025 Agenda is LIVE and Done!

The Into the Box 2025 Agenda is LIVE and Done!

The wait is over! The official Into the Box 2025 agenda is now live — and it's packed with high-impact sessions designed for modern CFML and BoxLang developers. Whether you’re building APIs, modernizing legacy apps, diving into serverless, or exploring AI integrations, this is the conference you’ve been waiting for.

Here’s a look at what you can expect — categorized by key topics to help you plan your learning journey, there’s something for everyone covering modern CFML tools and BoxLang:

Maria Jose Herrera
Maria Jose Herrera
April 15, 2025