Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
65 views

Bulk conditions evaluation throwing a single RuntimeException exception

Bulk conditions evaluation throwing a single exception of a configurable type for all unfulfilled conditions. It is developed around several design patterns: (1) fluent interface to configure the ...
user avatar
4 votes
1 answer
109 views

Sequentially bidirectional find the indexes of an element into a collection (after second thought)

The util class to find all the indexes on an element into a Collection supports forward and reverse lookup starting from a given index along with changing the ...
user avatar
3 votes
1 answer
238 views

A library management system

Following is my code for a library management system. I am pretty new to OOD and trying to learn it. I am specially looking for ways where any design patterns can be useful here. I tried to make ...
Pankaj Kumar's user avatar
-1 votes
1 answer
79 views

Object build while sequential read user input [closed]

The implementation reads sequentially the user's input changing the type to build according to user choices. There are two main components a conditional structural sharing (...
user avatar
3 votes
1 answer
109 views

Sequentially find the indexes of an element into a collection

Util class to find into a collection the indexes of a given element with multiple occurrences from the first index or relative to a given index. ...
user avatar
1 vote
2 answers
92 views

Verification job with multiple type of batch verifiers

I have a use case where a verification batch job (non-generic) verifies domains based on its input e.g domain_type, batch_pointer etc. The verification handles it based on the domain type which uses ...
user3239193's user avatar
1 vote
1 answer
136 views

Business logic verification template

I have a use case of template design pattern with generics as mentioned below. I have AbstractVerificationHandler that provides template for verification business ...
user3239193's user avatar
1 vote
1 answer
2k views

How to transform the CompletableFuture response

Context: I have a client app which consumes an API. I want to call this API is async way (using java.net.http.HttpClient) and once I receive this data then I want ...
Learner's user avatar
  • 11
5 votes
1 answer
2k views

Java 2 Player Object Oriented CLI Chess Game

I just finished implementing a Java 2 player CLI chess game, it involves player putting in commands (i.e "move e2 e4" to move or "attack d1 d5" to capture.). I am trying to follow ...
Yoh's user avatar
  • 71
-4 votes
2 answers
342 views

How to design planet class so that it is open for changes? [closed]

The task is to model a Solar system using OOP. The planets are orbiting and its needs to find distances between planets. My approach is something like this. ...
AverageJoe9000's user avatar
0 votes
3 answers
101 views

What is the elegant way to merge collection of entities with a duplicate field?

I have the following entity, I am getting it in response of REST API. class Account { private String ownerId; private List<String> coOwners; } REST ...
Govinda Sakhare's user avatar
1 vote
2 answers
120 views

Java dependency injection and hiding details of methods in "Database"-class

I recently posted a bunch of code of my to-do list application and after getting some very helpful and good suggestions on how to improve, I took a shot at it! Here's a link to the former post I made -...
Apelli's user avatar
  • 87
6 votes
1 answer
546 views

Using a generic call to access different variations of a method

In the code below, the primary purpose of class MyRNG is to create a single method getMyRandom() that will return a random ...
CrimsonDark's user avatar
2 votes
2 answers
198 views

Parking places design

I got a question: Design a parking system. There are 3 types of parking spaces: big, medium and small. Implement ParkingSystem class(int big, int medium, int small)....
Michu93's user avatar
  • 145
2 votes
0 answers
185 views

Design a parking lot [closed]

I have tried to design the parking lot problem. Here is the problem statement. Design a parking lot with multiple floors where customers can park their cars. Each parking floor will have many parking ...
Vivek kumar's user avatar

15 30 50 per page
1
2 3 4 5
7