All Questions
14 questions
1
vote
2
answers
122
views
Designing UI module for an application
I have an UI module that will expose only one class - UserInterface. The class will be responsible for collecting user input and providing output (command line UI style). From logical way of thinking, ...
1
vote
1
answer
609
views
Pipeline design pattern and immutability
I'm developing a backend service that is supposed to process items in a pipeline-fashion. Each stage is essentially a Function<IN, OUT>. So the current stage's input is the previous stage's ...
3
votes
4
answers
1k
views
Role of DTOs in Rich Domain Model
I work with Spring applications. Recently I have found this article about the Anemic Domain Model.
They recommend putting logic in Entity classes. It solves a problem that Martin Fowler described in ...
25
votes
4
answers
42k
views
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 ...
7
votes
5
answers
3k
views
Design pattern for 2 methods one has 70% arguments of other one
I am trying to do a design for notification part in the system I have 2 parts inApp notification and email notification so I used strategy pattern where I have interface NotificationSender with one ...
0
votes
2
answers
138
views
design discussion, user experience first or correctness first in our case
We are discussing the system configuration module design in our Java medical device software. The system has a voice instruction function used to guide patient during the examination. Different ...
4
votes
2
answers
896
views
Clean Architecture: get instance in inner circle of class from outer circle
This might be an easy question for experienced software engineers.
I'm currently reading the book Clean Architecture by Uncle Bob, and I'm trying to implement clean architecture in a Java project.
...
1
vote
1
answer
131
views
Using constructors for "layered" instances
I'm working on a library that can represent LED strips virtually. My main class, LEDStrip, is abstract and has a couple abstract methods, like getLength() and setColor(int index, Color c). This lets ...
3
votes
2
answers
1k
views
Value object that depends on multiple aggregates' lifecycle in DDD
During prototyping a simple ddd application from public transit domain I've faced a problem with one value object - Transit Pass:
Each Customer can buy a transit Pass thatallows a passenger of the ...
3
votes
2
answers
11k
views
Unit testing / How to validate private fields of a newly created object?
I have a basic unit test (for the sample) that involves this code:
void testShouldCreateACar() {
Car car = someone.createFerrari();
assertTrue(car.name == "Ferrari"); // can't access name since ...
2
votes
2
answers
1k
views
DDD Request Validation Handling
I stuck somewhere that I can't find a solution! There are plenty of validation questions here, but as far as I see, most of them were asking about entity validation. But what about request validation? ...
2
votes
2
answers
2k
views
Problems with OO design for application with pluggable components
I'm trying to refactor an ugly code and make it easly extendable in the future.
The application should be nothing else but a series of components that have input(s) and output(s). The components ...
2
votes
2
answers
2k
views
From a DDD perspective is a report generating service a domain service or an infrastructure service?
Let assume we have the following service whose responsibility is to generate Excel reports:
class ExcelReportService{
public String generateReport(String fileFormatFilePath, ResultSet data){
...
4
votes
1
answer
226
views
Which relationship is more natural?
Have a quick question on how to best structure something for my Java project:
I'm a user. I can work at one or more places. At those workplaces, I have one or more roles. For each of these roles, I ...