问题描述
伙计们,我正在制作自己的MVC框架(请大家不要投票,因为每个人都想制作一个框架.)等等.我想制作一个自举类,就像我在许多框架中看到的那样.我之所以这样做,是因为我决定通过从内部开始学习框架来迈向新的高度.但是,通过它们,我面临的问题很少.但是我将在不同的问题中将它们分开.现在来澄清我的问题:What features should a Bootstrapping class have?
和Can you give me articles that could help me?
Hey guys I am making my own MVC framework (please do not downvote me because everyone wants to make a framework.) and so.. I want to make a bootstrapping class like I have seen in many frameworks. I am making this because I have decided to move to the next level by started learning a framework from the inside. But I am facing few problems getting through them. But I will separate them in different questions. Now to clarify my question:What features should a Bootstrapping class have?
And Can you give me articles that could help me?
推荐答案
不应存在引导程序类".这是一个简单的过程,可以包含在一个简单的脚本中,该脚本将作为您应用程序的入口点. PHP不是Java,因此不需要在类中包含所有内容.
There should not be a "bootstrap class". It is a straightforward process, which can be contain in a simple script, which would serve as entry point for your application. PHP is not Java, therefore you are not require to contain everything within a class.
通常情况下,应用程序的引导阶段将承担以下职责:
Usually bootstrap stage of application would have following responsibilities:
- 设置自动加载器
- 初始化路由机制
- 配置存储抽象(数据库,缓存等)
- 处理用户请求(使用路由)
- 发送到MVC
应用程序的引导阶段是应设置对象之间的所有连线的位置.也将是您设置记录器,访问控制和错误处理结构之类的地方.
The bootstrap stage in you application is where all the wiring between objects should be set up. It would also be the place where you set up such things as loggers, access control and error handling structures.
您可以说前端控制器是自举的一部分.
You could say that front controller is a part or bootstrapping.
推荐文章列表:
- GUI体系结构 由Martin Fowler
- 控制容器的反转和依赖项注入模式 作者:马丁·福勒 >
- "Smalltalk-80系统
- 了解JavaServer Pages Model 2体系结构
- MVP:模型视图呈现器C ++和Java的巧妙编程模型
- GUI Architectures by Martin Fowler
- Inversion of Control Containers and the Dependency Injection pattern by Martin Fowler
- A Description of the Model-View-Controller User Interface Paradigm in the Smalltalk-80 System
- Understanding JavaServer Pages Model 2 architecture
- MVP: Model-View-Presenter The Taligent Programming Model for C++ and Java
List of recommended articles:
这篇关于如何在PHP框架中实现引导类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!