Giter Club home page Giter Club logo

nojoy_di's Introduction

NoJoy_DI

Join the chat at https://gitter.im/joyider/NoJoy_DI Build StatusCode Climate DI Logo

A simple to use and feature rich Dependency Injector designed to help managing python classes and variables

The main goal of the DI was to create a simple to use DI that can be used in a pytionic way:

  • No xml configuration carp
  • No compiling of the DI

Current Status is *Testing/Working. Please fork and add feature or fix any issues you might run into :)

Why Dependency injection in python

There are many threads and people on the web stating that you don't need dedicated injection libraries for dynamic languages, since they offer so many ways to manage the issue. But this is only partially true. Tools are only as good as they are used for.

If you can manage a problem without using DI in an EASY way you should stick with using native methods. But sooner or later you will find your self in dependency hell never the less.

What is Dependency Injection (DI)

Dependency inversion principle is a software design principle which provides us the guidelines to write loosely coupled classes. According to the definition of Dependency inversion principle:

  1. High-level modules should not depend on low-level modules. Both should depend on abstractions.
  2. Abstractions should not depend upon details. Details should depend upon abstractions.

That is basically it, or even more simple: Dependency injection means giving an object its instance variables. Really. That's it.

Features

Function Descriotion
set_factory create a factory callable
input Add constructor arguments for the service
call add method call with args on a service
set set attribute the service
injector

nojoy_di's People

Contributors

gitter-badger avatar joyider avatar

Watchers

 avatar  avatar

nojoy_di's Issues

Unable to set variables (setattr) on classes patternized with the BorgPattern

When trying to set attributes to a borg instance using SERVICE.set, the value is not updated in the dictionary.

The reason i most likely caused by the BorgPattern and that the attribute is set BEFOR it is patternized. Since the borg pattern then uses the "global" dictionary for the Borg class and discarding the original dict

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.