Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addinig IServiceProvider to XpandObjectSpaceProvider initialization #1072

Open
pavlovboris opened this issue Sep 26, 2024 · 3 comments
Open
Labels
Enhancement Reactive.XAF eXpandFrameowrk/DevExpress.XAF project

Comments

@pavlovboris
Copy link

pavlovboris commented Sep 26, 2024

Hello,

Could you please add an initialization of XpandObjectSpaceProvider that is passing IServiceProvider serviceProvider?

I mean something like adding:

public XpandObjectSpaceProvider(IServiceProvider serviceProvider, IXpoDataStoreProxy provider, ISecurityStrategyBase security, bool threadSafe = false)
    : base(serviceProvider, provider, threadSafe)
{
    _security = security;
    DataStoreProvider = provider;
    Tracing.Tracer.LogVerboseValue(GetType().FullName, Environment.StackTrace);
}

Many thanks for considering my request.

@pavlovboris pavlovboris added Enhancement Reactive.XAF eXpandFrameowrk/DevExpress.XAF project labels Sep 26, 2024
@pavlovboris pavlovboris changed the title Addinig IServiceProvider to XpandObjectSpaceProvider initialisation Addinig IServiceProvider to XpandObjectSpaceProvider initialization Sep 26, 2024
@apobekiaris
Copy link
Member

Please provide why u want this change possibly with a sample so I can understand how u plan to use it and why the current implementation suffers. Cause at the end the IServiceProvider is nothing more than sugar coat and unless you plan to build rockets and want to test them with different parts has no real value other than complexity and support cost.

In any case educate me on your case.

@pavlovboris
Copy link
Author

pavlovboris commented Oct 3, 2024

It should be fine, as the base XPObjectSpaceProvider has this initialization. I use it mainly to access the current user in XPO(other ways do not always work); it also allows alignment with the newly recommended Devexpress approach. This also opens further possibilities for using dependency injections in XPO objects. I have made a custom inherited from the XpandObjectSpaceProvider class, in which I get the IServiceProvider, but I thought this would be useful in the future. In any case, if it is no real value other than complexity and support cost, It is ok with me; it is just a suggestion.

@apobekiaris
Copy link
Member

Without having a sample using proxies I am afraid I will break the functionality so until then I will leave it as is. I personally prefer the FastObjectSpaceProvider so my apps do not use this class to test uppon. In addition the IObjectSpace, XafApplication classes have IServiceProvider as a dependency.

@apobekiaris apobekiaris removed their assignment Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Reactive.XAF eXpandFrameowrk/DevExpress.XAF project
Projects
None yet
Development

No branches or pull requests

2 participants