Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Refactor WorkBench #140

Open
Open
@bruno-brant

Description

@bruno-brant

There's a large number of issues with Liquid's service locator, WorkBench:

  • It's static, which forbids a number of good OOP practices such as inheritance; It also makes testing very difficult (Add unit tests for WorkBench #74) because, once you exercise it, you can no longer change anything. It's also vulnerable to thread-safety issues because every thread will access the same data (although, I must admit, this is unlikely, since you should load instances only at application startup - after that you only read from it).

  • It's a glorified static dictionary. The whole interface is about restricting what can be loaded into it, which is something that the dictionary would do natively (minus the protection over setting something twice, which I wonder if it is really helpful...). The only thing that matters is that it will call Initialize on a service on the first read, which is a good feature.

  • It restricts what can be used as a service.

  • It violates SOLID in every manner I can think, well, besides SRP.

I think a redesign is in order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity:highThe complexity of the issue is highdiscussionDiscussion over a feature that might evolve into a bug or feature requestsize:largeThe size of the issue is large

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions