Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Survived a complete rewrite for a client just now.

The previous team blindly relied on a single method from Spring framework's RestTemplate for every rest service calls with SAP backend.

    ResponseEntity<T> exchange(String url,
        HttpMethod method,
        HttpEntity<?> requestEntity,
        Class<T> responseType,
        Object... uriVariables)
        throws RestClientException
(ref: https://docs.spring.io/spring/docs/current/javadoc-api/org/s...)

This forsed them to create object models structured to match the complicated and inconsitent request and response JSON strings that SAP used, instead of creating the objects modeled after the business domains. The result was no surprise was a disaster and the client wasted five months with them and I had to redo and complete the project still on time.

I still see many teams make their function signatures in Java so convoluted like below and don't know what hit them.

    interface ToDoService {
        ListToDoResponse listToDo(ListToDoRequest request) throws ListToDoException;
        AddToDoResponse addToDo(AddToDoRequest request) throws AddToDoException;
        .. and so on ..
    }


Can you shed some light on how to best solve this problem? I'm pretty much in the same boat with a restful service I depend on.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: