Skip to main content

All Questions

Tagged with
-1 votes
2 answers
394 views

Idempotency for a financial transaction API

Say you have a REST API endpoint like POST /move-money which transfers money from your main account to a savings pot. There are three path parameters accountId for the user's account potId for the ...
MZokov's user avatar
  • 101
-1 votes
2 answers
160 views

Designing class for fixed-size data structure backed by ArrayList

Say we want to write a Java class that represents a fixed-size list. Let's call it Chunk.java (as in, it represents a chunk of data to be processed or sent somewhere). My implementation of this class ...
Fiery Phoenix's user avatar
9 votes
6 answers
8k views

How should an API handle unsupported fields?

Let's assume I have this API on /api/v2/persons that enables me to create new entries by POSTing this JSON: { "name": "me" } The API is implemented using Spring Boot and if ...
Marged's user avatar
  • 235
-1 votes
1 answer
42 views

Opinions on using standardized J2EE APIs over specific over vendor APIs

I have always advocated the use of standardized api, and currently use it on my code. However i always get very strong resistance when it comes to code review, even on projects i have designed and ...
user3414321's user avatar
0 votes
1 answer
348 views

API Split for creating object with inheritance and behaviors

I have a web service which is exposed to UI owned by our team. This web service is responsible for creation of objects and saving it in the DB (NoSQL Database). The object being created has multiple ...
dka72's user avatar
  • 101
-1 votes
1 answer
2k views

Resful name API for multiple key objects

We are implementing an API and we want to follow best practices for naming the endpoints. However, during the design, we have found a challenge. We have some objects where the key to the objects is a ...
ypriverol's user avatar
  • 111
6 votes
3 answers
342 views

Should a high-performance API expose low-performance utility functions?

Context: I'm working on an open source project to solve a problem that comes up in ad-tech and social media data mining: indexing boolean expression trees, and matching them against incoming documents....
Robert Fraser's user avatar
0 votes
2 answers
88 views

Preferred method signature for API method involving DB interactions

I recently got into discussion about how the method signature should look like for an API method which doesn't expose internal objects used by application to caller. Here is how situation looks: Our ...
Prateek Jain's user avatar
2 votes
1 answer
184 views

Gradle/Java separation public private API

I have a project that has a public API and an internal code. The public part is published on MavenCentral. I thought about making a package each, but everything from the 'internal' package that ...
CLOVIS's user avatar
  • 123
0 votes
1 answer
2k views

The usefulness of java util classes to call a service (to create a model) as opposed to using that services's impl

Example I will explain the paradigm below but I am specifically talking about Liferay's Service Builder code for anyone who knows that platform. Basically in Liferay you can definite a model and it'...
Chris Maggiulli's user avatar
1 vote
1 answer
626 views

Why is the sorted() method on Stream not named sort()?

Why is the sorted() method on Stream not named sort()? list.stream().sort()
benshqd's user avatar
  • 29
2 votes
1 answer
1k views

Best way to separate public API from internal implementation [closed]

I'm developing a little framework (in Scala) where I want to define clean and simple interface for the users of the framework. Some of theses interfaces have to be implemented by the framework itself, ...
deamon's user avatar
  • 886
5 votes
2 answers
5k views

Why does java collections not supply a function for the index of max value?

I have been using Collections.max(list) for many projects, but I occasionally want to find the index of that maximum element. I feel silly writing a function to do this for myself in every program I ...
Seth's user avatar
  • 169
1 vote
3 answers
3k views

Why do APIs generally consist of interfaces? [duplicate]

I am starting out in Java API design and in reading existing code bases, I have found that most APIs consist of interfaces only with their implementations bundled in a different package. Having read ...
Pawan's user avatar
  • 121
8 votes
1 answer
15k views

Return values for CRUD methods?

I'm writing a basic web API in Java that does what almost all others do: take input, validate it, then do CRUD operations on the DB. I've written several APIs before, and I've pretty much already ...
dsw88's user avatar
  • 1,849