Re: OOP style
- From: Ante Smolcic <supersmola@xxxxxxx>
- Date: Thu, 25 Aug 2005 18:30:21 +0200
In article <1124979309.755732.296890@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
schultz@xxxxxxxxxxxxxxxxxxxxxxx says...
> Just wonwdering what "real" programmers do... :)
>
> Several questions:
> 1) If you have a form, and then some subsidiary dialog boxes, do you
> create separate units for each of those dialogs, or do you make them as
> panels (so thay they're all part of the same unit) that you then
> display when needed?
Dialog, no panels.
> 2) If you have a procedure that is, say 200 lines long, do you break it
> down in to more modular methods (Extract Method refactoring)? How do
> you organize your unit if you have several "main" methods (like to
> respond to a Save button, and a Load button, and a Preview button) and
> a bunch of "helper" methods (if you have broken down your Save, Load,
> and Preview methods)?
Put that code in another unit and make sure it doesnt depend on the
form's objects. Keep the code in the form unit at minimum.
> 2.5) Is a Unit equivalent to a .java file in Java? Generally, do you
> have one class per file? Some of the code I've seen seems to act as
> though a unit is more like a package in Java (several classes stuck
> together in a single file).
Sometimes I keep smaller "helper" classes with the main one.
> 3) When you create a form, do you have a unit which simply validates
> input, and does other UI sorts of things, and then a separate unit that
> handles processing, like calculations, writing to the database, or
> formatting for printing (Model-View pattern)?
I do.
> Maybe it's just me, but I find
> myself reverting back to my evil days of spaghetti code
Delphi is not perfect. :)
--
Out... for... a... walk... bitch.
.
- References:
- OOP style
- From: swansnow
- OOP style
- Prev by Date: Re: OOP style
- Next by Date: Re: OOP style
- Previous by thread: Re: OOP style
- Next by thread: Re: OOP style
- Index(es):