3 ms·
I'm pretty sure Rails, et al, use a single point of contact because that's kinda what web servers do. I actually shivered a little bit thinking about an app wh
by secstate 13y ago
I'm pretty sure Rails, et al, use a single point of contact because that's kinda what web servers do.
I actually shivered a little bit thinking about an app where each url was in a new file somewhere. I mean, ack is only going to take you so far when you're trying to find out where something was implemented.
And that's to say nothing of URL passing between different URL paths.
Honestly, Django doesn't have an index.py file anywhere. Rather it has a urls.py and apart from some really gnarly projects, if you wanna know where something is implemented, you open the root urls.py file and follow the chain down to the app where your URL is being generated. That points you at a view and usually the form or model that's causing issues.
- astrodust 13y agoRails, NodeJS, Django, they all do it with one entry point. That gives you maximum flexibility to decide what to do with a request once you've received it rather than already being locked into some particular approach based on path. This is done in the "Routing" layer which also helps provide diagnostics when it comes to seeing which bit of code was engaged. There's a term for what an app with hundreds if not thousands of loosely defined entry points is called: A mess.
- dools 13y agoI actually shivered a little bit thinking about an app where each url was in a new file somewhere. I mean, ack is only going to take you so far when you're trying to find out where something was implemented. That's essentially what controllers are. How a URL gets mapped to a controller is somewhat moot, in reality most "pages" equate to either a file or a class somewhere. I'm not advocating that one shouldn't have a single entry point. I'm advocating that it shouldn't be part of a centralised framework.
- oinksoft 13y agoAs Rasmus Lerdorf and folks like Terry Chay have been saying forever, PHP is the framework.
- cookrn 13y agoLike this? http://aspen.io/ http://aspen.io/
- clone1018 13y agoAspen makes it a feature :). The code can still be organized, you can still have models and shared code. I think (although I don't use it in production) that it's quite refreshing.
- ldite 13y agoWell, to be pedantic, most Django projects have a WSGI file, which is the single entry point of the application. (The WSGI file is part of your application code, but it typically just calls django.core.wsgi.get_wsgi_application(), which returns an instance of django.core.handlers.wsgi.WSGIHandler, which is the entry point into the Django routing/despatch framework)