Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定以下要求:我想同时将代码注入到一个类和伴随对象中。
原因是数据库功能:delete 方法应该在实例级别,而 find 方法应该位于伴随对象中。
我想知道使用 1 个特征是否可以做到这一点?或者我的逻辑中是否存在一些基本的设计缺陷?
最诚挚的问候,
斯特凡