1

What do you call routing that maps one URL directly to a file?

Example:

http://localhost/directory/file.php => /var/www/apache/htdocs/directory/file.php

What do you call routing like one on https://github.com/nikic/FastRoute?

Example:

http://localhost/directory/file => request actually goes to a single index.php file, which then loads routing files or tables and loads appropriate class as defined in the routing table.

Dennis
  • 7,907
  • 11
  • 65
  • 115
  • 1
    "What do you call routing that maps one URL directly to a file?" **Outdated.** – ceejayoz Jan 03 '18 at 15:05
  • I'm curious, when did it become outdated? Do you ever see it come up in new projects still? – Dennis Jan 03 '18 at 15:11
  • 1
    Several years, at minimum. I can't think of the last time I saw a project by a reputable developer that didn't use a framework and router of some sort. – ceejayoz Jan 03 '18 at 15:18

1 Answers1

2

What do you call routing that maps one URL directly to a file?

I would call that no routing. Or maybe direct routing? I've never heard anybody use a term specifically for it.

What do you call routing like one on https://github.com/nikic/FastRoute?

That's (typically) the front controller pattern.

Alex Howansky
  • 50,515
  • 8
  • 78
  • 98
  • thanks. I now see that no-routing pattern is sometimes called page controller, aka each page acts as its own controller – Dennis Jan 03 '18 at 15:24
  • Ehhh... I wouldn't quite say that. A page controller implies a controller per **logical** page. With a direct routing approach, there are not necessarily any logical pages, and if there are, there do not necessarily have one controller per. – Alex Howansky Jan 03 '18 at 15:28