cangunaydin的活动

Hello, I have come up to interesting video on youtube from Mauro Servienti. In his presentation he was explaining, about different bounded contexts responsible for different parts of the application. But he used view model composition and decomposition while building the user interface. This makes the solution interesting. Interesting part was each different module wasn't owning the user interface since view was composed from different bounded contexts of the application. https://www.youtube.com/watch?v=KkzvQSuYd5I

So in abp, mostly when you create a bounded context, I automatically think that view should also belong to that module (bounded context). Let me give you an example I was playing around.

I have Product Aggregate which consists of

Product: Aggregate Root

Id: Guid Name: string Description:string StockQuantity:int Price: decimal

also i have Order aggregate which consists of

Order: Aggregate Root

Id:Guid Name: string Items: List<OrderItem> TotalValue:decimal

OrderItem : Entity

Id:Guid OrderId:Guid ProductId:Guid Price: decimal Quantity: decimal Subtotal: decimal

So i wanted to seperate this to two bounded contexts Which is "inventory bounded context" and "sales bounded context". I know that Product in "Sales Bounded Context" and "Inventory Bounded Context" are not the same. In "Sales Bounded Context" i am not interested in how many items are in the stock.

So here the problem arises when i want to create the user interface in "Sales Bounded Context" to create an order. Since I do not know anything about Product, how am i going to list the products here? Two solutions i can think of.

Whenever product is created or updated or deleted on "Inventory bounded context" I will handle that event and create aggregate on "Sales bounded context". So i will copy the product information needed to my "Sales bounded context". Then i can use that in "Sales bounded context".

Second solution is to use IProductAppService in presentation layer of "Sales Bounded Context" which will list the products. This means i need to give the reference to HttpApi.Client project of "Inventory Bounded Context" module. (I don't know what kind of problems does this make? am i coupling my code to the other bounded context?)

Mauro Servienti in the video is giving another solution which says that, presentation layer should be another project which will compose and decompose those bounded contexts which is "inventory bounded context" and "sales bounded context"

So i am pretty confused which way is gonna be the right way. Before I watched the video i was more leaning into copying the products on the "sales bounded context" since it has different properties in that context. Do you have any suggestions how to move forward in these cases? Any advice will be much appreciated. Thank you for reading it.

Hello again thank you for the answer.

What makes you think you have to be coupled to identity service for identity user? I would suggest digging more on Domain Driven Design to see how to handle these kind of coupling (using data duplication etc).

Actually i was talking about it from the administration microservice perspective, I was looking at the problem like "reduce the number of intersynched communications if it possible". So that was my intuition at the first place but i understand your point.

There is a great free-ebook Domain Driven Design with the ABP Framework i would suggest. And also Domain-Driven Design: Tackling Complexity in the Heart of Software by Eric Evans.

Thanks for the suggestions i have already read the Domain Driven Design book from Abp, i will check the Eric Evans's Book also.

Thanks for the assistance.

Hello again, I really understand now, also i read this doc from microsoft, which is not a good practice to do synced communications between microservices as they say https://docs.microsoft.com/en-us/dotnet/architecture/microservices/architect-microservice-container-applications/communication-in-microservice-architecture

https://docs.microsoft.com/en-us/dotnet/architecture/microservices/architect-microservice-container-applications/media/communication-in-microservice-architecture/sync-vs-async-patterns-across-microservices.png

So this brings me another question Isn't there anyway to get users without being coupled to identity service. For ex first thing that comes to my mind is to make identityservice not being a seperate microservice and include it in administration service? But probably it is the most used service? Why did you choose to make it a seperate service if it is gonna be coupled to administration service? or how do i need to do decisions when i am seperating monolith project to microservices? Is there any guide or docs or any book to read to learn more about it?

I really appreciate your help, and thank you for answering my questions.

Allright i think it is more clear in my mind now, thank you for the answer.

So to summarize, you removed internal gateway because there was only one synched (http) communication which is between administration service and identity service.

All the permissions are defined in application contracts, so this brings us to the conclusion, whatever microservice that implements permission manager module needs to define every microservice application contracts module, so permission manager can do crud operations on the permissions?

And as the last thing if i want to create a communication for ex between productservice and saas service

  • I need to create productservice as a client in identity server give the scope as "saasservice"
  • configure productservice by changing appsettings.json in the project like sth similar that has been made in administration service config.

"AuthServer": { "Authority": "https://localhost:44322", "RequireHttpsMetadata": "true" }, "RemoteServices": { "AbpIdentity": { "BaseUrl": "https://localhost:44388/", "UseCurrentAccessToken": "false" } }, "IdentityClients": { "Default": { "GrantType": "client_credentials", "ClientId": "Adzup_AdministrationService", "ClientSecret": "1q2w3e*", "Authority": "https://localhost:44322", "Scope": "IdentityService" } },

  • And as the last step i need to have the "HttpApiClientModule" of the "saas microservice" in the "productservice module" and i don't need any contracts module since "HttpApiClientModule" also have a reference to the "Saas Contract Module" and this microservice doesn't manage permissions.

Further Questions:

  • So as i understand identityclients options are configured in AbpHttpClientIdentityModelWebModule but in the docs it has been used AbpHttpClientIdentityModelModule can you clarify the difference between 2?

  • Also if i am planning lots of communications between different microservices internally isn't the internal gateway with ocelot is better approach maybe it is not very efficient if one microservice needs to call another but overall can we say that if we have many communcations between our microservices isn't it better to configure an internal gateway instead of configuring all the microservices one by one? What i am asking is are you planning to replace back internal gateway with another solution than ocelot or is it gonna be gone for good?

Thank you so much for the help and assistance

  • ABP Framework version: v5
  • UI type: MVC
  • DB provider: EF Core

Hello, I am new to Abp structure and i was checking out the docs for microservice structure, i have created a sample solution from abp suite. And i was going through the docs and trying to understand how the system works. I believe on the previous version, solution was using internal gateway to do the communication between services. Why was it removed in this version? Actually i am not sure what was the internal gateway was doing on the previous version. was it only a gateway that is publishing the events from rabbitmq and do the communication between all micro-services? And if it was doing all the communication between all microservices before right now how it has been solved? And i believe only "administration service" needs to make a call to "identity service", is there any other microservice making a call to other microservices?

I think all the built-in modules coming from Abp are now using static http client generation explained here: https://github.com/abpframework/abp/blob/dev/docs/en/Blog-Posts/2021-11-18%20v5_0_Preview/POST.md#static-generated-client-proxies-for-c-and-javascript I understand that administration service need to talk to identityservice and this is done with static http client proxies now. But what i don't understand is why administrationservice needs to depend on 5 contractsmodule which are

AbpAccountAdminApplicationContractsModule AbpAccountPublicApplicationContractsModule ProductServiceApplicationContractsModule SaasServiceApplicationContractsModule IdentityServiceApplicationContractsModule

i couldn't see anything on the documentation why these are needed maybe i am missing sth over here maybe it is related with static http client proxies. Maybe these are kind of basic questions but i am new to microservice concept and new abp structure. I would be glad if you could clarify those points for me.

ps: still on the doc it mentions about internal gateway which is not present probably it would be modified when the v5 is released. https://docs.abp.io/en/commercial/5.0/startup-templates/microservice/microservices#administrationservice

显示 95 个条目中的 91 到 95 个.
Made with ❤️ on ABP v8.2.0-preview Updated on 三月 25, 2024, 15:11