You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I will start by saying this is my first attempt at a full-on clean architecture project with DDD. So if my questions are very newbie, please be kind.
I want to use Guid's as my primary keys, as many cases, the primary keys will be created in the mobile apps. But I am also mindful of the inherent performance issues of using totally random GUIDs when saving new records to an SQL database, caused by the clustered indexes. So I wish to use Sequential GUIDs. I plan to use the RT.comb library.
As I said, in many cases, the primary keys will be created in the module app, but in other cases, it can assign them in the API. So I am wondering whether the GuidGenerator class should be in the Core project or in the Shared Kernel? From my understanding, anything that cuts across all parts of the application should be in the shared kernel.
So I have created an interface and a class for the generator, and put them in the shared kernel. Also in the shared kernel is a class and method to register the generator for dependency injection, to be called from the API Program.
Then I can use it in the API and, if required, in a domain service in the core project.
Does this make sense, or should it all be in the Core project?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I will start by saying this is my first attempt at a full-on clean architecture project with DDD. So if my questions are very newbie, please be kind.
I want to use Guid's as my primary keys, as many cases, the primary keys will be created in the mobile apps. But I am also mindful of the inherent performance issues of using totally random GUIDs when saving new records to an SQL database, caused by the clustered indexes. So I wish to use Sequential GUIDs. I plan to use the RT.comb library.
As I said, in many cases, the primary keys will be created in the module app, but in other cases, it can assign them in the API. So I am wondering whether the GuidGenerator class should be in the Core project or in the Shared Kernel? From my understanding, anything that cuts across all parts of the application should be in the shared kernel.
So I have created an interface and a class for the generator, and put them in the shared kernel. Also in the shared kernel is a class and method to register the generator for dependency injection, to be called from the API Program.
Then I can use it in the API and, if required, in a domain service in the core project.
Does this make sense, or should it all be in the Core project?
Beta Was this translation helpful? Give feedback.
All reactions