Hi fabianoallex, do you have plans for including documentation about opcb development? (For example, do you have consistent ontology? Is there any difference between With... vs Set.. functions?)
Also, may you elaborate why avoiding .lfm files is a feature for your usecases?
Yes, my goal is to improve the documentation and examples.
In general, the “With” prefix is used in Builder classes, indicating that the object will be created with certain settings. The “Set” prefix, on the other hand, is used when changing properties of an already existing object.
For example, in the Creator, there is a method called WithOwnerAndParent, which indicates that objects added via .Add will be instantiated with the Owner and Parent passed as parameters. Meanwhile, SetDirection modifies the internal Direction property of the Creator, which is used to determine the direction of the next components to be created.
It’s possible that some methods were named with less appropriate prefixes, and this might be refined in a future review.
As for avoiding the use of .lfm files, this is mainly a project design decision. However, there are practical advantages to not relying on those files, such as:
- Better compatibility across different IDEs (Lazarus/Delphi or between different Delphi versions).
- Support for dynamic UI generation (runtime customizable interfaces).
- Fewer conflicts in version control systems.
- Improved portability.
- Easier UI testing.
These benefits may vary depending on the context, but the main purpose of the library is to provide an additional option, not to impose a restriction.
The use of the library does not mean that the entire project must abandon the use of .lfm (or .dfm) files.
It is perfectly possible to combine the traditional approach with specific functionalities where you might want more flexibility to create components or controls at runtime.