Removing the client scope possible?

I’m trying to modernize a very old CFML application. It was written before there were better alternatives to Adobe® ColdFusion®. An unfortunate decision was made to create a domain entity named “Client”. This causes generated components to use a conflicting local variable named client. Lucee is unhappy with this naming clash.

Is it possible to configure Lucee so that it does not consider client a scope that conflicts with a local variable of the same name? If that was possible, it would save so much headache in upgrading to Lucee.

I prepared a demo of the behavior in Lucee vs. Adobe® ColdFusion®. There is content in the readme with the results of each running the code with this.clientManagement set to true or false. GitHub - lamoreesoftware/cfml-client-scope: Demonstration project for issues with client scope

Thank you.

I can understand your anguish. After decades as a developer, I have been in a similar situation a number of times.

My advise is not to solve this by configuring Lucee to ignore the client scope (even if that is possible) . Such a solution will hold your application hostage.

Developments in application servers such as Lucee and Adobe ColdFusion are beyond your control. The day might come when the application server wants to drastically change the behaviour of the client scope. On that day your application would face exactly the same problem as it is facing today.

I would suggest to you the solution that I myself used. Namely, bite the bullet. How?
For example, plan and invest in a project to rename the variables appropriately. That should result in a long-term, once-and-for-all solution. Time after time, that proved to be the least expensive solution in the long-run.

1 Like

You are correct. Renaming the variables would be the right solution. Indeed, we decided in 2012 to do that. No progress has been made.

To solve this problem, we’d need to change the database schema and ORM framework so that a domain entity isn’t called “Client”. The variable names to be changed are in the generated components of a library that was abandoned back when bacon took the internet by storm and Justin Bieber had a hit single on the charts.

Currently the application is locked to Adobe® ColdFusion®. I would much rather lock it to Lucee.

1 Like