What is in eiffel the best way to have a constant which can be redefined?
- class A => color: STRING = "green"
- color B inherit A => cannot redefine
while having a function which only returns "green" or "blue" needs the string to be created again, performance problem or doesnt matter?
As far as I understood, the onces cannot be redeclared...
Once features can be redefined as any other features. The example would be
Also, manifest strings themselves can be defined as once:
The behavior in both cases is identical, so you can even mix both variants. The performance might be different but only marginally. In both cases new strings are not created on every call.