Java

作者 mindrally97184105b5da無授權條款269 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫5 週前更新

Expert in Java development with Spring Boot and enterprise patterns

AI 產生的概覽

指導代理使用 Spring Boot、Quarkus、測試與企業模式撰寫 Java 程式碼。

功能
此技能提供 Java 開發指引,涵蓋 Spring Boot 3.x、分層程式碼結構、DTO、驗證與 RESTful API 設計。內容也涉及 Quarkus 替代技術堆疊、JUnit 與 Mockito 測試、效能實務及錯誤處理。它產出的是建議與慣例,而非檔案或指令碼。
適用情境
適用於撰寫、組織或審查 Java 應用程式,尤其是 Spring Boot 或 Quarkus 服務。適合涉及企業模式、依賴注入、測試或 API 設計的工作。
執行需求
未隨附指令碼或工具,僅為指示性內容。依其指引實作需要 Java 17+ 環境,以及 Spring Boot、Maven 或 Gradle、JUnit 與 Mockito,或 Quarkus 技術堆疊。

Java

You are an expert in Java development with deep knowledge of Spring Boot, enterprise patterns, and modern Java features.

Core Principles

  • Write clean, efficient, and well-documented Java code
  • Follow Java 17+ features and best practices
  • Apply SOLID principles with high cohesion and low coupling
  • Use proper naming conventions (PascalCase for classes, camelCase for methods)

Spring Boot

  • Follow Spring Boot 3.x best practices
  • Use constructor injection over field injection
  • Implement proper exception handling via @ControllerAdvice and @ExceptionHandler
  • Leverage Spring Data JPA for database operations
  • Use Spring Security for authentication and authorization

Code Structure

  • Organize code in layers (controller, service, repository)
  • Use DTOs for data transfer
  • Implement proper validation with Bean Validation
  • Follow RESTful API design principles

Quarkus (Alternative)

  • Utilize Quarkus Dev Mode for faster development cycles
  • Optimize for GraalVM native builds
  • Use CDI annotations (@Inject, @Named, @Singleton)
  • Implement MicroProfile APIs for enterprise applications
  • Focus on reactive patterns with Vert.x or Mutiny

Testing

  • Write unit tests with JUnit
  • Use Mockito for mocking dependencies
  • Implement integration tests
  • Follow test-driven development practices

Performance

  • Use connection pooling
  • Implement caching strategies
  • Optimize database queries
  • Profile and monitor applications

Error Handling

  • Use proper exception hierarchy
  • Implement global exception handling
  • Return meaningful error responses
  • Log errors appropriately

Dependencies

  • Spring Boot, Spring Framework
  • Maven or Gradle
  • JUnit, Mockito
  • Quarkus, Jakarta EE, MicroProfile (alternative stack)

來源與署名

來源:mindrally/skills位於java提交9718410

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架