Presentation is loading. Please wait.

Presentation is loading. Please wait.

Week 23 - Revision1 Week 23 Revision DSA. Week 23 - Revision2 Agenda Section A: Multiple choice Section B: Problem-oriented questions Topics for revision.

Similar presentations


Presentation on theme: "Week 23 - Revision1 Week 23 Revision DSA. Week 23 - Revision2 Agenda Section A: Multiple choice Section B: Problem-oriented questions Topics for revision."— Presentation transcript:

1 Week 23 - Revision1 Week 23 Revision DSA

2 Week 23 - Revision2 Agenda Section A: Multiple choice Section B: Problem-oriented questions Topics for revision Review of issues arising from coursework Tutorial – work on section B questions

3 Week 23 - Revision3 Section B Explaining and designing 3 tier applications based on a relational or an XML database Data modelling in ER models and XML structures –Location based data Understanding the languages used – PHP (good reading knowledge) –XML based languages (XSLT, XQuery) general understanding Tackling problems in design e.g. –Redundancy –Separation of concerns –State Alternatives in design – which technology to use – e.g. Relational v XML database, scripting languages

4 Week 23 - Revision4 Topics Describing a web application XML technologies Redundancy Schema and data – separating the specific from the general Data- appearance separation

5 Week 23 - Revision5 Describing web applications What the components are: –Developed resources html pages, scripts, data file, images –Data sources outside the application RSS feeds –Infrastructure components needed Web server, browser, plugins. How components interact to carry out a task ( a use case) –Use a sequence diagram –Use a narrative – tell a story

6 Week 23 - Revision6 Meta-data for an active component (e.g. a PHP script) Admin –Who wrote it when –What work remains Interface –What inputs it has (parameters, data sources) –What sub-components it relies on –What it produces Function –An overview of what it does –Tricky parts

7 Week 23 - Revision7

8 8 Sequence Diagrams Describe a specific sequence of actions of system components and interchanges between components Components represented as columns Time goes down the page Include only relevant components Describes a specific ‘move’, not all possible ‘moves’ Examples –Typical CW siteTypical CW site

9 Week 23 - Revision9 Diagrams Use an established convention Consider using a diagramming tool which supports the notation you want to use but get practice in hand drawing diagrams for the exam. Use different icons or symbols to distinguish different kinds of components

10 Week 23 - Revision10

11 Week 23 - Revision11 XML, XML Schema, XSLT, XQuery XML is a data representation format –e.g.track2.xml XML Schema is an (XML) language for defining the structure of a family of XML documents –e.g sd.xsd –Could we write a schema for XML schema? XSLT is an (XML) language for defining a transformation from one or more XML documents to an other XQuery is a (non XML) language for defining transformations, with an emphasis on quering an XML document or database of documents

12 Week 23 - Revision12 SequenceDiagram name="track2">

13 Week 23 - Revision13 …..

14 Week 23 - Revision14

15 Week 23 - Revision15 XSLT

16 Week 23 - Revision16 XQuery {for $a in $sd/cast/actor return string($a/@name) } for $x in $sd/trace/* return { if (name($x)='action') then let $p := index-of($sd/cast/actor/@name,$x/@at ) return ( for $i in (1 to $p - 1) return, if ($x/@url) then string($x/@do) else string($x/@do) ) else if (name($x)='message')

17 Week 23 - Revision17 Redundancy The same text repeated a number of times causes problems in programming E.g. where the same code to access an RSS feed appears in 6 different but very similar scripts Why is this a problem?

18 Week 23 - Revision18 Problems with redundancy If an fault was found in the RSS code, it would need fixing in many places, not just in one place If another place was added, the correct version of the code would need to be located If all place code was removed, the rss access code would be lost too.

19 Week 23 - Revision19 Solution - Factoring ‘Factoring’, normalisation.. –42 = 2 * 3 * 7 Factor out the common text –Into a module (function) for code myFun( a, b) –Into constant and variable parts mylongurl?name= XXX –Into data and schema Emp (name, number) – (‘fred,’3), (‘joe’,90) Recombine –At run-time, make the general script behave in a specific way by combining the constant part with the variable part –Parameters on functions myFun( 10, 20) –Concat($baseurl,$code,’.xml’) –SQL engine select * where name=‘joe’

20 Week 23 - Revision20 Normalisation in Database Just the same problems Factor out the repeated data into a separate table and link with a common key To recreate the data, de-normalize using a join to get back to the combined data

21 Week 23 - Revision21 Data and appearance 3 Tier architecture Separating the base data –Data layer Relational tables, XML data from how it is used in an application –Business or application layer Server side scripting from how it appears to a user –Presentation layer CSS, Javascript Distinction is crucial but hard to make

22 Week 23 - Revision22 Tutorial Work through a couple of the questions Answer pointers available next week


Download ppt "Week 23 - Revision1 Week 23 Revision DSA. Week 23 - Revision2 Agenda Section A: Multiple choice Section B: Problem-oriented questions Topics for revision."

Similar presentations


Ads by Google