GitHub 中文社区
回车: Github搜索    Shift+回车: Google搜索
论坛
排行榜
趋势
登录

©2025 GitHub中文社区论坛GitHub官网网站地图GitHub官方翻译

  • X iconGitHub on X
  • Facebook iconGitHub on Facebook
  • Linkedin iconGitHub on LinkedIn
  • YouTube iconGitHub on YouTube
  • Twitch iconGitHub on Twitch
  • TikTok iconGitHub on TikTok
  • GitHub markGitHub’s organization on GitHub
集合主题趋势排行榜
#

依赖注入

Dependency injection (DI) is an implementation of the dependency inversion principle with the aim of separation of concerns by separating the depndency's implementation from the class that's using it. That kind of abstraction makes it possible to have different implementations with the same public methods so the class using it, doesn't need to care which of the implementations is used. This is also especially useful for unit testing.

There are different types of dependency injection:

  • constructor injection
  • setter injection
  • interface injection

Created by Martin Fowler

发布于 January 23, 2004

Website
martinfowler.com
Wikipedia
维基百科
kataras/iris
https://static.github-zh.com/github_avatars/kataras?size=40
kataras / iris

#Web框架#Iris 是基于 Go 编写的一个快速,简单但功能齐全、高效的 Web 框架。

GoIrisweb-frameworkmvc依赖注入HTTPsessionsWebSocket
Go 25.51 k
7 天前
https://static.github-zh.com/github_avatars/alibaba?size=40
alibaba / ARouter

#安卓#💪 A framework for assisting in the renovation of Android componentization (帮助 Android App 进行组件化改造的路由框架)

Androidrouternavigationcomponentization依赖注入interceptor
Java 14.49 k
2 年前
https://static.github-zh.com/github_avatars/google?size=40
google / wire

一个编译时的Go语言依赖注入框架

Go依赖注入codegeninitialization
Go 13.83 k
1 年前
https://static.github-zh.com/github_avatars/inversify?size=40
inversify / InversifyJS

A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript.

TypeScriptIoC (Disambiguation)JavaScript依赖注入Node.jsinversifyjs
TypeScript 11.75 k
3 天前
jonataslaw/getx
https://static.github-zh.com/github_avatars/jonataslaw?size=40
jonataslaw / getx

Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.

getx依赖注入Flutterstate-managementroutes国际化 (i18n)框架移动WebDartHTTPget
Dart 10.86 k
3 个月前
https://static.github-zh.com/github_avatars/InsertKoinIO?size=40
InsertKoinIO / koin

#安卓#Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform

Kotlin依赖注入injectionAndroidKotlin MultiplatformLibrary
Kotlin 9.47 k
2 天前
https://static.github-zh.com/github_avatars/Effect-TS?size=40
Effect-TS / effect

Build production-ready applications in TypeScript

effectJavaScript命令行界面OpenTelemetryplatformschemaTypeScript依赖注入error-handlingobservabilityclusteringconcurrencyworkflows
TypeScript 9.4 k
2 天前
evrone/go-clean-template
https://static.github-zh.com/github_avatars/evrone?size=40
evrone / go-clean-template

Go 语言 Clean Architecture 模板

clean-architectureGo微服务依赖注入templateExample
Go 6.86 k
10 天前
https://static.github-zh.com/github_avatars/uber-go?size=40
uber-go / fx

A dependency injection based application framework for Go.

Go框架serviceapp-framework依赖注入
Go 6.57 k
1 个月前
https://static.github-zh.com/github_avatars/Swinject?size=40
Swinject / Swinject

#IOS#Dependency injection framework for Swift with iOS/macOS/Linux

依赖注入SwiftiOSioc-containerinversion-of-control
Swift 6.55 k
1 年前
https://static.github-zh.com/github_avatars/hyperf?size=40
hyperf / hyperf

Hyperf 是一个高性能、高灵活性的渐进式 PHP 协程框架,内置协程服务器及大量常用的组件,性能较传统基于 PHP-FPM 的框架有质的提升,提供超高性能的同时,也保持着极其灵活的可扩展性,标准组件均基于 PSR 标准 实现,基于强大的依赖注入设计,保证了绝大部分组件或类都是 可替换 与 可复用 的。

swoolecoroutinehyperf微服务aopjson-rpcgRPCPSR-7: HTTP message interfacesPSR-15: HTTP Server Request Handlerspsr-14opentracingamqp依赖注入WebSocket框架annotationattributesPHPswow
PHP 6.51 k
3 天前
https://static.github-zh.com/github_avatars/microsoft?size=40
microsoft / tsyringe

Lightweight dependency injection container for JavaScript/TypeScript

依赖注入dependencyinjectionIoC (Disambiguation)containerTypeScriptdecorators
TypeScript 5.5 k
2 个月前
https://static.github-zh.com/github_avatars/anjoy8?size=40
anjoy8 / Blog.Core

💖 ASP.NET Core 8.0 全家桶教程,前后端分离后端接口,vue教程姊妹篇,官方文档:

netcoreautomapperrepositoryt4netcore-webapisqlsugarcoredtoRedisaopIoC (Disambiguation)swaggerCross-origin resource sharing (CORS)JSON Web Tokensautofac依赖注入rbacsqlsugarnet7
C# 5.21 k
20 天前
loopbackio/loopback-next
https://static.github-zh.com/github_avatars/loopbackio?size=40
loopbackio / loopback-next

LoopBack makes it easy to build modern API applications that require complex integrations.

APINode.js框架REST APIOpenAPI SpecificationswaggerstronglooploopbackTypeScriptIoC (Disambiguation)依赖注入repositoryHacktoberfest
TypeScript 5.03 k
3 天前
https://static.github-zh.com/github_avatars/autofac?size=40
autofac / Autofac

An addictive .NET IoC container

autofacioc-containerC#netcorenetstandard依赖注入
C# 4.58 k
1 个月前
ets-labs/python-dependency-injector
https://static.github-zh.com/github_avatars/ets-labs?size=40
ets-labs / python-dependency-injector

Dependency injection framework for Python

Python依赖注入IoC (Disambiguation)ioc-containerfactorysingletondesign-patternsdependency-injection-containerFlaskaiohttpasyncioflask-applicationflask-restfulthreadlocal
Python 4.4 k
10 天前
thangchung/go-coffeeshop
https://static.github-zh.com/github_avatars/thangchung?size=40
thangchung / go-coffeeshop

咖啡商店,一个事件驱动、微服务实战项目。使用Golang、Nomad, Consul Connect, Vault 开发以及Terraform部署

clean-architectureecho-frameworkGogrpc-gateway微服务Domain-driven design (DDD)PostgreSQLrabbitmqalpinejsconsul-connectnomadTerraformevent-driven-microservicesevent-driven-architecturevertical-slice-architecture依赖注入
Go 4.25 k1
2 年前
https://static.github-zh.com/github_avatars/uber-go?size=40
uber-go / dig

A reflection based dependency injection toolkit for Go.

Go依赖注入di
Go 4.2 k
1 个月前
https://static.github-zh.com/github_avatars/typestack?size=40
typestack / typedi

Simple yet powerful dependency injection tool for JavaScript and TypeScript.

依赖注入TypeScriptinversion-of-controlIoC (Disambiguation)
TypeScript 4.16 k
3 天前
https://static.github-zh.com/github_avatars/khellang?size=40
khellang / Scrutor

Assembly scanning and decoration extensions for Microsoft.Extensions.DependencyInjection

scanningdecorationassembly-scanningdecoration-extensionsasp-net-core依赖注入conventionsconvention-registrationHacktoberfestscrutor
C# 3.97 k
12 天前
loading...