Questions tagged [spring]
Spring is a module based open source framework to build robust Java / Java EE applications.
309 questions
3votes
2answers
223views
Why do I need an authorisation server if my micro services can validate JWTs directly?
I'm working on a Spring-based micro service project and considering different approaches for handling authentication and authorisation. Instead of setting up a dedicated authorisation server, I’m ...
-1votes
1answer
129views
Why was integration tests using Spring Test framework designed to need @Transactional annotation in the @Test method by default?
Based on the documentation on Spring testing: https://docs.spring.io/spring-framework/reference/testing/testcontext-framework/tx.html#testcontext-tx-enabling-transactions Annotating a test method ...
0votes
0answers
69views
Disable tenants in multi tenant SaaS app
I am building an app where I have tenants and each tenant can have multiple users. The users can do multiple things in the application and these functionalities also are kind of independent from each ...
2votes
2answers
448views
How should I implement data access with jpa to meet Clean Architecture/DDD
For the last few days I'm searching any information about compatibility of JPA and Clean Architecture/DDD. I found next ideas for decoupling application from hibernate. Do not use @ManyToMany or @...
3votes
3answers
1kviews
Should business logic classes be POJO only?
I read about three-tier architecture and I have a question: I read that in business logic (that is, what is in logic tier) there should be POJO classes, but in most Spring manuals these classes are ...
1vote
0answers
66views
Best practice: slightly different logic on multi mapping endpoint
Suppose I've got a spring controller as follows: ⋮ @RestController public class MyController { ⋮ @PostMapping(value = { "publicAPI/addItem", "internalAPI/addItem" }) ...
6votes
3answers
652views
Hexagonal Architecture + Domain Driven Design. How to perform a correct implementation?
Currently, I am trying to implement these two architectures together with Java and Spring (although technology shouldn't matter I think). But I'm encountering problems getting them to work together. I ...
0votes
2answers
221views
Where perform mapping in strict Domain-Driven Design?
I want to create an example application where we use a strict domain-driven design and layering (controller, service, repository). Most notably, we have a clear distinction between the domain and the ...
-3votes
1answer
112views
How to format request and response
I am new to backend REST API development. I am creating the CRUD APIs for books using spring boot. I have a model class lets say 'user'. It will have many fields, like id, name, email, status, ...
-2votes
1answer
158views
Spring/Java multiple shared modules for different databases
I'm implementing a software based on the micro-service architecture using Spring/Java. Each micro-service connects to either a PostgreSQL or a MongoDB database. Is it standard practice to have a ...
0votes
0answers
48views
Muti-tenant Webapp Setup Defaults and Configurations
I have a multi tenant webapp. When a new tenant is created there is a bunch of defaults and configurations that need to be created in the DB for the new tenant, so of these inserts are related to each ...
0votes
1answer
126views
Where to put getOrSave responsibility?
I have many repeated parts of service logic which just fetches object if it exists or returns a newly saved one. I want to move it from service because it just clutters up the logic. But I do not ...
2votes
3answers
915views
How can I avoid duplicate annotations when validating both Entity and DTOs?
I am using the Spring Boot framework to create a RESTFUL API and I need a way to avoid the duplication of validation rules when using multiple DTOs as request/response objects for my endpoints. Using ...
-3votes
1answer
147views
Learn a framework on a project, or mix languages between backend services [closed]
I am designing my next project, which will do various domain-specific tasks, but all that will be controlled and used via a generic crud web app. I have been professionally using Java with Spring for ...
2votes
1answer
636views
Rest API Layered Architecture Java / Spring / JPA
Currently, all REST applications I work with have a three-layered architecture: Persistence -> Contains "entity" classes with JPA annotations / Spring Data JPA repositories Core -> ...