3 ms·
To some extent I think that's true of any templating system in a language with object oriented support. I don't use Java to be familiar with how the underlying
by mhitza 5y ago
To some extent I think that's true of any templating system in a language with object oriented support.
I don't use Java to be familiar with how the underlying OGNL library does things; it's obviously there to make property access patterns and chaining on objects easier within template languages. But I think a thing like this is easy to pass a code review because the difference between $ and $! is minimal. If it had a name like eval it would be easier to spot and make a reviewer think for a second. That would be more likely to be caught even in an environment where there is the pressing urge to push out code fast.
I can only assume that a developer that is not in a hurry could have done something like (inventing Velocity template syntax here)
$someobject.handle($queryString)
Where the underlying object associated with $someobject has a handle method with a switch statement that based $queryString values does the proper property chain access. As much as PHP is harped on so often, this was the most important lesson PHP developers had to learn early, to run a switch statement on query strings when including files. (in the days before routing was a solved problem)