All Questions
17
questions
1
vote
0
answers
152
views
Design classes using Spring boot, JPA using callbacks of generic type
I'm confused about the design using Spring boot and JPA when callbacks are involved.
Example:
Controller will call the Service class and pass in the value of T, i.e Employee in our example:
@...
0
votes
1
answer
66
views
java- how to multiple(indefinite) asynchronous callbacks. is there a desing pattern or somehing?
I am not sure if I asked right in title but here is the problem.
I have a class that does a jop asyncronously and also has to run on Swing UI thread. like this
SwingUtilities.invokeLater(() -> {
...
1
vote
1
answer
124
views
What pattern to use when reusing functions
So I wanted to reuse some functionalities like the try catch and some other common functionalities used by my application. I was wondering if this approach is ok. Or if there is any other approach ...
2
votes
1
answer
962
views
Android: MVP. Right way to communicaticate between components
I have implemented MVP pattern in my application.
I have an additional layer which I call Repository, which is responsible for running HTTP asynchronous requests. I have created ...
0
votes
1
answer
338
views
How to do a session pattern with callbacks?
I know how to do a session pattern without callbacks like here How to organize RMI Client-Server architecture. But i don't know how to do one with callbacks. Do I need another session object for the ...
0
votes
1
answer
161
views
Callback Duplicate Code
I'm using okhttp3 with asynchronous callbacks to get JSONArrays/JSONObjects from the server and then parsing them and creating the particular object which is passed to the callback function.
Most of ...
1
vote
1
answer
188
views
A very specific usage of callbacks in Java
This question is about a specific usage of a callback pattern. By callback i mean an interface from which i can define method(s) that is (are) optionnaly (= with a default set to 'do nothing', thanks ...
15
votes
2
answers
3k
views
Wrapper Classes are not suited for callback frameworks
The disadvantages of wrapper classes are few. One caveat is that wrapper classes are not suited for use in callback frameworks, wherein objects pass self references to other objects for subsequent ...
-1
votes
4
answers
88
views
Efficient solution to update a variable based on values of several variables
I have an update method which gets called every time the screen refreshes itself.
Inside this method I check the value of about about 50 objects to be zero. If all the values are zero I return a ...
2
votes
2
answers
1k
views
Design Patterns: Callback as a method parameter
I was wondering if defining a callback for a operation in a method parameter is worse than defining it in the object and setting via setters, concerning about design patterns.
I'm not sure if exists ...
0
votes
3
answers
93
views
call-back behavior in java
My question is more towards the design pattern to use for my implementation. I have the code written as follows -
X-Service.java
handler.setListeners(new HttpResponseHandler.conListers() {
@...
2
votes
1
answer
234
views
techniques of asynchronous tasks
Ho do you perform asynchronous tasks and notify about their finishing?
I see the next approaches(they are related, but...) for doing it:
AsynchTask (SwingWorkerTask) where there are the such methods ...
18
votes
3
answers
24k
views
Delegate vs Callback in Java
I have some misunderstanding about terms of delegates and callbacks in Java.
class MyDriver {
public static void main(String[] argv){
MyObject myObj = new MyObject();
// ...
45
votes
4
answers
9k
views
Java pattern for nested callbacks?
I'm looking for a Java pattern for making a nested sequence of non-blocking method calls. In my case, some client code needs to asynchronously invoke a service to perform some use case, and each step ...
2
votes
1
answer
3k
views
Java: Simple implementation of Command pattern with onComplete callback?
Could someone point out where to find an implementation of the Command pattern with onComplete callbacks that could be used for example in a serial macro command?