How do their APIs compare?
How do their APIs compare?
About jodaorg/joda-time · 2 messages · last activity 9/8/2026
These two projects are fundamentally different kinds of software, so their "APIs" aren't really comparable in the same sense — let me break down what each actually is.
jodaorg/joda-time: a language library API
Joda-Time exposes a Java class library API — no network/HTTP surface at all. Its API is a set of interfaces and immutable value classes meant to be used in-process:
- Core interfaces define contracts for reading date/time data without mutation:
ReadableInstant— an instant on the millisecond timeline, meant to be used as a parameter type when a method only needs to read a moment in time [src/main/java/org/joda/time/ReadableInstant.java:L17-L36]ReadableDateTime— an instant queryable via calendar fields (year, month, etc.) [src/main/java/org/joda/time/ReadableDateTime.java:L20-L32]ReadablePartial— a "local" time that only supports a subset of fields (e.g., just month/day, no zone) and isComparableby field order [src/main/java/org/joda/time/ReadablePartial.java:L18-L36]
- Concrete immutable/thread-safe classes implement these:
Interval(a span between two instants) [src/main/java/org/joda/time/Interval.java:L27-L49],YearsandWeeks(type-safe single-field periods withplus(),minus(),multipliedBy(),dividedBy()) [src/main/java/org/joda/time/Years.java:L23-L39, src/main/java/org/joda/time/Weeks.java:L23-L39], andDateTimeComparatorfor comparing dates from various input types (String, Calendar, Date, Long, orReadableInstant) [src/main/java/org/joda/time/DateTimeComparator.java:L23-L45]. - Utility base classes like
AbstractPeriodprovide shared implementation (getValues(),get(DurationFieldType)) that concrete period types build on [src/main/java/org/joda/time/base/AbstractPeriod.java:L92-L118].
There's no request/response, auth, or transport concern here — the "API" is purely method signatures and type contracts for date/time arithmetic.
yunaiv/yudao-cloud: distributed HTTP/RPC service APIs
Yudao-cloud is a microservices platform, so its APIs are Spring-based HTTP/RPC contracts between services, with heavy use of DTOs, validation annotations, and OpenAPI (Schema) documentation:
PermissionCommonApidefines cross-service RPC-style endpoints (GET .../has-any-permissions,.../has-any-roles,.../get-dept-data-permission) using@RequestParamandCommonResult<T>wrapper responses [yudao-framework/yudao-common/.../PermissionCommonApi.java:L16-L42].ApiErrorLogCommonApiexposes aPOST .../createendpoint validated with@Valid @RequestBody, plus an@Asyncconvenience wrapper (createApiErrorLogAsync) that fires the call without blocking on the result [yudao-framework/yudao-common/.../ApiErrorLogCommonApi.java:L17-L34].- Request/response payloads are explicit DTO classes with per-field validation and Swagger/OpenAPI
@Schemametadata, e.g.OperateLogCreateReqDTO(required user ID, type, action, request URL/IP/UA with@NotNull/@NotEmpty) [yudao-framework/yudao-common/.../OperateLogCreateReqDTO.java:L11-L48] andOAuth2AccessTokenCheckRespDTO(userId, userType, scopes, tenantId, expiry) [yudao-framework/yudao-common/.../OAuth2AccessTokenCheckRespDTO.java:L13-L33].
Key contrasts
| Aspect | joda-time | yudao-cloud |
|---|---|---|
| API style | In-process Java interfaces/classes | HTTP/RPC endpoints between microservices |
| Contract enforcement | Type system, immutability | Bean validation annotations (@NotNull, @NotEmpty, @Valid) |
| Documentation | Javadoc comments in source | OpenAPI @Schema/@Operation/ |
Want to ask your own question?
Open chat for jodaorg/joda-timePublic Q&A. Generated by RepoPilot from the actual source of jodaorg/joda-time. AI answers can be incomplete or stale — verify before relying on them.