Code Monkey home page Code Monkey logo

di1's Introduction

DI/1 is a simple convention-based dependency injection (inversion of control) framework. DI/1 is part of the FW/1 family of components. All development work occurs in that repo. This repo is provided purely as a convenience for users who want just DI/1 as a standalone component.

Usage

Initialize it with a comma-separated list of folders to scan for CFCs:

var beanfactor = new ioc("/model,/shared/services");

CFCs found in a folder called beans are assumed to be transient. All other CFCs are assumed to be singletons. This can be overridden via optional configuration.

DI/1 supports constructor injection, setter injection and property-based injection. All injection is done by name. If a bean name is unique, it can be used as-is, else the bean will have an alias which is the bean name followed by its immediate parent folder name, e.g.,

/model/beans/user.cfc will be "user" and "userBean"
/model/services/product.cfc will be "product" and "productService"

Folder names may be singular or plural. DI/1 assumes that if a folder name ends in "s" it can remove that to get the singular name.

See the DI/1 documentation for more details.

di1's People

Contributors

seancorfield avatar aliaspooryorik avatar mattlevine avatar seancoyne avatar

Watchers

 avatar

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.