通用应用程序构建块的类名

发布于 2024-07-24 16:26:20 字数 846 浏览 3 评论 0原文

您是否厌倦了老旧的 Manager 和 Handler 类? 使用了所有...Thing、...Dingus、Doodad、...Entity、...Gizmo 或...Object 后缀? 我当然是并且确实如此。

所以在这里我想收集有用的类名。

我认为这篇文章描述得最好:

请勿使用“经理”或“助手”或 类型名称中的其他空单词。

如果您需要添加“管理员” “Helper”为类型名称,类型为 要么名字不好,要么名字不好 设计的。 很可能是后者。 类型 应该管理和帮助自己。

所以这里是前几个:

  • 邮箱
    • 处理消息传递
  • Messenger
    • 提供通知或其他类型的消息
  • 仪表板
    • 呈现数据
  • 渲染器
    • 聚合/构建数据

我不太确定将“Widget”放在哪里好还是坏? 另外,我目前正在搜索以下类的名称:

  • 使用服务器(Bouncer?)进行身份验证
  • 跟踪数据
  • 保留的更改并跟踪文档
  • 管理对话

Are you tired of the alway old Manager and Handler classes? Used all ...Thing, ...Dingus, Doodad, ...Entity, ...Gizmo or ...Object Suffixes? I certainly am and did.

So here I want to collect usefull Classnames.

I think this Article described it best:

Do not use “Manager” or “Helper” or
other null words in a type name.

If you need to add “Manager” of
“Helper” to a type name, the type is
either poorly named or poorly
designed. Likely the latter. Types
should manage and help themselves.

So here the first few:

  • Mailbox
    • Handles Messaging
  • Messenger
    • Serves Notifications or other kinds of Messages
  • Dashboard
    • Presents Data
  • Renderer
    • agregates/builds Data

I'm not really sure where to put "Widget" Good or Bad?
Also I'm currently searching for names for classes that:

  • Authenticate with a server (Bouncer?)
  • track changes on data
  • holds and keeps track of documents
  • manages Dialoges

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

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

发布评论

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

评论(2

眼眸里的那抹悲凉 2024-07-31 16:26:21

这是设计中有趣而又微妙的部分。 对我来说,随着设计和需求的变化,它会随着时间的推移而变化。

  • 使用服务器(Bouncer?)

SecurityGuard

进行身份验证

  • 跟踪数据

VersionTracker

的变化

  • 保存并跟踪文档

DocumentOrganizer、FileCabinet

This is a fun, yet delicate part of design. For me, it changes over time as design and requirement changes occur.

  • Authenticate with a server (Bouncer?)

SecurityGuard

  • track changes on data

VersionTracker

  • holds and keeps track of documents

DocumentOrganizer, FileCabinet

摇划花蜜的午后 2024-07-31 16:26:21
  • 保存并跟踪文档

说真的,DocumentManager。 没有什么是被切割和干燥的。 或者根据您的需要,只需List

  • Holds and keeps track of documents

Seriously, DocumentManager. Nothing is ever cut and dry. Or depending on your needs, simply List<Document>.

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