为什么 ZEND 到处使用接口和抽象类,而 Codeigniter 根本不使用它们?
好的。因此,我通过 Codeigniter 2.0 目录查找 interface 或 abstract 关键字。 我在任何地方都找不到使用类骨架的 Codeigniter。 AFAIK 可以看到 - CI 仅使用具体的类实现。
不使用抽象和接口是不是不好?为什么 Zend 框架在各种场合都使用它们,而 Codeigniter 却忽略了这一约定?
ok. So i grep'ed through Codeigniter 2.0 directory looking for interface or abstract keywords.
I couldn't find Codeigniter using class skeletons anywhere. AFAIK and can see - CI only uses concrete class implementations.
Is not using abstracts and interfaces bad? Why does Zend framework utilizes them for every occasion while Codeigniter simply ignores this convention?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Zend 会定期重写,实现最新的 PHP5 功能,这对他们来说非常有用。
CodeIgniter 始终注重可移植性和最低要求,并且是在 PHP5 仍在开发中时编写的,其架构采用了非常 PHP4 的方法。
现在,CodeIgniter 2.0 已不再支持 PHP4,并且要求已提高到 5.1.6。这并不意味着每个文件都已用 PHP5 重写,因为这没有多大意义。新功能将使用 PHP5,我们正在努力更新一些框架,同时努力不破坏使用 2.0 的应用程序。
Zend is re-written on a regular basis implementing the newest PHP5 features which is great for them.
CodeIgniter has always been about portability and minimal requirements and was written when PHP5 was still in development with a very PHP4 approach to its architecture.
Now that CodeIgniter 2.0 is out support has been dropped for PHP4 and the requirement has been raised to 5.1.6. This doesn't mean every single file has been re-written in PHP5 because, well there's not much point in that. New features will be using PHP5 and we're working on bringing some of the framework up to date while trying really hard to not break things for applications using 2.0.
可扩展性——这就是区别。
此外,AFAIK Code Igniter 是基于 PHP4 的。
评论后编辑:
通过说基于,我的意思是它是之前为 PHP4 编写的,因此它没有使用核心中的所有最新 PHP5 功能。
这不仅涉及 OOP 功能,还涉及 声压级。
Scalability - this is the difference.
Besides, AFAIK Code Igniter is PHP4 based.
Edit after comment:
By saying based, I mean that it was written previously for PHP4, so it does not use all the newest PHP5 features from the core.
This is not only about OOP features, but also about some of the design patterns which are described by SPL.