問題描述
這個問題源于觀看 Rasmus Lerdorf 在 Drupalcon 上的演講.順便說一下,這個問題和他的演講與 Drupal 沒有特別的關(guān)系……它只是在他們的騙局中提出的.我自己的問題也與 PHP 無關(guān).這是我很好奇的一般單一入口點(diǎn).
This question stems from watching Rasmus Lerdorf's talk from Drupalcon. This question and his talk have nothing specifically to do with Drupal, by the way... it was just given at their con. My own question also has nothing specific to do with PHP. It is the single entry point in general that I am curious about.
如今,似乎大多數(shù)框架都為您使用它們構(gòu)建的任何內(nèi)容提供了一個單一的入口點(diǎn).在他的談話中,拉斯穆斯提到他認(rèn)為這很糟糕.在我看來,他的這種想法是正確的.如果訪問該站點(diǎn)的每個人都通過同一個入口點(diǎn)進(jìn)入,那么在流量達(dá)到某個點(diǎn)后,事情不會陷入困境嗎?允許人們直接訪問站點(diǎn)中的特定點(diǎn)而不讓他們的請求通過同一點(diǎn)不是更有效嗎?但也許實(shí)際影響不是很糟糕?也許現(xiàn)代建筑可以處理它?也許你必須在規(guī)模上真正變得巨大才值得考慮?我很好奇這個網(wǎng)站上的人是怎么看待這個問題的.
These days it seems that most frameworks offer a single entry point for whatever you build with them. In his talk Rasmus mentions that he thinks this is bad. It seems to me that he would be correct in this thinking. If everyone hitting the site is coming in through the same entry point wouldn't things bog down after traffic reached a certain point? Wouldn't it be more efficient to allow people direct access to specific points in a site without having their request go through the same point? But perhaps the actual impact is not very bad? Maybe modern architecture can handle it? Maybe you have to be truly gigantic in scale before it becomes even worth considering? I'm curious as to what people on this site think about this issue.
推薦答案
總之,Rasmus 或解釋是錯誤的.
In short, Rasmus or the interpretation is wrong.
這表明顯然缺乏對計(jì)算機(jī)工作原理的了解.使用的東西越多,它就越有可能離 CPU 越近,因此速度越快.請注意,單點(diǎn)進(jìn)入!= 單點(diǎn)故障.但這并不是重點(diǎn),當(dāng)人們說單點(diǎn)入口時,我們指的是應(yīng)用程序,它是您邏輯的單點(diǎn)入口.
This shows a clear lack of understanding how computers work. The more something gets used, the more likely it's closer to the CPU, and therefore faster. Mind you, a single point of entry != single point of failure. But that's all beside the point, when people say single point of entry, we're talking about the app, it is a single point of entry for your logic.
更不用說沒有中央入口點(diǎn)或總體上減少入口點(diǎn)的數(shù)量在架構(gòu)上是腦殘.一旦你想在你的應(yīng)用程序的每個入口點(diǎn)做一件事,猜猜有多少地方需要改變?在處理過一個每個頁面都獨(dú)立存在的應(yīng)用程序后,不得不進(jìn)行更改很糟糕,我向您保證,我們需要它.
Not to mention it's architecturally brain-dead not to have a central point of entry, or reduce the number of entries points in general. As soon as you want to do one thing across your app at every entry point, guess how many places need to change? Having dealt with an app that each page stood on it's own, it sucked having to change, and I assure you, we needed it.
這篇關(guān)于有一個網(wǎng)站的單一入口點(diǎn).壞的?好的?沒問題?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!