Download presentation
Presentation is loading. Please wait.
1
URI IS 373—Web Standards Todd Will
2
CIS 373---Web Standards-URI 2 of 17 What’s in a name? What is a URI/URL/URN? Why are they important? What strategies can be used to manage them? –Information Architecture –Content Negotiation
3
CIS 373---Web Standards-URI 3 of 17 URI –A Uniform Resource Identifier (URI) is a compact string of characters for identifying an abstract or physical resource.
4
CIS 373---Web Standards-URI 4 of 17 Uniform Uniformity: –Allows different types of resources to be referenced in the same context –Allows new types of resources to be added in the future –Allows identifiers to be reused in many different contexts
5
CIS 373---Web Standards-URI 5 of 17 Resource A resource can be anything that has identity, e.g. –Documents –Images –Services, e.g. weather, authentication –People –Books Conceptual mapping to an entity or set of entities, not necessarily the entity which corresponds to that mapping at any particular instance in time.
6
CIS 373---Web Standards-URI 6 of 17 Identifier An identifier is an object that can act as a reference to something that has identity. In the case of URI, the object is a sequence of characters with a restricted syntax.
7
CIS 373---Web Standards-URI 7 of 17 URI vs URN vs URL A URI can be further classified as a locator, a name, or both. "Uniform Resource Locator" (URL) refers to the subset of URI that identify resources via a representation of their primary access mechanism (e.g., their network "location"), rather than identifying the resource by name or by some other attribute(s) of that resource. "Uniform Resource Name" (URN) refers to the subset of URI that are required to remain globally unique and persistent even when the resource ceases to exist or becomes unavailable.
8
CIS 373---Web Standards-URI 8 of 17 URI Format :// ? Examples: –http://is.njit.edu/ –ftp://afs2.njit.edu –mailto:txw5999@njit.edu?subject=hi%20there
9
CIS 373---Web Standards-URI 9 of 17 Cool URI’s Don’t Change When you change a URI on your server, you can never completely tell who will have links to the old URI. When someone follows a link and it breaks, they generally lose confidence in the owner of the server. They also are frustrated - emotionally and practically from accomplishing their goal.
10
CIS 373---Web Standards-URI 10 of 17 URL Usability Which is better? http://is.njit.edu/index.php?s=courses&c=undergrad&id=144 http://is.njit.edu/courses/undergrad/cis373 http://is.njit.edu/undergrad/cis373 http://is.njit.edu/courses/cis373 http://is.njit.edu/cis373 Good URL’s can be guessed Implication: –Creating a URL is like having a baby, you are creating something for which you will be responsible for a long time
11
CIS 373---Web Standards-URI 11 of 17 URL Management Information Architecture –Simple as possible –Predictable/Logical –Descriptive –Uniform For larger organization’s sites maintaining discipline can be difficult
12
CIS 373---Web Standards-URI 12 of 17 Content Negotiation Can accomplish two things: –Associate multiple URI’s with the same resource e.g. different links to CIS 373 in previous slide –Serve different versions of a given resource depending on the client e.g. serve a different version of a page depending on the browser
13
CIS 373---Web Standards-URI 13 of 17 mod_rewrite example Sample contents of file.htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RedirectMatch ^/turoff http://web.njit.edu/~turoff RedirectMatch ^/hiltz http://web.njit.edu/~hiltz RedirectMatch ^/bieber http://web.njit.edu/~bieber RewriteRule ^(.+) - [PT,L] RewriteRule ^(.*) index.php
14
CIS 373---Web Standards-URI 14 of 17 ISAPI_Rewrite Provides functionality similar to mod_rewrite 3 rd party software that works with IIS since IIS doesn’t have a built-in mechanism for handling URL schemes
15
CIS 373---Web Standards-URI 15 of 17 What not to put in your URI Authors name – people can quit, be hired, change authorship Subject. Tricky to use, but better Status - Don’t use old, new, draft – keep the most recent document at the same url and archive the older versions Access. If the level of access to the document changes, then make sure that the url will not break –Use the same name for the document and the url File name extension. Even html file extension can change if you rewrite your pages in asp or java Software mechanisms. Don’t put the software you are using in the url – the software can change over time Disk name – Big no, no
16
CIS 373---Web Standards-URI 16 of 17 Conclusion URI’s are an important building block of the Internet It’s important to recognize them for what they can do for your web based applications. Remember uri’s should be consistent and not change over time
17
CIS 373---Web Standards-URI 17 of 17 For Next Week Papers and presentation printouts due next week First set of presentations next week Questions or problems with papers
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.