2 ms·
Indeed, I too implement web apps in a immutable manor when I can. Most of my ejbs are immutable, since they just add and return stuff. I don't like web servers
by UK-AL 14y ago
Indeed, I too implement web apps
in a immutable manor when I can. Most of my ejbs are immutable, since they just add and return stuff. I don't like web servers relying on state. I also keep my ejbs mostly stateless using stateless ejbs funnily enough.
However when choosing JPA or JDBC - thus relying on boilderplate code loading data into java object constructors manually then I choose jpa.
It is a trade off for me. Boilerplate or keeping immutable data classes. For me that is a situation when adding immutability makes things more difficult.
And besides most well supported modern web frameworks like Django or rails also do it that way. So it is not really trade off when choosing EE / rails / Django. You have to have in most of those frameworks unless you rip out the orm.
I'm not really in a position to choose some obscure framework.