0
votes

I am using Service Fabric as my microservice framework. I am using a stateless service because we are using an external database. I have 2 types of users: one is a CSR (Customer representative) and another is the user itself. How do I arrange my Actor services to solve this problem?

CSR has very little functionality. But the Customer is a big piece of the whole puzzle. Let's say CustomerActor needs to update it's own address. The same operation can be done by CSRActor as well.

Is it suggested to create 2 different Actors, CSRActor and CustomerActor, and then CSRActor operates on the customer actor for any operation. Or Customer can be a separate service, and both types of actors call CustomerService. Any other thoughts?

1

1 Answers

1
votes

Actor polymorphism is supported. You can have an Actor type that inherits from another Actor type.

Something like this:

public abstract class CustomerBase : Actor, ICustomer
{ }

[ActorService(Name = "Customer")]
public class Customer : CustomerBase, ICustomer
{ }

[ActorService(Name = "Csra")]
public class Csra : CustomerBase, ICsra
{ }

That will save you the overhead of doing 2 calls to answer one question.