jabrena/plinth✦ 精选0°

121-java-object-oriented-design

仓库创建 2025年2月9日最近提交 2 天前SkillHot 收录 20 天前
▸ 精选理由

针对代码臭味给出可执行重构建议,提升可维护性与可扩展性。

这个 Skill 做什么

审查并改进 Java 面向对象设计,应用 SOLID/DRY/YAGNI 等原则。

帮你审查和重构 Java 的面向对象设计,指出哪里违反 SOLID、DRY、YAGNI,以及修正封装、继承和多态的滥用。适合 code review、重构或改良类/接口设计时用到,能定位 God Class、Feature Envy、Data Clumps 等 code smell。会给出具体的改进思路(比如优先组合而非继承、缩小可见性、改进对象创建和异常契约),便于落地改造。

▸ 展开 SKILL.md 英文原文

Use when reviewing, improving, or refactoring Java object-oriented design, including applying SOLID, DRY, or YAGNI; improving classes and interfaces; correcting encapsulation, inheritance, or polymorphism; resolving God Class, Feature Envy, or Data Clumps; and improving object creation, methods, or exception contracts. Triggers include review Java OOD, refactor Java OOD, improve Java OOD, fix OOP misuse, and identify Java code smells. Part of Plinth Toolkit

开发编程Java面向对象重构通用
423
Stars
89
Forks
40
仓库内 Skill
+9
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/jabrena/plinth/main/skills/121-java-object-oriented-design/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/jabrena/plinth/main/skills/121-java-object-oriented-design/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Java Object-Oriented Design Guidelines

Review and improve Java code using focused object-oriented design references selected after assessing the request and affected code.

**What is covered in this Skill?**

- Fundamental design principles (SOLID, DRY, YAGNI)
- Class and interface design: composition over inheritance, immutability, accessibility minimization, accessor methods
- Core OOP concepts: encapsulation, inheritance, polymorphism
- Object creation patterns: static factory methods, Builder, Singleton, dependency injection, avoiding unnecessary objects
- OOD code smells: God Class, Feature Envy, Inappropriate Intimacy, Refused Bequest, Shotgun Surgery, Data Clumps
- Method design: p
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有