After reading a recent post regarding the delights of object/class based development it spurred me to use them in my own projects. I was previously using records and separate functions and procedures. What I'm wondering is how small is too small for an object. Here's my class for my logger that records all goings on within the game (it's very basic but that's half my point):
Is it really worth me creating a class with just 2 fields and 2 procdedures (Not including Create and Destroy of course)? How small is too small?Code:type TLog = Class LogFile: TextFile; MessageStr: String;//Last message logged public constructor Create(Filename: String); destructor Destroy;Reintroduce; procedure AddLog(Msg: String;Fatal: Boolean);//A fatal error will always result in a report procedure Report(Msg: String); end;
Bookmarks