是否有一个术语来表示类中最重要的方法?

发布于 2024-09-26 08:53:36 字数 1436 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

长途伴 2024-10-03 08:53:36

在我看来,“核心方法”似乎足够简洁。

A 'core method' seems succinct enough, IMO.

仙气飘飘 2024-10-03 08:53:36

我还没有在软件中遇到过这种方法的“官方”术语。我认为基石方法是一个很好的建议。另一种是编排方法 - 因为它是使用其他几个较小的方法编排某些功能的方法。

请注意,如果这是关于一个对象,它隐藏了几个辅助实用程序或库,我会说它听起来像外观模式

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

じ违心 2024-10-03 08:53:36

初始化

也许在类的 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 the Initialize method.

护你周全 2024-10-03 08:53:36

这应该是公开

That should be public.

◇流星雨 2024-10-03 08:53:36

对我来说,听起来该方法包含该类的业务逻辑。其余的(初始化方法、实用程序等)只是管道或实现细节。

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.

请帮我爱他 2024-10-03 08:53:36

Main、init、execute 方法……都是不错的选择。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文