All Questions
102 questions
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 ...
4
votes
1
answer
108
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 ...
3
votes
1
answer
237
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 ...
-1
votes
1
answer
69
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 (...
3
votes
1
answer
108
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.
...
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 ...
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 ...
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 ...
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 ...
-4
votes
2
answers
341
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.
...
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 ...
1
vote
2
answers
110
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 -...
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 ...
2
votes
2
answers
197
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)....
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 ...