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
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.
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.
发布评论
评论(6)
在我看来,“核心方法”似乎足够简洁。
A 'core method' seems succinct enough, IMO.
我还没有在软件中遇到过这种方法的“官方”术语。我认为基石方法是一个很好的建议。另一种是编排方法 - 因为它是使用其他几个较小的方法编排某些功能的方法。
请注意,如果这是关于一个对象,它隐藏了几个辅助实用程序或库,我会说它听起来像外观模式
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
初始化
?也许在类的
Initialize
方法中找到的内容可能会在构造函数中找到,除非像您所说的这种情况,构造函数被重载并且有许多入口点。我假设要将这些多个入口点连接在一起,您会在某个时刻将控制权传递给Initialize
方法。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 theInitialize
method.这应该是公开。
That should be public.
对我来说,听起来该方法包含该类的业务逻辑。其余的(初始化方法、实用程序等)只是管道或实现细节。
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.
Main、init、execute 方法……都是不错的选择。
Main, init, execute method... All good options.