首页 > 代码库 > 给类命名的常用单词
给类命名的常用单词
在写面向对象程序代码时有时想不起来应该用什么单词给类命名,下面把一些常用单词列出来,供以后写程序时参考:
获取器或查询器:
GetterFinder
Accessor
验证器或比较器:
Checker
Matcher
Validator
Comparator
Sorter
修改器或编辑器:
Modifier
Updater
Adjuster
Editor
发送器或接收器:
Emitter
Sender / Receiver
Broadcaster / Multicaster
访问器或迭代器:
Visitor
Iterator
生命周期相关:
Loader
Parser
Constructor / Maker / Creator / Generator
Initializer
Register
Activator
Starter
Stopper
Destroyer
事件相关:
Listener
Producer / Consumer
Observer / Observable
Timer
封装或容纳:
Adapter
Wrapper
Container
Server
过滤器或拦截器:
Filter
Interceptor
单一功能:
Loader
Parser
Register
Descriptor
Formatter
Marshaller / Unmarshaller
Encoder / Decoder
Counter
Viewer
Locator
Accumulator
Recognizer
Scroller
Printer
Compiler
Cleaner
Reader / Writer
Buffer
Transformer
Collector
Converter
Connector
Packer / Extractor
Scanner
Linker
Mapper
Streamer
Scheduler
Enhancer
Renderer
Painter
Weaver
用户角色相关:
Signer
Owner
User
Member
Operator
Authenticator
代理类:
Proxy
Broker
Delegate
Gateway
监控,跟踪或探查器:
Detector
Profiler
Monitor
Tracker
Introspector
多线程相关:
Synchronizer
Blocker
Holder
Worker
辅助类或工具类:
Helper
Supporter
Util
Utility
Kit
Tool
Toolkit
创建或生成器:
Maker
Creator
Generator
Constructor
Builder
Supplier
Provider
Factory
选择器或决策器:
Chooser
Selector
Mediator
Arbitrator
处理器:
Resolver
Processor
Handler
Executor
管理或控制器:
Ruler
Controller
Manager
Ordinator
Leader
Master
给类命名的常用单词
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。