Skip to main content

All Questions

-2 votes
3 answers
283 views

Should I do dependency inversion on the same layer level

I'm working on an accounting service. I have to generate invoice for a user and upload it to the file storage. So my service would have to use a service from file storage team. File storage service ...
Patrick's user avatar
  • 233
6 votes
1 answer
437 views

Should operations on properties of list objects be encapsulated in a domain class that wraps the list?

I have a list of product price objects, List<ProductPrice>. @Value public class ProductPrice { Long id; LocalDate startDate; LocalDate endDate; BigDecimal value; } From ...
user8297969's user avatar
2 votes
2 answers
499 views

Exposing methods for polymorphic children from the aggregate root

Consider the following fictitious toy example: There is an aggregate root DayChecklist that holds a list of Tasks planned for the day: class DayChecklist { String id; DateTime today; ... ...
Cosmica's user avatar
  • 87
7 votes
2 answers
453 views

DRY polymorphic object creation (always valid)

Assuming we have polymorphic entities such as the following, with constructors enforcing invariants (assume there could be lots of sub-classes). What would be an effective/elegant approach to ...
plalx's user avatar
  • 399
8 votes
3 answers
2k views

Microservices - What does it mean to deploy & upgrade independently?

In this article, it is mentioned (emphasis mine): ...the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own ...
overexchange's user avatar
  • 2,305
1 vote
3 answers
2k views

How to design an API wrapper with bulky operations on domain object? (Need guidance)

I need some guidance in designing an API wrapper for my backend APIs. I have tried to keep it as specific as possible. Context: We have a project which supports certain file operations like edit, ...
lazyloader's user avatar
4 votes
4 answers
187 views

Class design problem - splitting differences or making workarounds?

I have this problem: Class1 and Class2 are of same Base type. They are representing the same concept but with slightly different implementation. If I model them "the right way" in Java, I would have ...
Bojan Vukasovic's user avatar
1 vote
1 answer
841 views

Rich Model vs God Class [duplicate]

I have a legacy code containing some behaviour classes, like services and controllers. My model is pretty anaemic. It's just a repository of getters and setters, and I want to refactor it. There is a ...
user1531914's user avatar
4 votes
2 answers
1k views

A design decision in composition or aggregation

I've recently had doubts about some design decisions that I frequently make, so this time I decided to take some time and try to analyze it to find the best solution. I will describe a simple scenario ...
Victor's user avatar
  • 141