 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Corinna Guest
|
Posted: Thu Sep 01, 2005 3:30 pm Post subject: how do you organize code? |
|
|
With separating data stuff from form classes, you are going to end up with a
lot of units. It doesn't seem right to me to put all these units in the
same directory. Is there a standard or recommended way to organize units so
that related classes are together? For instance, in Java, you have a
package (which is really a subdirectory) where you can group related classes
together. Is there something similar in Delphi? Are there disadvantages to
this approach?
-Corinna
|
|
| Back to top |
|
 |
Wayne Niddery [TeamB] Guest
|
Posted: Thu Sep 01, 2005 4:39 pm Post subject: Re: how do you organize code? |
|
|
Corinna wrote:
| Quote: | With separating data stuff from form classes, you are going to end up
with a lot of units. It doesn't seem right to me to put all these
units in the same directory. Is there a standard or recommended way
to organize units so that related classes are together? For
instance, in Java, you have a package (which is really a
subdirectory) where you can group related classes together. Is there
something similar in Delphi? Are there disadvantages to this approach?
|
That kind of organization is purely up to you to decide - Delphi places no
restrictions. So in your project folder, you can create any number of
subfolders to any depth and, as you create new units, save them to any of
those folders. You can also save units to folders anywhere else, so if you
have classes that are intended to be common between different projects, then
it makes sense to save them in a common folder outside of a specific project
folder. Then each project can simply include those units. In this latter
case, rather than specifically adding the unit to each project, you would
typically add that common folder to the project's search path and then just
specify the unit(s) in the Uses clause as needed.
--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
RADBooks: http://www.logicfundamentals.com/RADBooks.html
Working for yourself is great because you get to work half days, and
you can choose any twelve hours you want.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|