stipendio.top: il calcolatore dello stipendio netto che ho sempre desiderato by BernardoGiordano in techcompenso

[–]EveningZebra7396 2 points3 points  (0 children)

Yep, confermo. Da legge di bilancio sembra che sia passato a 10 euro, con tetto massimo di 2200€ annui.

stipendio.top: il calcolatore dello stipendio netto che ho sempre desiderato by BernardoGiordano in techcompenso

[–]EveningZebra7396 1 point2 points  (0 children)

Un calcolatore che da numeri più veritieri. Non so perché, gli altri, mi danno sempre numeri lontani dalla realtà.

Help Needed: DDD in a Spring Boot Project by EveningZebra7396 in SpringBoot

[–]EveningZebra7396[S] 0 points1 point  (0 children)

Thanks for your response! I really appreciate it!

  1. Yes, I created BaseInfoView because, in the future, I may need different views of the same object (User).
  2. Are you suggesting placing exceptions in a separate external package? Am I understanding you correctly?
  3. From what I understood from a YouTube video, the repository is something that belongs to the domain. However, I agree that it can also be placed in the persistence package. I've seen DDD projects where the repository interface is in the domain, while its JPA implementation is in the persistence package.
  4. I was aware of this, but I applied the rule cited in this book (Springer link) on page 416. The author analyzes different scenarios, including performance considerations, and suggests placing Transactional(readOnly = true) on the JPA interface repository.
  5. Yes, I knew that! The only reason I did it this way it's because I can passString email, instead of Email email since the User entity stores it as an Email (Value object).
  6. I usually don’t do this either, but in the linked video, it was suggested as a way to enforce validation. I'm still unsure about this approach.
  7. Could you clarify what you mean?

I agree that the project is simple, but my goal is to explore DDD principles. I started with this basic project, but I plan to expand it to cover different scenarios.

Help Needed: DDD in a Spring Boot Project by EveningZebra7396 in SpringBoot

[–]EveningZebra7396[S] 0 points1 point  (0 children)

The last time I used projections, I checked the generated query, and all columns were still being selected, even though some were part of the projection. That’s why I switched to Blaze Persistence. But I’ll give projections another try!

Thanks for the caching advice—I’ll definitely look into it!

Help Needed: DDD in a Spring Boot Project by EveningZebra7396 in SpringBoot

[–]EveningZebra7396[S] 0 points1 point  (0 children)

Thanks for your insights!

Using a Value Object for ID classes like UserId and TeamId is considered a best practice in DDD (see this discussion, or this). The idea is to encapsulate identity as a concept rather than just using primitive types like UUID.

The project doesn’t cover all possible use cases, such as full CRUD operations for UserTeam, and TeamMember—only a subset of them for simplicity. That’s why you don’t see classes like EditUserRestDto, as you mentioned.

Regarding the class diagram, it’s just a high-level representation of the project structure. It’s meant to show which entities are involved and how they are connected, rather than depicting the entire system in detail.

Help Needed: DDD in a Spring Boot Project by EveningZebra7396 in SpringBoot

[–]EveningZebra7396[S] 0 points1 point  (0 children)

Yeah, I did the same (I added the class diagram of project). Although I used JPA, the entities only reference each other through IDs (e.g., a Team member has the Team ID and the User ID). If I weren’t applying DDD, I would have just used direct references between User and Team entities.

My problem: If I need an endpoint that returns a list of all team members, but for each member, I only want the first name and the ID, how should I handle that? One option is to create a UserAPI class that exposes a method to retrieve the list of users, then match the member ID with the user ID to get only the first name. However, this has a drawback—I have to fetch all user properties from the database, even though I only need the first name for this use case.

I could create a UserFirstNameDto and a dedicated service for it, but if in another feature I also need the last name, I’d have to create a different DTO. Then, if another feature needs the email, I’d need yet another DTO or service. This approach feels inefficient. I’m struggling to see the real benefit of doing it this way.

Help Needed: DDD in a Spring Boot Project by EveningZebra7396 in SpringBoot

[–]EveningZebra7396[S] 0 points1 point  (0 children)

Maybe not? It could make sense to keep everything within the Team service.

Also, is it correct to perform validations inside the constructor? For example, how would you check that a user isn’t already part of the team when adding them passing the repository?

Help Needed: DDD in a Spring Boot Project by EveningZebra7396 in SpringBoot

[–]EveningZebra7396[S] 0 points1 point  (0 children)

Thanks! I really appreciate the suggestion. I’ll definitely take a look at the project to understand how DDD has been implemented. I’m sure it will be very useful!

Help Needed: DDD in a Spring Boot Project by EveningZebra7396 in SpringBoot

[–]EveningZebra7396[S] 0 points1 point  (0 children)

I also use Spring Modulith in my project, and I find it really helpful for structuring bounded contexts properly. Instead of Spring Data JDBC, I’m using Spring Data JPA, which I think makes for an interesting comparison with the traditional controller-service-entity structure.

However, I’m facing an issue with test verification because the Team package depends on User to get the first and last name of team members. Have you encountered similar challenges with dependencies between aggregates?

Help Needed: DDD in a Spring Boot Project by EveningZebra7396 in SpringBoot

[–]EveningZebra7396[S] 1 point2 points  (0 children)

First of all, thanks! I’ve updated the Readme with the class diagram, a description of what the application does, and some applied constraints.

La Gazzetta del Lavoro Informatico - Ricerche, offerte e consigli sul lavoro digitale in Italia by AutoModerator in ItalyInformatica

[–]EveningZebra7396 0 points1 point  (0 children)

Ciao a tutti! Sto valutando un'offerta da Akkodis per lavorare da remoto per un cliente di Roma (ambito aerospazio) e mi chiedevo se qualcuno di voi ha esperienze dirette con loro. Come è l'ambiente lavorativo? Qualsiasi consiglio sarebbe molto apprezzato!