Open Closed

In which layer should I create SmsSender and CustomBlobProvider ? #5035


User avatar
0
caglar.ayhan@ekol.com created

I need to create CustomBlobProvider and CustomSmsSender.In which directory should I create it? I could not decide. I am sharing my project template below. Do you have any advice for this?


5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can put them on the Domain layer. : )

  • User Avatar
    0
    caglar.ayhan@ekol.com created

    Thank you for your answer but I would like to expand my question. For blob provider, I must to add some package(Google.Cloud.Storage.V1) from nuget. Would it be correct to add these packages to this layer? I am hesitant as to whether it would be correct to add these packages to this layer.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Thank you for your answer but I would like to expand my question. For blob provider, I must to add some package(Google.Cloud.Storage.V1) from nuget. Would it be correct to add these packages to this layer? I am hesitant as to whether it would be correct to add these packages to this layer.

    It would be wrong to add the package to your domain layer. The domain layer should be independent of external dependencies (you can change your mind and want to use another blob provider in the future for example). You can define interfaces for your blob operations and create an infrastructure layer for Google.Cloud.Storage.V1 and implement your interface in this layer. Then, your host project can depend on this infrastructure layer.

  • User Avatar
    0
    caglar.ayhan@ekol.com created

    According to my point of view xxx.HttpApi.Client module is in the infrastructure layer(maybe not, I am not sure. What do you think about that?) can I add it here too? Another alternative way,as you told, is to add a new abp module project that is in the infrastructure layer to the solution. Which one is the best?

  • User Avatar
    1
    maliming created
    Support Team Fullstack Developer

    hi

    You can create the interfaces in the Domain layer. And create a separate layer as the implementation.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11