Skip to content

NGApplication should not be a global #4

Open

Description

@hugithordarson

We want to be able to construct the request handling machine that is NGApplication without any side effects.
Essentially, what we want to be able to do is to do something like this:

var app = new NGApplication( properties );
var response = app.dispatchRequest( new NGRequest( .... ) );
assertTrue( response.status() == 200 );

Activity

  1. paulhoadley commented on Dec 29, 2021

    @paulhoadley
    Contributor

    Possibly related: why is a method like isDevelopmentMode() static? Presumably because NGApplication is effectively a singleton, so it may as well be.

  2. hugithordarson commented on Dec 29, 2021

    @hugithordarson
    CollaboratorAuthor

    isDevelopmentMode() is kind of a relic from Wonder's static version, the reason it being static there that it's used in application initialization, before there's an application instance to invoke anything on (and I've hit the same problem in NGApplication).

    It should definitely be a part of the "environment", i.e. properties used for initialization. Ideally I'd want to do away with the globally declared application() (and therefore global properties) altogether.

  3. moved this from Todo to In Progress in ng-objects-0.1.0on Oct 20, 2022
  4. moved this from In Progress to Todo in ng-objects-0.1.0on Oct 22, 2022
  5. added this to the 0.1.0 milestone on Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions