views:

126

answers:

8

I'm looking through some old code and realize there are a ton of "helper" methods in this class as well as a ton of fields that are set via dependency injection and configuration. All of these things are essentially used by one very important method in the class. Is there a proper term for this in software development? Can I refer to it as something like a cornerstone method or pivotal method ? Thanks in advance!

A: 

I haven't come across an "official" term for this kind of method in software. I think cornerstone method is a good suggestion. Another one is orchestrating method - since it is the method which orchestrates some functionality using several other smaller methods.

Note that if this were about an object which hides several helper utilities or libraries behind it, I would say it sounds like the Facade Pattern

MikeG
You mean a *class* rather than *object*, right?
CesarGon
Actually, I meant object - in that I was talking about an object at runtime. I know the difference between an object and a class :-). Thanks for the downvote though!
MikeG
+3  A: 

A 'core method' seems succinct enough, IMO.

mway
+1 I like "core method"; if I may add something, I think that a well-designed class may have multiple core methods, as long as they are cohesive and related to the semantics of the class. For example, a Stack class' core methods are probably Push, Pop and Clear.
CesarGon
Absolutely - sorry if the phrasing was ambiguous and suggested that it could only have one. A class could indeed have several core methods.
mway
Well, the *question* (rather than your answer) sort of assumed that there is a single "most important" method. Your answer didn't add ambiguity. :-)
CesarGon
After much refactoring and long nights (1:43 EST!) I'm writing "The Core Method" in a javadoc comment! Thanks to all who helped, glad we could have some useful discussion. Thanks to StackOverflow for hosting our conversations too!
Brian L.
A: 

Initialize?

Perhaps what might be found in a class's Initialize method might otherwise be in the constructor, except in this case like you have said, where the constructor is overloaded and there are many entry points. I'd assume that to tie these multiple points of entry together you would at some point pass the control over to the Initialize method.

cottsak
A: 

Main, init, execute method... All good options.

Fergal
A: 

That should be public.

Grozz
Yeah, some people just don't get it :)
Grozz
A: 

Refer to it as whatever you like. There is no widely-used term for this, as far as I'm aware. :)

musicfreak
A: 

Since in parliament we have many ministers who do a ton of helper stuff but their actions are co-ordinated by the Prime Minister, I suggest PrimeMethod(...) :-)

Noel Abrahams
A: 

To me, it sounds like that method contains the business logic for the class. The rest (initialization methods, utils, etc) is just plumbing or implementation details.

gustafc

related questions