程序接口设计 Skill

程序接口设计 Skill 由用户 user_e40a4360 发布,提供 API、模块边界、REST/GraphQL 端点、类型契约和前后端边界的设计指导,帮助开发者建立稳定的公共接口。

Read More
Graphql设计:为 AI Agent 准备的 GraphQL 设计 Skill

Graphql设计是 SkillHub 社区技能(@user_3c6cb52e/graphql-design-sh-4mq9ya,v1.0.0,dev-programming),简介为帮助 AI Agent 高效完成 GraphQL 设计相关任务,且 requires_api_key=false。本文基于 SkillHub 展示页与官方安装文档,说明定位、安装方式(提示词或 skillhub CLI 并指定 Cursor/Claude/Codex 等 skills 目录)、典型启用步骤,并提醒社区来源与公开资料未展开的细节需以安装后的 SKILL.md 为准。

Read More
Encapsulation in Java Classes: Hiding Internal Details, Exposing Only Necessary Interfaces

This article introduces the core of Java encapsulation: hiding internal class details and only exposing necessary interfaces to ensure data security and logical rationality. Encapsulation is implemented through access modifiers: using `private` to hide attributes (such as a student's `name` and `age`), which cannot be directly modified from outside; exposing interfaces through `public` methods (such as `setName` and `setAge`), with logical validation added within the methods (e.g., age cannot be negative). By comparing a wrong example (directly exposing attributes leading to illegal modifications) with a correct implementation (private attributes + validated methods), encapsulation can prevent data chaos (e.g., maintaining age within a reasonable range), achieve modularization (separation of internal and external), and enhance maintainability (internal logic changes do not affect the outside). Encapsulation is a foundation of Java's object-oriented programming. By hiding details and exposing secure interfaces, it ensures code robustness and is a key factor in writing high-quality code.

Read More