I'm a software engineer with 10+ years of experience mosty in Java. I'm an OCP11, Spring Professional 2020 and I am a Kong Champion. I am the owner of channel JESPROTECH on YouTube.
Thanks for your comment! The id property is another paradigm that isn't strictly related with this architecture. You could add an Id, but I wouldn't add directly the one from the database. Maybe you could obfuscate it with some other technique. In any case, whether the id is present in de Dto or not, or if it should be there or not, is an independent architectural decision. Some projects use the id directly, but doing so, they are exposing the id to the outside world. Even if everything is protected and shielded against attacks, now everyone would know at least the ID of your objects. That could be a big step for hackers.
Hope this helps,
Cheers!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi there!
Thanks for your comment! The id property is another paradigm that isn't strictly related with this architecture. You could add an Id, but I wouldn't add directly the one from the database. Maybe you could obfuscate it with some other technique. In any case, whether the id is present in de Dto or not, or if it should be there or not, is an independent architectural decision. Some projects use the id directly, but doing so, they are exposing the id to the outside world. Even if everything is protected and shielded against attacks, now everyone would know at least the ID of your objects. That could be a big step for hackers.
Hope this helps,
Cheers!