Skip to content

Question: Decoupling dependency of Explorer object from DI #328

@jakubboucek

Description

@jakubboucek

From the current Nette Database codebase, an Explorer object can only be created if it is registered as a service in DI. All the requirements for creating an Explorer object are defined only in DatabaseExtension instead of being encapsulated in a specialized Factory.

I am currently working on an application where there is no single common access to the database, but according to the permissions in a given request, the application dynamically obtains a PDO object with which it can work for the duration of the request (creating Connection from PDO is already open in #327).

If I am not mistaken, there is nothing to prevent the logic from DatabaseExtension from being transferred to a separate Factory that can be called independently of DI - which will allow for dynamic object creation.

Before I start working on the PR, I want to ask this issue whether the proposal makes sense to you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions