Git Product home page Git Product logo

dependency-injection's Introduction

Hi there ๐Ÿ‘‹

dependency-injection's People

Contributors

mediapills avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

dependency-injection's Issues

Implement `Autowiring`

Autowiring is an exotic word that represents something very simple: the ability of the container to automatically create and inject dependencies.

Add requiered helpers for DI set method.

    def service(  # dead: disable
        self, key: str,
        mode: int = SERVICE_MODE_COMMON,
        required: List[str]
    ) -> Callable:
        """Assign a callable value to the specified offset."""

attribute required will define keys list used in service from DI

Add string expressions implementation

You can use the string(key: str) helper to concatenate strings entries:

from mediapills.dependency_injection import Container

di = Container({
  "placeholder.one": "value one",
  "message": "placeholder.one => '{placeholder.one}'",
})

di.string("message")

Add special classes

Add classes MediapillsDI and ReflectedDI.
The ReflectedDI is a class with access for private variables via special keys _version, _frozen etc.
The MediapillsDI will check all mediapills libraries and will auto load classes from there.

Add new definition types functions

This definition format is the most powerful of all. There are several kind of entries you can define:

  • values
  • factories
  • objects
  • autowired objects
  • aliases
  • environment variables
  • string expressions
  • arrays
  • wildcards

More info here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.