SuperAPI AI Directory

common-technical-practices

Coding & development

View repository

Updated 10-16 09:35

About this skill

General Technical Practices

Applicable Scenarios

  • Add an AOP aspect
  • Use distributed locks to control concurrency
  • Configure retry mechanisms and backoff strategies
  • Perform interface parameter validation
  • Add performance monitoring instrumentation
  • Write scheduled tasks
  • Record audit logs

Inapplicable Scenarios

  • Just using a specific utility class, such as JWT, expression parsing, or thread pool utilities
  • Just calls between microservices, event-driven behavior, or multi-environment configuration
  • Just a module's own business rules

Quick Guidance

  1. This skill focuses on "framework-level cross-cutting practices," not specific business modules.
  2. If the problem is more like "adding a layer of general capability to business logic," it usually falls here.
  3. First go to the corresponding reference document by topic:
    • AOP:reference/1-aop-aspect.md
    • Distributed locks:reference/2-distributed-lock.md
    • Retries:reference/3-retry-mechanism.md
    • Parameter validation:reference/4-parameter-validation.md
    • Performance monitoring:reference/5-performance-monitoring.md
    • Scheduled tasks:reference/6-scheduled-tasks.md
    • Audit logs:reference/7-audit-logging.md
  4. If what you want is "how to use an existing component," switch to utility-components; if what you want is "how to set up foundational microservice capabilities," switch to microservice-infrastructure。

High-Signal Rules

  • Capabilities such as AOP, locks, retries, monitoring, and auditing are usually reused across multiple modules
  • These practices are often strongly related to Spring / framework integration approaches
  • When implementing, prioritize idempotency, observability, and concurrency safety
  • Do not hard-code cross-cutting capabilities into a single business class

Key Pitfalls

  • Mistakenly placing utility class usage questions here
  • Only implementing functionality without handling idempotency, timeouts, concurrency, and observability
  • Applying retries, locks, and scheduled tasks directly without first determining whether they are truly needed
  • Scattering audit logs and monitoring instrumentation throughout business code, making them difficult to maintain later

Further Reading

  • AOP:reference/1-aop-aspect.md
  • Distributed locks:reference/2-distributed-lock.md
  • Retries:reference/3-retry-mechanism.md
  • Parameter validation:reference/4-parameter-validation.md
  • Performance monitoring:reference/5-performance-monitoring.md
  • Scheduled tasks:reference/6-scheduled-tasks.md
  • Audit logs:reference/7-audit-logging.md
  • If what you need is a utility component: see also utility-components
  • If what you need is a microservice foundation: see also microservice-infrastructure