Re: "Designated Initializer" pattern
Re: "Designated Initializer" pattern
- Subject: Re: "Designated Initializer" pattern
- From: Michael Rothwell <email@hidden>
- Date: Tue, 16 Mar 2004 23:32:05 -0500
I suppose it is just "structured programming" and the term could be
"wrapper functions" -- which is what I've been calling them.
Wrappers could be coded to have other effects and simply hard-coding
certain arguments, such as calculating some of the arguments and
passing through others, etc. When it's appropriate, I make one (or a
small number) of "fat" functions to handle well-defined areas of
functionality, and wrap it with a number of convenience methods.
"Service facade" doesn't quite fit as a "pattern name." Indeed, this
programming methodology may not rise to a named pattern. It's sometimes
easier to communicate to other programmers (such as my co-workers) when
good terminology is available. My co-workers are ... VB programmers ...
so I'm having to train them to program well, including re-iterating the
basics of structured programming. </PityMe> Today, I headed off some
needless code duplication at the pass by explaining, basically,
"wrapper functions."
If "wrapper functions" is the best term there is, I'll use it.
Michael Rothwell
email@hidden
On Mar 16, 2004, at 6:41 PM, Reed Hedges wrote:
>
Um, "structured programming" ??
>
>
Maybe "wrapper functions" if you're being fancy?
>
>
Do I misunderstand what exactly you mean...
>
>
int foo(int x, int y, int z, bool flag) {
>
... ...
>
}
>
>
int bar(int x) {
>
return foo(x, 0, 0, 0, false);
>
}
>
>
int baz(int y) {
>
return foo(23, y, 42, true);
>
}
>
>
right?
>
>
Pretty basic stuff, probably no one has formalized it as a pattern...
>
>
>
On Tuesday, March 16, 2004, at 04:32 PM, Michael Rothwell wrote:
>
>
> Is there a more generic name for code that follows the "Designated
>
> Initializer" pattern? This pattern -- one "master" function that
>
> simpler,
>
> related functions call -- can be used for functions that are not
>
> initializers. Is there a more generic name for the pattern than
>
> "Designated Initializer?"
>
>
>
> Something like "Designated Handler?"
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.