Upload
buck-webb
View
213
Download
0
Embed Size (px)
Citation preview
Creating Databases for Web Applications
Work session
Open Source versus Proprietary
important topics
HW: finish* projects. Look at final quiz guide. Final posting.
Final posting
• post your considered, reasoned opinion on Open Source vs proprietary; asp versus php; Access versus MySql; or any related issue.
• Catch up on other postings.
Postings: php vs asp, etc.
• Proprietary can be companies other than Microsoft. For example, Cold Fusion is product of Macromedia (formerly Allaire).
• Keep in mind that there are many topics, functions, relevant standards,etc. in these systems that we did not cover.
Things to consider
• … things to store away in the back of your mind for consideration when building a 'real' Web application.
Performance• Performance of Web sites governed by connection
AND site itself.– presence of large images, other large files, big
consideration.
• Some DBMS provide for stored procedures that carry out a query. Sometimes these can involve parameters. This is a way to improve performance. The function is compiled and not interpreted.
• Some DBMS provide for (extra) index fields besides the primary key. This is another way to improve performance.
Important topics
• multiple (concurrent) users of database– DBMS may handle this. – single table versus multiple tables– transaction concept
• writing/updating across multiple tables
• paging– handling of large[r] recordsets
Important topics, continued• scaling up application
– multiple users; many, many users– larger tables
• maintenance of program– version control– backup
• databases• scripts / code
– data base administrator• data dictionary
– 'quality assurance'• test suite• bug/feature list• investigate how bugs happen
Important topics, continued
• disaster control– backup data stores– backup procedure
• security– hackers– insiders
Note: security protections also help in benign situations: knowing where you need to look and where you don't need to look to uncover problems.
Reminder: Objectsare information + procedures
properties + methodsattributes + operatorsinformation + behavior
… can be defined by you, the programmer. DOM is the Document Object Model used for client side
(for example, document.write( ) ).asp is essentially a set of objects (Request, Response, etc.)
called the intrinsic objects.php support resembles other oo languages more than
JavaScript (maybe more than VBScript?)
php example (partial)class node {var $mparent; var $mfirstchild; var $mnextsib; var
$mname; var $mlocation; }function Node ($parent, $name, $location) {$this->mparent = $parent;$this->mname=$name;$this->mlocation=$location; }function addchild($child) {if isset($firstchild=$this->mfirstchild) {
$firstchild.addsib($child) }else {$this->mfirstchild=$child;} }function addsib($sib) { } }
ends class
constructor method
php example…$newnode = new Node (&$current, 'curley', 'NYC');
invokes a call to the constructor function node, which sets up an instance of a node.
… $current.addchild (&$newnode);this invokes the method of $current that will connect it to
$newnode.Access object properties: … = $current.mlocation;
see next
more php
• inheritance:– class specialcustomer extends customer { }
• overriding– re-use name of method
• reference operator (pointer)– $place = &$node; $place will refer to same thing, not a
copy
• eval ($string); evaluates the contents of $string.
JavaScript OO support• Limited, but can use functions in a var statement and
can name a procedure as a property.– connects data and code
• Neither php nor JavaScript has information hiding mechanisms– This is not for keeping something secret as much as for
catching an error during compilation that would otherwise lead to a logical, runtime error.
• no inheritance support– building objects from other objects to save redundant coding
AND have the system apply the appropriate procedure.
JavaScript OO support: basic
var node = new Object();
node.mname= "curley";
node.addchild=addchild;
a function defined elsewhere
JavaScript example: using constructor
function node (parent, name, location){this.mparent = parent;this.mname = name;this.mlocation = location; this.addchild=addchild;this.addsib = addsib;}
function addchild (child) { }function addsib (sib) { }
this is term for thing being created.
JavaScript example: usage
var person = new node (parent, 'moe','nyc');
parent.addchild(person);
… = person.mlocation;
Benefits of oo
• Encapsulates information and treatment of information to make code either to maintain and to re-use– only one place to check and to modify if you
need to change how you 'add a child' in the previous example.
– catches errors as compilation (syntactic) errors.
Emerging technologies, infrastructure
• broadband• wireless—smaller devices• WAP, XML, XSL, XSLT, WML• Application Service Providers• new/not so new offerings:
– Cold Fusion– asp.net, vb.net, Active X objects (for sale)– Open Source
• php 4.3.6 www.php.net
XML
• Building XML applications with Java– Large[r] applications requiring communication
between components
• Creating User Interfaces– xml and xslt, also wml, VoiceXML
Questions for final quiz
• See guide to final quiz posted online.
• Note: final will be open book, open notes. You do need to study.