Title: Current Network Programming
1Current Network Programming
2AJAX (Asynchronous Javascript and XML)?
- Interactive way to develop web applications
- Goes beyond CGI into cleaner web UI
- No full refresh of entire page
- Started in early browsers, but coined in 2005
- Started as DHTML (Dynamic HTML)?
- Main goal is to display pages faster
- less data in first get/post
- only get what you need, then get more
later...... - Ability to get more rich client than thin
client
3AJAX Advantages/Disadvantages
- Advantages
- User Interface faster loading
- Bandwidth usage less since you only get what
you need - Separation of data, format, style and function
- Disadvantages
- Browser integration
- Response time (what if it takes too long per
get?)? - Search engines don't work
- Accessibility
4AJAX What is it?
- Javascript Needed to work behind the scenes
- Superset of ECMAScript (just more functions)?
- Loose typed object oriented scripting language
- Run in the browser, meaning client side
- DOM Document Object Model
- API for HTML and XML documents
- Language neutral
- Gives programmer access to web page elements
- Put them together...... AJAX
5AJAX Code Example
- function getTextFromXML( oNode, deep )
- var s ""
- var nodes oNode.childNodes
- for (var i 0 i lt nodes.length i)
- var node nodesi
- if (node.nodeType Node.TEXT_NODE)
- s node.data
- else if (deep true (node.nodeType
Node.ELEMENT_NODE node.nodeType
Node.DOCUMENT_NODE -
node.nodeType Node.DOCUMENT_FRAGMENT_NODE)) - s getTextFromXML(node, true)
-
-
-
- return s
6AJAX Where to Get More Info
- Google Suggest
- Mozilla
- http//www.w3schools.com/ajax
- Simply google AJAX
7RSS / ATOM
- RSS stands for
- .90 RDF Site Summary
- .91 Rich Site Summary
- 2.0.1 Really Simple Syndication
- ATOM
- Took up where RSS left off....
- RSS 2.0 is frozen and ATOM extends RSS
8RSS / ATOM Compared
- ATOM was designed to solve issues with RSS such
as - versioning
- plaintext and escaped HTML in RSS no way to
differentiate - ATOM
- autodiscovery
- XML namespace XML schema
- Global unique Ids
- xmlbase for relative URIs
9RSS Example
- lt?xml version"1.0"?gt
- ltrss version"2.0"gt
- ltchannelgt
- lttitlegtLiftoff Newslt/titlegt
- ltlinkgthttp//liftoff.msfc.nasa.gov/lt/linkgt
- ltdescriptiongtLiftoff to Space
Exploration.lt/descriptiongt - ltlanguagegten-uslt/languagegt
- ltpubDategtTue, 10 Jun 2003 040000
GMTlt/pubDategt - ltlastBuildDategtTue, 10 Jun 2003 094101
GMTlt/lastBuildDategt - ltdocsgthttp//blogs.law.harvard.edu/tech/rsslt/d
ocsgt - ltgeneratorgtWeblog Editor 2.0lt/generatorgt
- ltmanagingEditorgteditor_at_example.comlt/managingEd
itorgt - ltwebMastergtwebmaster_at_example.comlt/webMastergt
- ltitemgt
- lttitlegtStar Citylt/titlegt
- ltlinkgthttp//liftoff.msfc.nasa.gov/news/2003
/news-starcity.asplt/linkgt - ltdescriptiongtHow do Americans get ready to
work with Russians aboard the - International Space Station? They take a
crash course in culture, language - and protocol at Russia's Star
City.lt/descriptiongt
10ATOM Example
- lt?xml version"1.0" encoding"utf-8"?gt
- ltfeed xmlns"http//www.w3.org/2005/Atom"gt
- lttitlegtExample Feedlt/titlegt
- ltsubtitlegtA subtitle.lt/subtitlegt
- ltlink href"http//example.org/"/gt
- ltupdatedgt2003-12-13T183002Zlt/updatedgt
- ltauthorgt
- ltnamegtJohn Doelt/namegt
- ltemailgtjohndoe_at_example.comlt/emailgt
- lt/authorgt
- ltidgturnuuid60a76c80-d399-11d9-b91C-0003939e0af6
lt/idgt - ltentrygt
- lttitlegtAtom-Powered Robots Run Amoklt/titlegt
- ltlink href"http//example.org/2003/12/13/atom0
3"/gt - ltidgturnuuid1225c695-cfb8-4ebb-aaaa-80da344efa
6alt/idgt - ltupdatedgt2003-12-13T183002Zlt/updatedgt
- ltsummarygtSome text.lt/summarygt
11Servlet Technology
- Around since 1997
- Stems from CGI
- Ability to build applications past simple CGI
- Java
- Allows for client to become Java Objects in
server - Nice abstraction from CGI for
- State
- Authentication
- URL re-writing
- Ability to use GET and POST, POST preferred
- WAR file web application (from tar in Unix, but
Web)?
12Servlet Technology lifecycle of
- Servlet class created from container
- Container calls init() to start (only once)?
- Servlet container gets client requests (services)
- doGet()?
- doPost()?
- Container calls destroy() to shutdown
- Each client connection will invoke a Java Object
and can be extended to contain many other objects
and methods
13Servlet Technology Types of Containers
- Non-Commercial
- Apache Tomcat most popular
- Java System Application Server Sun Microsystems
- Geronimo Another Apache
- Commercial
- BEA WebLogic
- Borland Enterprise Server
- IBM WebSphere
- MacroMedia Jrun
- Commercial Open Source
- Jboss RedHat
14Servlet Technology Java Server Pages
- Compiled into Java Servlets
- Used to extend the Servlet API to do whatever you
want.... - Components of JSP
- Static HTML/XML
- Include directives
- Scripting elements and variables
- JSP Actions
- Tags
15Servlet Technology Java Server Pages - Example
-
- // Example of input to a servlet JSP
- lt_at_ page errorPage"myerror.jsp" gt
- lt_at_ page import"com.foo.bar" gt
- lthtmlgt
- ltheadgt
- lt! int serverInstanceVariable 1gt
- ...
- lt int localStackBasedVariable 1 gt
- lttablegt
- lttrgtlttdgtlt "expanded inline data " 1
gtlt/tdgtlt/trgt - ...
16Servlet Technology Java Server Pages - Example
- //Example Servlet Code
- import com.foo.bar //imported as a result of lt_at_
page import"com.foo.bar" gt - import ...
- class _myservlet implements javax.servlet.Servlet
, javax.servlet.jsp.HttpJspPage - //inserted as a
- //result of lt! int serverInstanceVariable
1gt - int serverInstanceVariable 1
- ...
- public void _jspService( javax.servlet.http.H
ttpServletRequest request, - javax.servlet.http.H
ttpServletResponse response )? - throws javax.servlet.ServletException,
- java.io.IOException
-
- javax.servlet.ServletConfig config
...//get the servlet config - Object page this
- PageContext pageContext ...//get the
page context for this request - javax.servlet.jsp.JspWriter out
pageContext.getOut()
17Servlet Technology Java Server Faces
- Technology for creation of User Interfaces
- One of many ways to build UIs
- Others include (struts, ASP.NET, Tapestry,
etc...)? - Implementations like MyFaces (Apache), Sun RI
- Ability to use backend beans for added
functionality - Current trends are merging AJAX to create Dynamic
Faces - Project GlassFish - Open Source Java EE 5
Application Server
18SOA Service Oriented Architecture
- Architecture that uses loosely coupled services
- Used in technologies such as
- CORBA
- DCOM
- Web Services
- Ability to connect to network functions or
objects - Think of it as a general use network based API
that is somewhat language neutral
19SOA Service Oriented Architecture
20SOA Service Oriented Architecture
- Principles
- Reuse, granularity, modularity, composability,
componentazation, and interoperability - Compliance to standards
- Services identification and categorization,
provisioning and delivery, monitoring and
tracking - Usually used with SOAP and Web Services
21Web 2.0 Putting it all together!
22Web 2.0 Putting it all together!
- 2nd Generation of Web Based applications
23Web 2.0 Putting it all together!
- Key Principles
- Web as an application platform
- Data is driving force
- Architecture is based on participation
- Innovation by pulling distributed components
together - THE END OF THE SOFTWARE ADOPTION CYCLE!!!!
- (the perpetual BETA program!!)?
- Easy to pick up by the early adopters
24Web 2.0 Putting it all together!
- Tim O'Reilly Four plus one levels of hierarchy
- Level 3 Applications that ONLY exist on the
Internet - e.g. craigslist, ebay, Wikipedia
- Level 2 Can live offline, but gain value online
- e.g. Flickr
- Level 1 Can live offline, but gain features
online - e.g. Google spreadsheets/etc..
- Level 0 Work as well offline
- e.g. MapQuest, Google Maps
25Web 2.0 Futures?
- MAYA Design Most Advanced, Yet Acceptable
- www.maya.com
- Group formed from 3 Carnegie Mellon University
colleagues - Concept of Information Commons
- Trying to reduce complexity of data
- Internet Zero MIT Center for Bits and Atoms
- Emerging standard for connecting everything
- IP in the physical world
- Multi-disciplinary team and approach
26SaaS (Software as a Service)?
- SaaS salesforce.com CRM example
- Reduces the need for
- Capital expenditures
- Maintenance costs
- Upgrade (hardware and software)?
- Integration (possibly)?
- Negative
- You get what you get
- Usually not a good integration point
27SaaS (Software as a Service)?
- SaaS salesforce.com CRM example
- Reduces the need for
- Capital expenditures
- Maintenance costs
- Upgrade (hardware and software)?
- Integration (possibly)?
- Negative
- You get what you get
- Usually not a good integration point
28Mashups
- Ability to plug in web2.0 components into a
single page - Normally seen in Wiki pages
- Current examples
- www.mapdango.com
- Technologies to mash
- Facebook
- Twitter
- YouTube
- Google
- Wikis