Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2012-04

Best practices on using classes for subroutine libraries

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Frank Church

When I need a variation in procedures (standalone, not a class or object procedure) I use across my applications, I often find it more convenient to create a copy the unit into the project folder and make the changes there. Sometimes they get merged back into the shared unit or am thinking now of using classes with procedures, without any data in them, so that I subclass them in the projects where I need to change them. Are the some good examples and some known good working practices on working with procedures in this way?

Frank Church ======================= http://devblog.brahmancreations.com

Reply by email

leledumbo
to Frank Church
I am thinking now of using classes with procedures, without any data

in them, so that I subclass them in the projects where I need to change them. Are the some good examples and some known good working practices on working with procedures in this way?

If you're used to OOP with FPC, you'll quite often create descendant classes from units available in standard distribution. For me, TStrings/TStringList, TFileSearcher and some other classes whose features need additional callback event to assign first are the one that I often use this way. I have no examples at hand now, but you shouldn't really need one I guess...

Reply by email