autofac / Autofac.ServiceFabric

Autofac integration for Azure Service Fabric. Provides service factory implementations for Actors, Stateful Services and Stateless Services.
MIT License
26 stars 27 forks source link

Reduced extensibility due to access restrictions in classes and methods #32

Closed robertical closed 5 years ago

robertical commented 6 years ago

For our Service Fabric application, I have found that there is some missing functionality in the Autofac.ServiceFabric.

To implement state backup and restore from stateful actors, in Service Fabric it is needed to create a "custom" ActorService that overrides some of the base methods from the StatefulServiceBase superclass, however, in the Autofac.ServiceFabric extensions, the creation of the actors to ActorService (in the class ActorFactoryRegistration), are hardcoded and it can only be done by creating a fork and make changes in the project.

To allow the creation of a CustomActorService, it should be needed to open the libraries a little bit more and some of the elements marked as "internal" be made "public". This way, it would be possible to implement a custom implementation of IActorFactoryRegistration and then register our implementation to be able to create our custom ActorServices instances.

Other option it would be to find a way to configure the type to be used for the ActorService instead of having it hardcoded.

In any case, opening the library a bit more by making it more "public" and less "internal" could help reduce the need of creating forks of the repository to customize the classes to achieve some behaviour that is not supported yet.

dagahe commented 6 years ago

I got the same issue when we were adding the Service Fabric Actor Backup/Restore capability to our application. The solution was basically the same @robertical is exposing here.

Would be great to have the option to overrride the ActorService an actor is registered with.

Thx

alexmg commented 6 years ago

Would be great to have the option to overrride the ActorService an actor is registered with.

This is coming in the next release.

tillig commented 5 years ago

It appears in 2.1.0 the ability to register a custom ActorService has been added.