r/java • • Oct 24 '26

Hexagonal Architecture vs. Pragmatic Layered Architecture in Spring Boot

/r/softwarearchitecture/comments/1xe8u4d/hexagonal_architecture_vs_pragmatic_layered/
8 Upvotes

17 comments sorted by

View all comments

Show parent comment

1

u/gjosifov Oct 26 '26

you are effectively limited in your design decision to what JPA allows

Name those design decisions that aren't supported by JPA

1

u/shorns_username Oct 26 '26

Name those design decisions that aren't supported by JPA

Everything that exists in the universe of software architecture/design; past, present and future - minus the relatively small amount of stuff that JPA supports.

1

u/gjosifov Oct 26 '26

So, name at least 1-2 things

it is ok if you can't, but you are in wrong profession, it is better to be a hollywood writer than a software writer

1

u/cryptos6 Oct 26 '26

Sometimes JPA force you to express relationships that you don't want to have in your code in that way, for example. I had also some issues with objects that I wanted to be immutable, but JPA didn't support that. The latter is better with the support of structs today, but the example is still good enough to show the problem.

0

u/gjosifov Oct 26 '26

what made you think that some data are immutable ?
the business requirements or your imagination ?

you probably read about how OO is about modeling the real world and the world is mutable by default

As the great academical trained actors usually say - I here to serve the script
that is how your software design process should be - to serve the world and its mutable nature by default

2

u/OwnBreakfast1114 Oct 27 '26

you probably read about how OO is about modeling the real world and the world is mutable by default

Nobody knows how the next state of the universe is calculated. But given that time exists, I think there's a stronger argument that mutation doesn't exist. You're not the same object you were when you were 3 years old.

1

u/gjosifov Oct 27 '26

You're not the same object you were when you were 3 years old.

I mutate, but if I'm immutable then I have to be reborn every single time
like Jesus

1

u/cryptos6 Oct 29 '26

Uh, oh! Software is a model of the real world, so it is always a design decision how to do that. There are very good reasons to model some things as immutable! If you add 3 to 4 do you mutate the 3 to become a 7?