All Questions
18 questions
0
votes
2
answers
745
views
Microservices - create post for logged in user
I am working on a small project with microservices architecture in Spring Boot. As to not make unnecessary calls to users-microservice, I have duplicated some necessary User data (id, name, summary, ...
1
vote
4
answers
1k
views
Are static classes/methods good for pure business logic?
I have a service class that performs some operations.
One of the operations is a piece of code long enough to warrant extracting to a new class and unit test it in isolation:
@Service
public class ...
2
votes
3
answers
354
views
Exposing multiple classes from the representive package for one entity
I have a simple app for storing the movies, that exposes REST API. I am using spring-boot. I am using this simple app as an example, however, the question is more about general good practice.
I am ...
0
votes
1
answer
450
views
How to use single Spring-Boot instance to cater to multiple environments?
We have a Spring-Boot Web application currently deployed to 7 environments (DEV, SIT, UAT, Pre-Prod, Prod, etc.). This application connects to other REST services, which has different URLs for each of ...
-1
votes
3
answers
1k
views
Should methods with business logic be made private? [duplicate]
So I am writing a project using Spring Boot. All of my logic resides in @Service classes. I have separated each service class based on entity. For example - If I have two independent entities A and B, ...
1
vote
1
answer
805
views
Spring Boot/Batch: Should every Job be separate Maven module?
I'm building a backend service powered by Spring Batch which enables to define and Jobs.
Currently, I have several jobs, that essentially, aren't related one to another.
So,
I have one application....
2
votes
1
answer
894
views
How to build a modular/extensible Spring Boot application?
I'm developing a Spring boot / Batch application.
What I'd like to do is to have a separated module for every job. This is a reasonable decision because different tasks (Spring Batch Job) have ...
1
vote
0
answers
5k
views
Spring Data MongoDB: Update document based on multiple identifiers with Composite ID vs. MongoTemplate upsert vs. MongoRepository find & save
I'm wondering for best practices to upsert a document based on two identifiers.
@Document(collection = "cars")
public class CarEntity {
@Id
private ObjectId id;
private String ...
2
votes
1
answer
163
views
Handling OAuth 2.0 access token
I am creating a rest template to consume REST API secured by OAuth 2.0.
The provider has implemented an expiry for the access token for 5 mins. So Using the rest template, I will be calling the ...
-3
votes
1
answer
97
views
Should vanilla solutions be avoided in Spring web applications?
I am making a Java and Spring webapp that scrapes data from a web and then publishes it through an API. Some of the raw scrapped data is in the form of Set<SomeObject> which I then convert to a ...
9
votes
2
answers
40k
views
Are Spring beans declared as static a poor design choice?
The question is pretty straightforward, I'll try to explain why I want some explanations.
(All of this is my 1½-year junior Java developer opinion, which may be more than incomplete. Which is why I ...
11
votes
1
answer
433
views
REST service as an application server for 2000+ client machines. Is it a good idea?
We will be building a system with the UI in javaFx that will be deployed to 2000+ machines (minimum is 2000, but it will be more - can reach 5000 machines).
For other reasons/limitations it must be ...
3
votes
2
answers
2k
views
Architecture review - case study (Spring MVC)
I'm developing an Java Web Application with Spring, and I have some questions about my architecture. Before showing it, here is the context:
I am developing a web application with more than 80 ...
1
vote
2
answers
516
views
Unique Identifiers for classes - Java with Spring
My use case requires me to implement multiple validators which implement the interface:
public interface Validator {
boolean validate(Object o);
}
Based on the business group of the Object o, a ...
-6
votes
1
answer
4k
views
Singleton: Is Singleton an Anti-Pattern [duplicate]
Was reading an interesting blog post on Singleton design pattern which is so widely used.
If it's stupid or as in some quora posts, its an anti-pattern why is it so widely used even in frameworks.
...