FROM : Michael Watson
DATE : Wed Jul 19 20:47:31 2006
I'm not a big fan of putting the standard methods in the header file,
either.
Let's say a co-worker has a class called "FVAwesomeWindow". The
header file indicates that it's a subclass of NSWindow. I don't need
to see -initWithContentRect:styleMask:backing:defer: and -dealloc in
the header file as well. It's an NSWindow subclass, so either those
methods exist and are being overridden, they're not being overridden
(and still exist, obviously), or there's a different method do
whatever (which would then appear in the header file, because it's
not a method in the common NSWindow class). E.g.,
- (void)initWithContentRect:(NSRect *) withSomeAttribute:(Something *)
foo; // FVAwesomeWindow is a special window is always a panel that
floats and has XYZ attributes, but we always want to set
SomeAttribute at creation, so this is how we roll.
But if the FVAwesomeWindow just uses the standard NSWindow init
methods, there's really no reason to clutter up the header file with
that information. We know it's there, it's an NSWindow subclass. The
absence of any special custom init method(s) means that it uses the
normal init methods.
My thoughts, anyway.
--
Michael Watson
On 19 Jul, 2006, at 14:34, Scott Ribe wrote:
> Well, that's a matter of style. Argument 1: all methods implemented
> should
> be declared in the header, so that by looking at the header one can
> tell
> what methods a class implements--in theory I agree. Argument 2:
> commonly-overridden methods (think dealloc for instance) just
> clutter up the
> header without providing any real info.
DATE : Wed Jul 19 20:47:31 2006
I'm not a big fan of putting the standard methods in the header file,
either.
Let's say a co-worker has a class called "FVAwesomeWindow". The
header file indicates that it's a subclass of NSWindow. I don't need
to see -initWithContentRect:styleMask:backing:defer: and -dealloc in
the header file as well. It's an NSWindow subclass, so either those
methods exist and are being overridden, they're not being overridden
(and still exist, obviously), or there's a different method do
whatever (which would then appear in the header file, because it's
not a method in the common NSWindow class). E.g.,
- (void)initWithContentRect:(NSRect *) withSomeAttribute:(Something *)
foo; // FVAwesomeWindow is a special window is always a panel that
floats and has XYZ attributes, but we always want to set
SomeAttribute at creation, so this is how we roll.
But if the FVAwesomeWindow just uses the standard NSWindow init
methods, there's really no reason to clutter up the header file with
that information. We know it's there, it's an NSWindow subclass. The
absence of any special custom init method(s) means that it uses the
normal init methods.
My thoughts, anyway.
--
Michael Watson
On 19 Jul, 2006, at 14:34, Scott Ribe wrote:
> Well, that's a matter of style. Argument 1: all methods implemented
> should
> be declared in the header, so that by looking at the header one can
> tell
> what methods a class implements--in theory I agree. Argument 2:
> commonly-overridden methods (think dealloc for instance) just
> clutter up the
> header without providing any real info.
| Related mails | Author | Date |
|---|---|---|
| Vinay Prabhu | Jul 19, 08:32 | |
| Shawn Erickson | Jul 19, 08:40 | |
| Dix Lorenz | Jul 19, 08:43 | |
| Finlay Dobbie | Jul 19, 13:50 | |
| Dix Lorenz | Jul 19, 14:02 | |
| Vinay Prabhu | Jul 19, 14:04 | |
| Scott Ribe | Jul 19, 20:34 | |
| Michael Watson | Jul 19, 20:47 | |
| Dirk Stegemann | Jul 19, 21:39 | |
| Chris Stewart | Jul 19, 23:04 |






Cocoa mail archive

