問題描述
這個問題源于觀看 Rasmus Lerdorf 在 Drupalcon 上的演講.順便說一下,這個問題和他的演講與 Drupal 沒有特別的關系……它只是在他們的騙局中提出的.我自己的問題也與 PHP 無關.這是我很好奇的一般單一入口點.
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.
如今,似乎大多數框架都為您使用它們構建的任何內容提供了一個單一的入口點.在他的談話中,拉斯穆斯提到他認為這很糟糕.在我看來,他的這種想法是正確的.如果訪問該站點的每個人都通過同一個入口點進入,那么在流量達到某個點后,事情不會陷入困境嗎?允許人們直接訪問站點中的特定點而不讓他們的請求通過同一點不是更有效嗎?但也許實際影響不是很糟糕?也許現代建筑可以處理它?也許你必須在規模上真正變得巨大才值得考慮?我很好奇這個網站上的人是怎么看待這個問題的.
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.
這表明顯然缺乏對計算機工作原理的了解.使用的東西越多,它就越有可能離 CPU 越近,因此速度越快.請注意,單點進入!= 單點故障.但這并不是重點,當人們說單點入口時,我們指的是應用程序,它是您邏輯的單點入口.
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.
更不用說沒有中央入口點或總體上減少入口點的數量在架構上是腦殘.一旦你想在你的應用程序的每個入口點做一件事,猜猜有多少地方需要改變?在處理過一個每個頁面都獨立存在的應用程序后,不得不進行更改很糟糕,我向您保證,我們需要它.
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.
這篇關于有一個網站的單一入口點.壞的?好的?沒問題?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!