Re: Structure of a Delphi app.
Posted by webmaster Guido on May 26, 2003
In Reply to: Structure of a Delphi app. posted by Mac on May 26, 2003
: Hi! I'm attempting to write an application using Delphi and I am somewhat uncertain of my coding style. I find that all the code for my application is in the same file, i.e. not like C++ whereas each class usually represents a file. I find there is not much structure to my application. Can anyone give me a little light on this subject? Are there any good Delphi books/tutorials I can read that could help me with this?
As you probably know already, for a GUI (Windows) application written with Delphi you always have a project file (.DPR), maintained for you by Delphi. Further on, for each form of the application, there is a unit file (.PAS) and a form file (.FRM). In fact, the files for the forms each define a class (the class TForm1, TForm2, and so on), and the .DPR file describes the program that creates objects from these classes.
But these are not fixed rules. E.g., for a small project where you have only one form (the main form), it's often easier to put everything in one single unit.
[ DelphiLand: free Delphi source code, tips, tutorials ]