After having explored PropertyDepot ideas, it seems that a nice feature for VP would be a compiler directive that could automatically insert the property getters and setters into the implementation file.
That would make a database of properties less important.
interface myClass
properties[autoProperty]% automatic code appended to myClass.pro
tally :integer:=0. % count of everything
total :real. % sum of everythingproperties% no code generation
textColor :::color.
bgColor :::color.
centerText :boolean.
end interface myClass
Implement myClass
...
% This PROPERTY code is maintained automatically, do not update it manually.% 11:56:28-10.2.2023facts% for autoProperties
...
clauses% for autoProperties
...
% end of automatic PROPERTY codeend implement myClass
Well, I have two "problems" with this suggestion. First of all it is a strict rule that implementation details are written in the implementation; interfaces only defines the interface.
Secondly, the suggested auto code has exactly the same effect as implementing the property with a fact:
Implementing a property using "getters" and "setters" mainly makes sense, if you want some other functionality than the plain get/set functionality. But in that case the code will be different from the auto code and then it cannot be maintained automatically.
Unfortunately, that dream will not come through. Interfaces define the interface of objects the implementation is written in the implementation. Also recall that though you think of a class and interface together, a single interface can be used for many classes.
Likewise a class defines the "interface" of a class, the implementation is written in the implementation.