Presentation is loading. Please wait.

Presentation is loading. Please wait.

Basic WEB Architecture 1. Data Driven WEB Architecture 2.

Similar presentations


Presentation on theme: "Basic WEB Architecture 1. Data Driven WEB Architecture 2."— Presentation transcript:

1 Basic WEB Architecture 1

2 Data Driven WEB Architecture 2

3 Recent WEB Applications Architecture 3

4 Client Tier 4

5 Service Tier 5

6 The Web as a Platform for Running Applications 6

7 Service Oriented Application (SOA) 7

8 8

9 9

10 10

11 Service Oriented Application (SOA) 11

12 Front-End 12

13 Front-End 13

14 Service Oriented Application (SOA) 14

15 Middle Layer – Data Link 15

16 Service Oriented Application (SOA) 16

17 Back-End- Server Site 17

18 GROUP DISCUSSION 18 WHAT TO DO?WHAT TO DO?

19 What is XML?  eXtensible Markup Language, is a specification for creating custom markup languages  W3C Recommendation  Primary purpose is to help computers to share data  XML is meta-language. This means that you use it for creating languages.  XML is an extensive concept.

20 XML Document  Every XML-document is text-based  => sharing data between different computers!  => sharing data in Internet!  => platform independence!

21 Binary vs. Text  Problems with Binary format –Platform depence –Firewalls –Hard to debug –Inspecting the file can be hard  Since XML is text-based, it does not have the problems mentioned above.  What are the disadvantages in text format?

22 XML Doc Advantages  Easy data sharing, text documents are readable between any device.  Documents can be modified with any text editor.  Possible to understand the contents of the xml- document just by looking at it with text editor.  Easy to manipulate via programming languages  Two levels of correctness: Well formed and Valid.

23 .doc – file format Windows MS Word 2000 Mac OS X Since.doc is closed binary-format, there are very few alternatives for word processors that fully support the doc – file format 0101011010101010001010 1010101110101010001011 1010101110101010110101 1110101010101010101010

24 .docx – file format (Office Open XML) Windows MS Word 2007 Mac OS X Hopefully in the future there will be loads of free programs that support this new open and easy access file format title. Now the format is open and it's much easier to access

25 SGML vs. XML SGML: Standard Generalized Markup Language XML HTML (.html) XHTML (.xhtml) MathML (.mml) OOXML (.docx)

26 XML – Meta Language  XML is meta language, which you can use to create your own markup languages.  There are several XML Markup Languages made for different purposes  All the languages have common xml-rules  Languages: XHTML, OOXML, Open Document, RSS, SVG, SOAP, SMIL, MathML...  List: –http://en.wikipedia.org/wiki/List_of_XML_markup_languages

27 XHTML - Example <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Minimal XHTML 1.0 Document This is a minimal XHTML 1.0 document.

28 SVG - Example <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"/>

29 MathML (Open Office) x =... x = {-b +-sqrt{b^{2}-4{ac}} } over {2 {a}}

30 RSS 2.0 - Example W3Schools Home Page http://www.w3schools.com Free web building tutorials RSS Tutorial http://www.w3schools.com/rss New RSS tutorial on W3Schools XML Tutorial http://www.w3schools.com/xml New XML tutorial on W3Schools

31 XML Editors  XML Spy  EditiX  Microsoft XML Notepad  Visual XML  XML Viewer  Xeena  XML Styler, Morphon, XML Writer…

32 WELL FORMED XML - DOCUMENT Rules that Apply to Every XML-Document

33 Correctness  There are two levels of correctness of an XML document: 1.Well-formed. A well-formed document conforms to all of XML's syntax rules. 2.Valid. A valid document additionally conforms to some semantic rules.  Let's first look at the XML's syntax rules (1).

34 Simple Generic XML Example Introduction to XML XML is...

35 XML-Declaration  XML-declaration is optional in XML 1.0, mandatory in 1.1. –Recommendation: use it.  Version: 1.0 or 1.1  Encoding: character encoding, default utf-8  Standalone: –is the xml-document linked to external markup declaration –yes: no external markup declarations –no: can have external markup declaration (open issue..) –default: "no"

36 Comparing Declarations Introduction to XML XML is... Introduction to XML XML is... Same Declaration

37 Element vs. Tag vs. Attribute  Element consists of start tag, optional content and an end tag: – Introduction to XML  Start tag –  Content –Introduction to XML  End tag –  Start tag may have attribute –

38 Rules about Elements  Only one root - element  Every element contains starting tag and an ending tag  Content is optional: Empty element –  Tag – names are case-sensitive: –  Elements must be ended with the end tag in correct order: – problem here <!– Error 

39 Rules about Attributes  XML elements can have attributes in the start tag.  Attributes must be quoted: –

40 Naming Tags  Names can contain letters, numbers, and other characters  Names must not start with a number or punctuation character  Names must not start with the letters xml (or XML, or Xml, etc)  Names cannot contain spaces

41 Well-Formed XML  XML document is well-formed if it follows the syntax rules.  XML document must be well-formed! –it's not an xml-document, if it does not follow the rules..

42 Is this Well-Formed XML Document? Minimal XHTML 1.0 Document This is a minimal XHTML 1.0 document.

43 Is this Well-Formed XML Document? Minimal XHTML 1.0 Document This is a minimal XHTML 1.0 document.

44 VALID XML DOCUMENT Defining the Structure for XML documents

45 Valid XML  XML document is valid if –1) It is well formed AND –2) It follows some semantic rules  XML document is usually linked to an external file, that has semantic rules for the document. –The file can be dtd (.dtd) or schema (.xsd)  Semantic rules? –Name of tags, order of elements

46 DTD Linking <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Minimal XHTML 1.0 Document This is a minimal XHTML 1.0 document. Rules for XHTML elements (order, names, etc)

47 DTD Linking Defines the structure, tag names and order for all xhtml - documents W3C has created XML-language "XHTML" by defining it's rules in DTD. W3C has created XML-language "XHTML" by defining it's rules in DTD.

48 Is this valid XML Document? Minimal XHTML 1.0 Document This is a minimal XHTML 1.0 document. 1.There is no DTD! What language is this? MathML? SVG? XHTML? 2.Assuming this is XHTML, what version of XHTML? Transitional? Strict? 3.Assuming this is XHTML strict, does "jorma" – tag belong to XHTML Language? 1.There is no DTD! What language is this? MathML? SVG? XHTML? 2.Assuming this is XHTML, what version of XHTML? Transitional? Strict? 3.Assuming this is XHTML strict, does "jorma" – tag belong to XHTML Language?

49 Invalid XHTML-document <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Minimal XHTML 1.0 Document This is a minimal XHTML 1.0 document.

50 Validating with W3C Service

51 Invalid XHTML in Browser? May work... or not. Browser tries to detect the errors and tries to understand them. If it works with one browser, are you certain that it works with all other browsers? And with all the versions with the browsers? What about browsers in handheld devices? And it might work now, but what about future? How will Firefox 5.0 handle incorrect web pages? May work... or not. Browser tries to detect the errors and tries to understand them. If it works with one browser, are you certain that it works with all other browsers? And with all the versions with the browsers? What about browsers in handheld devices? And it might work now, but what about future? How will Firefox 5.0 handle incorrect web pages?

52 Invalid XML in General  Because of HTML heritage, browsers try to understand invalid XHTML-pages  This is not the case in other XML-languages.  In general, if XML-document is invalid, the processing of the document is cancelled.

53 JavaScript Object Notation (JSON)

54 JSON JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent. These properties make JSON an ideal data- interchange language.

55 Why JSON?  Because JSON is lightweight, easy to understand, manipulate and generate, it has almost replaced XML which was used previously as the only data- interchange format.  JSON is preferable because of the following reasons: –XML is heavier than JSON –to parse XML, we have to use xPath which is an overhead removed in JSON because JSON is native to JavaScript –XML uses tags to describe user data and tags increase the size of data

56 JSON Structures  JSON is built on two structures: –A collection of name/value pairs. In various languages, this is realized as an object, record, dictionary, hash table, keyed list, or associative array. –An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.

57 Syntax of JSON Object An object is an unordered set of name/value pairs. An object begins with { (left brace) and ends with } (right brace). Each name is followed by : (colon) and the name/value pairs are separated by, (comma).

58 Syntax of JSON  Array –An array is an ordered collection of values. –An array begins with [ (left bracket) and ends with ] (right bracket). Values are separated by, (comma).

59 Syntax of JSON  A value can be a string in double quotes, or a number, or true or false or null, or an object or an array. These structures can be nested.  A string is a collection of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. A character is represented as a single character string. A string is very much like a C or Java string.

60 JSON Example { “students” : [ {“id":1, "name":"Adnan Sohail"}, {“id":2, "name":"Irfan Razzaq"} ] }

61 XML Example 1 Adnan Sohail 2 Irfan Razzaq

62 Validating JSON & JSON Security  JavaScript’s built-in method eval() is used to validate a JSON string.  Note: –Use eval() only when the source is authentic and trusted which means use it only if you are sure that the string passed to it is a valid JSON string  When you’ve security risks use var myObject = myJSONtext.parseJSON();  Which is available in http://www.json.org/json.js http://www.json.org/json.js –but eval() is faster than parseJSON()

63 Using JSON APIs  JSON strings can be easily generated using JSON APIs available at http://json.orghttp://json.org  There are two main classes available in org.json.* package – org.json.JSONObject – org.json.JSONArray  Strings can be generating from objects of JSONObject or JSONArray using their toString() methods

64 Benefits of JSON over XML  JSON supports data types like string, integer, boolean etc.  JSON is native data format for JavaScript and therefore it faster for the browser to read and understand.  As JSON contains no tags but data and therefore less data to be transferred between client and the server. So, it’s lighter than XML.  Easy for humans to read and write.

65 JSON References  http://www.xul.fr/en-xml-ajax.html  http://www.xul.fr/ajax-javascript-json.html  http://json.org/  http://www.json.org/java/

66 WEB SERVICE DESCRIPTION LANGUAGE (WSDL)

67 Introduction  WSDL is an XML language that contains information about the interface semantics and ‘administrivia’ of a call to a Web Service  Once you develop a Web Service you publish its description and a link to it in a UDDI repository so that potential users can find it  When someone wants to use your service, they request the WSDL file in order to find out the location of the service, the function calls and how to access them  Then they use this information in your WSDL file to form a SOAP request to the computer

68 Definitions  Definitions: - WSDL is an XML-based language used to define Web Services and describe how to access them. - WSLD is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information.

69 Working of WSDL Figure 1. A client invoking a Web service.

70 Working of WSDL contd. Figure 2. WSDL terminology used for describing Web services.

71 Working of WSDL (with Java) contd.

72 Where does it fit in?

73 What is UDDI?  Universal Description Discovery and Integration  Industry-wide initiative supporting web services  Specifications  Schemas for service description  Schemas for business (service implementers) description  Developed on industry standards (XML, HTTP, TCP/IP, SOAP)  Applies equally to XML and non-XML web services  Implementation  Public web service registry and development resources

74 Industry-Wide Project Support  All major technology providers  Global corporations  Strong resource and product commitment  Roadmap for transition to standards body  Unprecedented collaboration  XML and Web Services recognized as core standards  Competition on services built on a common model  Technology, platform, and development language neutral

75 What Problems Do We Solve? An organization needs to create 400 electronic relationships with partners, each with its own standards and protocols Broader B2B A small business wants to be “plugged in” to every marketplace in the world, but doesn’t know how SmarterSearch A B2B marketplace cannot get catalog data for relevant suppliers in its industry, along with connections to shippers, insurers, etc. EasierAggregation Describe Services Discover Services Integrate Them Together Provide a standards-based profile for all electronic services that are provided. Includes web sites, other electronic resources Web Service Visibility Publish for Accessibility

76 Foundation for Web Services Ubiquitous Communications: Internet Universal Data Format:XML Service Interactions:SOAP Formal Service Descriptions:WSDL Broad Industry Support, Simple Process Publish and Discover Services:UDDI

77 UDDI Registry Entries  Standards Bodies, Agencies, Programmers, Publishers register specifications for their Service Types  Service providers register precise information about themselves and their Web services

78 Business name General business description –Any number of languages Contact info –Names, phone numbers, fax numbers, web sites, etc. Known identifiers –List of unique identifiers for a business D-U-N-S, Thomas, domain name, stock ticker symbol, other

79 Business categories –3 base taxonomies in V1 Industry: NAICS (Industry codes - US Govt.) Product/Services: UNSPSC (ECCMA) Location: Geographical taxonomy (ISO 3166) …easy extension in upcoming releases

80 New set of information businesses use to describe how to “do e-commerce” with them –Nested model Business process (functional) Service specifications (technical) Binding information (implementation) –Programming/platform/ implementation agnostic –Services can also be categorized

81 How UDDI Works UDDI Registry 3.3. UDDI Registry assigns a programmatically unique identifier to each service and registration Marketplaces, search engines, and business applications query the registry to discover services at other companies and to facilitate integration 4.4.4.4. Service Types 1.1.1.1. Implementations Implementers populate the registry with descriptions of their businesses and the services they expose 2.2.2.2. Large businesses apply the same architecture and technologies internally 5.5.5.5. Software companies, standards bodies, and developers populate the registry with descriptions (specifications) of types of services

82 Public Registry Operation IBM HP (planned) Microsoft other Peer registry nodes (websites) Information registered with any node Registrations replicated on a daily basis Complete set of “registered” records available at all nodes Common set of SOAP APIs supported by all nodes Compliance enforced by business contract All technologies applied –Interoperability verified constantly UDDI.org queries Applications Marketplaces End Users Developers

83 UDDI and SOAP User UDDI SOAP Request UDDI SOAP Response UDDI Registry Node HTTP Server SOAP Processor UDDI Registry Service B2B Directory Create, View, Update, and Delete registrations Implementation- neutral

84 GROUP DISCUSSION 84 WHAT TO DO?WHAT TO DO?


Download ppt "Basic WEB Architecture 1. Data Driven WEB Architecture 2."

Similar presentations


Ads by Google