All Questions
Tagged with architecturejava
205 questions
3votes
1answer
6kviews
Best way to handle lazy models with mapstruct and spring transactional scope
In a typical Java Spring Web APP: we have the following layers: Model [DB Models] Repositories [where you have queries to DB] Services [Business service where you have the @Transactional annotation] ...
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 ...
1vote
4answers
413views
Preventing payment to be processed twice
I have app with paymemt/subscription service, pretty much how the payment works is: Initial payment User initiate payment on the web ( click on "subscribe") Back-End send init request to ...
1vote
1answer
149views
Background thread processing vs queue based processing for relatively short tasks (max 30-40 seconds)
I need suggestion / recommendation on the design approaches mentioned below. UseCase: I have a usecase where a client uses my system to generate some recommendations. Now, these recommendations are ...
28votes
1answer
48kviews
Splitting a big project to create a multi-module Maven project
I am working on a Spring-MVC application in which we are using Maven for dependency management. As the project is big, we are thinking of splitting the project into several parts. I had some doubts, ...
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 ...
11votes
7answers
5kviews
How to maintain dependencies shared among microservices?
There is a dependency jar containing tons of service classes mostly used to retrieve data from database, and this jar is used among several different micro services in one cluster. There is a big ...
2votes
0answers
406views
Examples for "serverless" Java service for AWS Lambda
Doesn anybody have practical experience with implementing a (micro)service based on AWS Lambda? My team is currently working on an MVP. We started with a monolith and that has worked very well. It's ...
25votes
4answers
42kviews
Service layer returns DTO to controller but need it to return model for other services
Following this post https://stackoverflow.com/questions/21554977/should-services-always-return-dtos-or-can-they-also-return-domain-models and best practices in Software Arch suggestions by Martin ...
1vote
1answer
307views
Writing Event Process architecture for multiple event handler interfaces
I am working on Java program which will listen multiple kind of events from multiple sources and store information to multiple sinks. Each interface will have its own source to listen and own sink ...
3votes
2answers
256views
How to manage cart details across various devices
Recently I was asked in a interview to implement to e-commerce site . One of the requirement was to maintain cart details across various devices .(i.e) if user adds a book from his iPhone , and when ...
0votes
0answers
117views
Spring data exchange between components?
Please advise me what pattern to use in following case: I have a Java/Spring Boot application. There is a component with @KafkaListener method which receives Kafka Messages on CRUD of various subject ...
-1votes
1answer
459views
Using a shared enum across 15 nanoservices [closed]
Originally posted here, moved to code review, redirected from code review back here as there is no code to review. I think the question is enough abstract to be asked here. I have a mono repo with ...
1vote
1answer
566views
The recommended Spring Boot project structure leads to repetitive code
When implementing projects in Spring Boot (especially CRUD applications), I often find myself writing a lot of repetitive code that just calls functions and services from lower layers. For example, ...
1vote
1answer
354views
Extract common code into own module
I'm finding myself in a situation where I need to define common behaviour and implement it depending on the environment (minecraft server or javafx runtime). The simple graph below describes my idea. ...