It was only starting with the development of Driven Driven Design, and I learned that you should keep your model in the correct state and when creating a new instance of the class it is recommended to use all the necessary attributes as constructor parameters.
But when working with auto-increment keys, I only have this new identifier when I call the Add method from my constant layer. If I create objects without a key, I think they will be in an invalid state because they need some kind of unique identifier.
How do I implement my architecture in order to have my identifiers before creating a new instance of my object?
source
share