After years of coding Delphi programs as untestable code in forms and datamodules, including global variables, and the only classes are the forms themselves, containing all the code I need for the form UI itself.
How would I convert the code to a set of classes that do the actual work? would I need to stop using the datasources/datasets and do everything in classes? do I need an ORM?
There's usually zero need for reuse of the code in the forms, so does it make sense to convert the logic to classes?
If I encounter a form (or other class) with too much responsibility, I usualy follow the pattern below:
There are situations where a single class is not enough, so it is no problem to create more classes. And these classes can have other classes to.
With these steps, you can tackle most of these problems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With