我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

定义对象的依赖注入

I'm reading into Dependency Injection and I got stuck on a bit that seems a bit vague to me.

Its used for a website application. How and where to I define every possible service? I don't even know if I'm going to use it in the particular run?

Let's say I have the following service:

  1. Config
  2. Cache
  3. FileReader
  4. Router

Where do I define all these classes/definition of the services/classes? And how do I only define them if actually needed?

Thanks in advance.

近期文章

  • 动态DropDownList工作,但如何获得价值? PHP
  • 我的DAO班怎么能看到我的学说模型?
  • 跳过循环file_get_contents的500个响应
  • 使用codeigniter在iframe中显示php文件
  • EXCEL和记事本中的CSV文件编号格式不同
  • 如何在html标签中调用javascript和php函数?
  • 如何正确编码CSV中的特殊字符
  • 按下提交按钮后,在html页面中显示所选文本文件
  • too long
  • 什么是最好的子串制作方法?
  • too long
  • c++中overloading ifstream运算符时,可以设定逗号作为分隔符吗?
  • 目前有没有哪种技术,实现获取电脑桌面的内容, 并且可以实时处理的
  • 强制下载restler函数调用
  • 从html页面的下拉列表中显示所选文本文件
  • 在没有cron的外部Web服务器上的特定时间执行脚本
  • 任何电子邮件末尾都有奇怪的字符:PHP MAIL
  • 在当前表中插入数据并更新另一个表MySQL
  • too long
  • 包括父目录无效

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华