
io.sphere.sdk.meta.JvmSdkFeatures Maven / Gradle / Ivy
package io.sphere.sdk.meta;
import io.sphere.sdk.models.Base;
/**
Embracing Java 8
The SDK API uses:
- {@link java.util.concurrent.CompletableFuture}
- {@link java.util.Optional}
- Java Date API: {@link java.time.Instant}, {@link java.time.LocalDate} and {@link java.time.LocalTime}
- {@link java.util.function.Function}
Good defaults for toString(), equals() and hashCode()
SDK implementation classes extends {@link Base} which provides default implementations for the methods by using
reflection following the suggestions of
Effective Java.
Domain models are immutable
Domain models are no plain old Java objects, since the client does not poses control over them but needs to send
update commands to SPHERE.IO, so setters would pretend a functionality which is not possible.
Clients for other cloud services provide setters and synchronize the model in the background. This approach still
blocks the caller thread and makes it hard to impossible to tune error handling, timeouts and recover strategies.
Our approach makes it explicit, that an operation can be performed in the background, takes time and might fail.
Domain models are interfaces
Since domain models are interfaces, you can use them in design patterns or add convenience methods.
Testability
The clients and the models are interfaces, so they can be replaced with test doubles.
In addition the SDK provides builders and JSON converters to create models for unit tests.
Domain specific languages to create requests
For example {@link io.sphere.sdk.queries.QueryDsl} helps to formulate valid queries and discover
for which attributes can be in which way queried and sorted.
*/
public final class JvmSdkFeatures extends Base {
private JvmSdkFeatures() {
}
}