Online Shopping
Online Shopping
Online Shopping
INTRODUCTION The Online Shopping is a web based application intended for online retailers. The main objective of this application is to make it interactive and its ease of use. It would make searching, viewing and selection of a product easier. It contains a sophisticated search engine for user's to search for products specific to their needs. The search engine provides an eas and convenient wa to search for products where a user can Search for a product interactivel and the search engine would refine the products available based on the user!s input. The user can then view the complete specification of each product. The can also view the product reviews and also write their own reviews. The application also provides a drag and drop feature so that a user can add a product to the shopping cart b dragging the item in to the shopping cart. The main emphasis lies in providing a user friendl search engine for effectivel showing the desired results and its drag and drop behavior. Services from a store that serves both walk"in customers and online customers. The online shopping s stem presents an online displa of an order cutoff time and an associated deliver window for items selected b the customer. The s stem accepts the customer's submission of a purchase order for the item in response to a time of submission being before the order cutoff time. The online shopping s stem does not settle with a credit supplier of the customer until the item selected b the customer is picked from inventor but before it is delivered. Therefore, the customer can go online and make changes to the order. In addition, available service windows are presented to the customer as a function of customer selected order and service t pes# and further, the order picking is assigned in accordance with a picker's preference. 1.1 OFFLINE SHOPPING: $ wide range of emotions involving various t pes of social interactions engages our five senses
&eared towards reducing the user!s cognitive burden through functional and performance based 'ebsite design heuristics (ngages onl % of our senses
CHAPTER 2 ANALYSIS
<
SYSTEM RE&UIREMENT ANALYSIS 2.1 I%"$r'a#!$% Ga#(er!%) $s the goal of the application is ease of use and to provide an interactive interface, e=tensive research has been done to gain an insight into the needs and behaviors of various users. The working of the application is made convenient and eas to use for the end user. 1r $ndresen, $ssociate )rofessor, >IS provided regular feedback on the project. ?sers can be classified into two t pes based on their knowledge of the products that suit their needs. The can be classified as users who know about the product that would satisf their needs and users who have to figure out the product that would satisf their needs. ?sers who know about the product should be able to find the product eas with the click of a button. Such users can search for the product b using the product name as the search term. ?sers who have to figure out the product that would satisf their needs could use a search term to find a list of products and then should be able to filter the results based on various parameters like product t pe, manufacturer, price range, platform supported etc. The users should be able to view the complete specification of the product and various images at different @oom levels. The user should be able to read the customer reviews for the product and the ratings provided. The should be able to write their own reviews. The should be able to print out the specifications for a product or email the product page to a friends etc. To increase the ease of use the user should be able to add a product to the shopping cart b dragging a product and dropping it in the shopping cart. $ user should -
able to edit the contents of a shopping cart. The should be able to update the 0uantities of the products added to the cart and remove the products from the cart. The user should be able to remove the product from the shopping cart b dragging the product and dropping it outside the cart. The application can be made interactive b pop up messages when a product has been dropped in to the shopping cart or out of the shopping cart. The user can be notified if the cursor enters a drop area and the object that could be dropped. $lso users are impatient making it important to load pages soon. Other than this, I did a lot of research on various other methods of building this application which and was able to incorporate a few stronger features into the application.The tools and controls used in the application are recommended $S).5(T controls and $A$4 Toolkit controls which improves the navigation and usabilit and interactivit .
2.2 S*+#e' Fea+!,!-!#* The s stem feasibilit can be divided into the following sectionsB 2.2.1 E $%$'! Fea+!,!-!#* The project is economicall feasible as the onl cost involved is having a computer with the minimum re0uirements mentioned earlier. 6or the users to access the application, the onl cost involved will be in getting access to the Internet. 2.2.2 Te (%! a- Fea+!,!-!#* To deplo the application, the onl technical aspects needed are mentioned belowB Operating (nvironment 'in %...34)
F$r U+er+: Internet /rowser Internet >onnection 2.2.. /e(a0!$ra- Fea+!,!-!#* The application re0uires no special technical guidance and all the views available in the application are self e=planator . The users are well guided with warning and failure messages for all the actions taken.
2.. E1!+#!%) S*+#e' There are large numbers of commercial Online Shopping websites offering large number of products tailored to meet the shopping interests of large number of customers. These online marketplaces have thousands of products listed under various categories. Pr$,-e': The basic problems with the e=isting s stems are the non"interactive environment the provide to the users. The use of traditional user interfaces which make continuous post backs to the server# each post back makes a call to the server, gets the response and then
refreshes the entire web form to displa the result. This scenario adds an e=tra trade off causing a dela in displa ing the results $ search engine that would displa the results without allowing the users to further filter the results based on various parameters. ?se of traditional and non user friendl interfaces that are hard to use
2.4 Pr$p$+ed S*+#e' Shopping has long been considered a recreational activit b man . Shopping online is no e=ception. The goal of this application is to develop a web based interface for online retailers. The s stem would be eas to use and hence make the
shopping e=perience pleasant for the users. The goal of this application is
To develop an eas to use web based interface where users can search for products, view a complete description of the products and order the products.
$ search engine that provides an eas and convenient wa to search for products specific to their needs. The search engine would list a set of products based on the search term and the user can further filter the list based on various parameters.
$n $A$4 enabled website with the latest $A$4 controls giving attractive and Interactive look to the web pages and prevents the anno ing post backs.
1rag and 1rop feature which would allow the users to add a product to or remove a product from the shopping cart b dragging the product in to the shopping cart or out of the shopping cart.
$ user can view the complete specification of the product along with various images and also view the customer reviews of the product. The can also write their own reviews. S$-2#!$% #$ #(e E1!+#!%) S*+#e': to allow the user to with The motive of this Online Shopping 'eb $pplication is the search tool and create different
combinatorial search criterion to perform e=haustive search. ,aking the application $A$4 enabled gets rid of these unnecessar dela s letting the user to perform e=haustive search. The users of this application can easil feel the difference between the $ja= empowered user interfaces vs. traditional user interfaces. )rovide Interactive interface through which a user can interact with different areas of application easil . $ search engine that provides an eas and convenient wa to search for product specific to their needs. The search engine would list a set of products based on the search term and the user can further filter the list based on various parameters. )rovide 1rag and 1rop feature thereb allowing the user to add products or remove products from the shopping cart b dragging the products in to or out of the shopping cart. S $pe:
The current s stem can be e=tended to allow the users to create accounts and save products in to wish list. The users could subscribe for price alerts which would enable them to receive messages when price for products fall below a particular level. The current s stem is confined onl to the shopping cart process. It can be e=tended to have a eas to use check out process. ?sers can have multiple shipping and billing information saved. 1uring checkout the can use the drag and drop feature to select shipping and billing
information. 2.3 S*+#e' A%a-*+!+ $fter carefull anal Eing the re0uirements and functionalit of the web application, I had two important diagrams b the end of the anal sis phase. The are the (+ diagram and data flow diagram which were the basis for finding out entities and relationships between them, the flow of information. 2.4 ER D!a)ra'
1.
11
1%
1;
1<
1-
2.5 De+!)% 2.5.1 De+!)% G$a-+ The design of the web application involves the design of the forms for listing the products, search for products, displa the complete specification for the product, and design a shopping cart that is eas to use. 1esign of an interactive application that enables the user to filter the products based on different parameters. 1esign of an application that has features like drag and drop etc. 1esign of application that decreases data transfers between the client and the server. 2.6 De+ r!p#!$% $" Ar (!#e #2ra- De+!)% In this conte=t diagram, the information provided to and received from the FOnline Shopping! is identified. The arrows represent the information received or generated b the application. The closed bo=es represent the set of sources and sinks of information. In the s stem, we can observe that the user interacts with the application through a graphical user interface. The inputs to the s stem are the Search and 6ilter criteria provided b the user and a new review written b the user. $lso, the output is in the form of +epeater and grid views which present the users with list of )roducts available. The users can view complete specification, view Images and reviews b other users.
12
1C
through the products and each product would be displa ed with an image and its features like operating s stem supported, number of user licenses and if it is a full version or an upgrade version. $ user can add a product to the cart either b dragging the product and dropping it in the cart or b clicking a button. The user would be able to see the shopping cart summar . 2.7.2 Pr$d2 # De+ r!p#!$% M$d2-e This module starts when a user visits the product description page. $ user can view various images of the product of different siEes. The use can see an enlarged image in a popup window. The user can view the complete specification of the product like its features, operating s stem supported, s stem re0uirements etc. $ user can also view the manufacturer information and also information about rebates, e=change policies etc. $ user can also view the reviews of the product. $ user can also write a review for the product. 2.7.. S($pp!%) Car# M$d2-e This module starts when the user views the shopping cart. $ll the products that have been added to the shopping cart b the user are listed along with their price and the 0uantit . The total price of all the products added to cart is displa ed. $ user can edit the 0uantit of each product or remove the product from the shopping cart. $ user can remove the product from the cart b clicking a button or b dragging the product and dropping it outside the cart. The total price changes accordingl when a user edits the 0uantit of a product or when a product is removed from the cart. 2.19 Te (%! a- D!+ 2++!$%+ The products can be filtered based on various parameters like ,anufacturer, )roduct T pe, Operating S stem supported etc. Initiall it was decided to have the various list items predefined. /ut with time new manufacturers and product t pes could be added. So the values for the list of manufacturers and product t pes are loaded d namicall b retrieving from the database. $lso it was decided initiall to have a drop down list for price range and the user could select a price range from the ranges available. /ut this would limit 18
the user!s abilit to filter the products based on different price ranges. Instead providing two te=t fields so that the user can enter their price range would give them more fle=ibilit . $ product could be added to a shopping cart b dragging it and dropping it in the cart area. Items in the cart could be removed b clicking a button. To maintain s mmetr and ease of use products could be removed from the cart b dragging the product out of the cart. $ product can be added to the cart b dragging it and dropping it in the cart. Initiall it was decided that when a product is dropped in the cart the cart summar label could be updated on the client side without an call to the server and later the session variables GShopping cartH could be updated. This would result in loss of information when the user loses internet connection. So when a product is dropped in the cart area a web service is called and this service updates the session variables for the shopping cart and the cart summar is recalculated and sent back to the client. This would improve the reliabilit of the application.
1D
CHAPTER .
%.
developed b
,icros stems and released in 1DD- as a core component of Sun ,icros stems' Aava platform. The language derives much of its s nta= from > and >II but has a simpler object model and fewer low"level facilities. Aava applications are t picall compiled to b te code Gclass fileH that can run on an architecture. The original and reference implementation Aava compilers, virtual machines, and class libraries were developed b Sun from 1DD-. $s of ,a %..C, in compliance with the specifications of the Aava >ommunit )rocess, Sun made available most of their Aava technologies as free software under the &5? &eneral )ublic :icense. Others have also developed alternative implementations of these Sun technologies, such as the &5? >ompiler for Aava and &5? >lass path. Aava is an object"oriented programming language developed initiall b Aames &osling and colleagues at Sun ,icros stems. The language, initiall called Oak Gnamed after the oak trees outside &osling's officeH, was intended to replace >II, although the feature set better resembles that of Objective >. Aava should not be confused with AavaScript, which shares onl the name and a similar >"like s nta=. JAavaJ generall refers to a combination of three thingsB the Aava programming language Ga high"level, object"oriented programming languageH# the Aava *irtual ,achine Ga high"performance virtual machine that e=ecutes b te codes on a specific computing platform, t picall abbreviated A*,H# and the Aava platform, a A*, running compiled Aava b te codes, usuall calling on a set of standard libraries such as those provided b Aava Standard (dition GS(H or (nterprise (dition G((H. Though coupled b design, the language does not impl the A*,, and vice versa. H!+#$r* Aames &osling initiated the Aava language project in Aune 1DD1 for use in one of his man set"top bo= projects. The language, initiall called Oak after an oak tree that stood outside Aava virtual machine GA*,H regardless of computer
%1
&osling's office, also went b the name &reen and ended up later renamed as Aava, from a list of random words. &osling aimed to implement a virtual machine and a language that had a familiar >3>II st le of notation. Sun released the first public implementation as Aava 1.. in 1DD-. It promised J'rite Once, +un an whereJ G'O+$H, providing no"cost run"times on popular platforms. 6airl secure and featuring configurable securit , it allowed network" and file"access restrictions. ,ajor web browsers soon incorporated the abilit to run Aava applets within web pages, and Aava 0uickl became popular. 'ith the advent of Aava % Greleased initiall as A%S( 1.% in 1ecember 1DD8H, new versions had multiple configurations built for different t pes of platforms. 6or e=ample, A%(( targeted enterprise applications and the greatl stripped" down version A%,( for mobile applications. A%S( designated the Standard (dition. In %..2, for marketing purposes, Sun renamed new A% versions as Aava ((, Aava ,(, and Aava S(, respectivel . In 1DDC, Sun ,icros stems approached the ISO3I(> AT>1 standards bod and later the (cma International to formaliEe Aava, but it soon withdrew from the process. K8L Aava remains a de facto standard, controlled through the Aava >ommunit )rocess.KDL $t one time, Sun made most of its Aava implementations available without charge, despite their proprietar software status. Sun generated revenue from Aava through the selling of licenses for specialiEed products such as the Aava (nterprise S stem. Sun distinguishes between its Software 1evelopment Mit GS1MH and +untime (nvironment GA+(H Ga subset of the S1MH# the primar distinction involves the A+('s lack of the compiler, utilit programs, and header files. On 1; 5ovember %..2, Sun released much of Aava as free and open source software under the terms of the &5? &eneral )ublic :icense G&):H. On 8 ,a %..C Sun finished the process, making all of Aava's core code available under free software 3 open"source distribution terms, aside from a small portion of code to which Sun did not hold the cop right.
%%
Pr!'ar* )$a-+ There were five primar goals in the creation of the Aava languageB 1. It should be Jsimple, object oriented and familiarJ. %. It should be Jrobust and secureJ. ;. It should be Jarchitecture neutral and portableJ. <. It should e=ecute with Jhigh performanceJ. -. It should be Jinterpreted, threaded, and d namicJ.
;a0a P-a#"$r' One characteristic of Aava is portabilit , which means that computer programs written in the Aava language must run similarl an where. This is achieved b compiling the Aava language code, not to machine code but to Aava b te code N instructions analogous to machine code but intended to be interpreted b a virtual machine G*,H written specificall for the host hardware. (nd"users commonl use a Aava +untime (nvironment GA+(H installed on their own machine for standalone Aava applications, or in a 'eb browser for Aava applets. StandardiEed libraries provide a generic wa to access host specific features such as graphics, threading and networking. In some A*, versions, b te code can be compiled to native code, either before or during program e=ecution, resulting in faster e=ecution. $ major benefit of using b te code is porting. Oowever, the overhead of interpretation means that interpreted programs almost alwa s run more slowl than programs compiled to native e=ecutables would, and Aava suffered a reputation for poor performance. This gap on an supported hardware3operating"s stem platform. One should be able to write a program once, compile it once, and run it
%;
has been narrowed b a number of optimiEation techni0ues introduced in the more recent A*, implementations. One such techni0ue, known as just"in"time GAITH compilation, translates Aava b te code into native code the first time that code is e=ecuted, then caches it. These results in a program that starts and e=ecutes faster than pure interpreted code can, at the cost of introducing occasional compilation overhead during e=ecution. ,ore sophisticated *, also use d namic recompilation, in which the *, anal Ees the behavior of the running program and selectivel recompiles and optimiEes parts of the program. 1 namic recompilation can achieve optimiEations superior to static compilation because the d namic compiler can base optimiEations on knowledge about the runtime environment and the set of loaded classes, and can identif hot spots " parts of the program, often inner loops, that take up the most e=ecution time. AIT compilation and d namic recompilation allow Aava programs to approach the speed of native code without losing portabilit . $nother techni0ue, commonl known as static compilation, or ahead"of"time G$OTH
compilation, is to compile directl into native code like a more traditional compiler. Static Aava compilers translate the Aava source or b te code to native object code. This achieves good performance compared to interpretation, at the e=pense of portabilit # the output of these compilers can onl be run on a single architecture. $OT could give Aava something close to native performance, collection. Aava's performance has improved substantiall since the earl versions, and performance of AIT compilers relative to native compilers has in some tests been shown to be 0uite similar. The performance of the compilers does not necessaril indicate the performance of the compiled code# onl careful testing can reveal the true performance issues in an s stem. One of the uni0ue advantages of the concept of a runtime engine is that even the most serious errors Ge=ceptionsH in a Aava program should not 'crash' the s stem under an et it is still not portable since there are no compiler to micro manage garbage directives, and all the pointers are indirect with no wa
%<
circumstances, provided the A*, itself is properl implemented. ,oreover, in runtime engine environments such as Aava there e=ist tools that attach to the runtime engine and ever time that an e=ception of interest occurs the record debugging information that e=isted in memor at the time the e=ception was thrown Gstack and heap valuesH. These $utomated (=ception Oandling tools provide 'root"cause' information for e=ceptions in Aava programs that run in production, testing or development environments. Such precise debugging is much more difficult to implement without the run"time support that the A*, offers.
I'p-e'e%#a#!$%+ Sun ,icros stems officiall licenses the Aava Standard (dition platform for ,icrosoft 'indows, :inu=, ,ac OS 4, and Solaris. Through a network of third"part vendors and licensees, alternative Aava environments are available for these and other platforms. Sun's trademark license for usage of the Aava brand insists that all implementations be JcompatibleJ. This resulted in a legal dispute with ,icrosoft after Sun claimed that the ,icrosoft implementation did not support +,I or A5I and had added platform"specific features of their own. Sun sued in 1DDC and in %..1 won a settlement of P%. million as well as a court order enforcing the terms of the license from Sun. $s a result, ,icrosoft no longer ships Aava with 'indows, and in recent versions of 'indows, Internet (=plorer cannot support Aava applets without a third"part plug in. Sun, and others, has made available free Aava run"time s stems for those and other versions of 'indows. )latform"independent Aava is essential to the Aava (( strateg , and an even more rigorous validation is re0uired to certif an implementation. This environment enables portable server"side applications, such as 'eb services, serviette, and (nterprise Aava/eans, as well as with embedded s stems based on OS&i, using (mbedded Aava environments. Through the new &lassfish project, Sun is working to create a full functional, unified open"source implementation of the Aava (( technologies.
%-
Sun also distributes a superset of the A+( called the Aava 1evelopment Mit Gcommonl known as the A1MH, which includes development tools such as the Aava compiler, Aava doc, Aar and debugger.
A2#$'a#! 'e'$r* 'a%a)e'e%# Aava uses an automatic garbage collector to manage memor in the object lifec cle. The programmer determines when objects are created, and the Aava runtime is responsible for recovering the memor once objects are no longer in use. Once no references to an object remain, the unreachable object becomes eligible to be freed automaticall b the garbage collector. Something similar to a memor leak ma still occur if a programmer's code holds a reference to an object that is no longer needed, t picall when objects that are no longer needed are stored in containers that are still in use. If methods for a none=istent object are called, a Jnull pointer e=ceptionJ is thrown. One of the ideas behind Aava's automatic memor management model is that programmers be spared the burden of having to perform manual memor languages memor e=plicitl for the creation of objects is implicitl allocated and deal located from the heap. (ither wa management. In some the responsibilit of allocated on the stack or
managing memor resides with the programmer. If the program does not deal locate an object, a memor leak occurs. If the program attempts to access or deal locate memor that has alread been deal located, the result is undefined and difficult to predict, and the program is likel to become unstable and3or crash. This can be partiall remedied b the use of smart pointers, but these add overhead and comple=it . &arbage collection ma happen at an time. Ideall , it will occur when a program is idle. It is guaranteed to be triggered if there is insufficient free memor on the heap to allocate a new object# this can cause a program to stall momentaril . 'here performance or response time is important, e=plicit memor management and object pools are often used.
%2
Aava does not support >3>II st le pointer arithmetic, where object addresses and unsigned integers Gusuall long integersH can be used interchangeabl . This allows the garbage collector to relocate referenced objects, and ensures t pe safet and securit . $s in >II and some other object"oriented languages, variables of Aava's primitive t pes are not objects. *alues of primitive t pes are either stored directl in fields Gfor objectsH or on the stack Gfor methodsH rather than on the heap, as commonl true for objects Gbut see (scape anal sisH. This was a conscious decision b Aava's designers for performance reasons. /ecause of this, Aava was not considered to be a pure object"oriented programming language. Oowever, as of Aava -.., auto bo=ing enables programmers to proceed as if primitive t pes are instances of their wrapper classes.
S*%#a1 The s nta= of Aava is largel derived from >II. ?nlike >II, which combines the s nta= for structured, generic, and object"oriented programming, Aava was built almost e=clusivel as an object oriented language. $ll code is written inside a class and ever thing is an object, with the e=ception of the intrinsic data t pes Gordinal and real numbers, /oolean values, and charactersH, which are not classes for performance reasons. Aava suppresses several features Gsuch as operator overloading and multiple inheritanceH for classes in order to simplif the language and to prevent possible errors and anti"pattern design. Aava uses the same commenting methods as >II. There are two different st les of commentB a single line st le marked with two forward slashes, and a multiple line st le opened with a forward slash asterisk G3QH and closed with an asterisk forward slash GQ3H. E1a'p-e: 33This is an e=ample of a single line comment using two forward slashes 3Q This is an e=ample of a multiple line comment using the forward slash
%C
and asterisk. This t pe of comment can be used to hold a lot of information but it is ver important to remember to close the comment. Q3 E1a'p-e+ He--$ w$r-d The traditional Oello world program can be written in Aava asB 3Q Q Outputs JOello, worldRJ and then e=its Q3 public class Oello'orld S public static void mainGStringKL argsH S S stem.out.printlnGJOello, worldRJH# T T / convention, source files are named after the public class the contain, appending the suffi= .java, for e=ample, Oello 'orld. Aava It must first be compiled into b te code, using a Aava compiler, producing a file named Oello 'orld. >lass onl then can it be e=ecuted, or 'launched'. The java source file ma onl contain one public class but can contain multiple classes with less than public access and an number of public inner classes. $ class that is declared private ma be stored in an .java file. The compiler will generate a class file for each class defined in the source file. The name of the class file is the name of the class, with .class appended. 6or class file generation, anon mous classes are treated as if their name was the concatenation of the name of their enclosing class, a P, and an integer. The ke word public denotes that a method can be called from code in other classes, or that a class ma be used b classes outside the class hierarch . The class hierarch is related to the name of the director in which the .java file is. The ke word static in front of a method indicates a static method, which is associated onl with the class and not with an specific instance of that class. Onl static methods can be
%8
invoked without a reference to an object. Static methods cannot access an variables that are not static.
method
The ke word void indicates that the main method does not return an value to the caller. If a Aava program is to e=it with an error code, it must call S stem.e=itGH e=plicitl . The method name JmainJ is not a ke word in the Aava language. It is simpl the name of the method the Aava launcher calls to pass control to the program. Aava classes that run in managed environments such as applets and (nterprise Aava /eans do not use or need a mainGH method. $ java program ma contain multiple classes that have main methods, which means that the *, needs to be e=plicitl told which class to launch from. The main method must accept an arra of String objects. / convention, it is referenced as args although an other legal identifier name can be used. Since Aava -, the main method can also use variable arguments, in the form of public static void mainGString... argsH, allowing the main method to be invoked with an arbitrar number of String arguments. The effect of this alternate declaration is semanticall identical Gthe args parameter is still an arra of String objectsH, but allows an alternate s nta= for creating and passing the arra . The Aava launcher launches Aava b loading a given class Gspecified on the command line or as an attribute in a A$+H and starting its public static void mainGStringKLH method. Stand" alone programs must declare this method e=plicitl . The String KL args parameter is an arra of String objects containing an arguments passed to the class. The parameters to main are often passed b means of a command line. )rinting is part of a Aava standard librar B The S stem class defines a public static field called out. The out object is an instance of the )rintStream class and provides man methods for printing data to standard out, including printlnGStringH which also appends a new line to the passed string. The string JOello worldRJ is automaticall converted to a String object b the compiler.
%D
A '$re $'pre(e%+!0e e1a'p-e 33 Odd(ven.java import java=.swing.AOption)ane# public class Odd(ven S 33 JinputJ is the number that the user gives to the computer private int input# 33 a whole numberGJintJ means integerH 3Q Q This is the constructor method. It gets called when an object of the Odd(ven t pe Q is being created. Q3 public Odd(venGH S 33>ode not shown T 33 This is the main method. It gets called when this class is run through a Aava interpreter. public static void mainGStringKL argsH S 3Q Q This line of code creates a new instance of this class called JnumberJ Galso known as an Q ObjectH and initialiEes it b calling the constructor. The ne=t line of code calls Q the Jshow1ialogGHJ method, which brings up a prompt to ask ou for a number Q3 Odd(ven number U new Odd(venGH# number.show1ialogGH# T public void show1ialogGH S 3Q Q Jtr J makes sure nothing goes wrong. If something does,
;.
Q the interpreter skips to JcatchJ to see what it should do. Q3 tr S 3Q Q The code below brings up a AOption)ane, which is a dialog bo= Q The String returned b the JshowInput1ialogGHJ method is converted into Q an integer, making the program treat it as a number instead of a word. Q $fter that, this method calls a second method, calculateGH that will Q displa either J(venJ or JOdd.J Q3 input U new IntegerGAOption)ane.showInput1ialogGJ)lease (nter $ 5umberJHH# calculateGH# T catch G5umber6ormat(=ception eH S 3Q Q &etting in the catch block means that there was a problem with the format of Q the number. )robabl some letters were t ped in instead of a number. Q3 S stem.err.printlnGJ(++O+B Invalid input. )lease t pe in a numerical value.JH# T T 3Q Q 'hen this gets called, it sends a message to the interpreter. Q The interpreter usuall shows it on the command prompt G6or 'indows usersH Q or the terminal G6or :inu= usersH.G$ssuming it's openH Q3 private void calculateGH S if Ginput V % UU .H S S stem.out.printlnGJ(venJH# T else S S stem.out.printlnGJOddJH#
;1
T T T
The import statement imports the A Option )ane class from the java=. Swing package. The Odd (ven class declares a single private field of t pe int named input. (ver instance of the Odd (ven class has its own cop of the input field. The private declaration means that no other class can access Gread or writeH the input field.
Odd (ven GH is a public constructor. >onstructors have the same name as the enclosing classes the are declared in, and unlike a method, have no return t pe. $ constructor is used to initialiEe an object that is a newl created instance of the class.
>alculate GH method is declared without the static ke word. This means that the method is invoked using a specific instance of the Odd (ven class. GThe reference used to invoke the method is passed as an undeclared parameter of t pe Odd (ven named this.H The method tests the e=pression input V % UU . using the Fif! ke word to see if the remainder of dividing the input field belonging to the instance of the class b two is Eero. If this e=pression is true, then it prints (ven# if this e=pression is false it prints Odd. GThe input field can be e0uivalentl accessed as this. input, which e=plicitl uses the undeclared this parameter.H
Odd (ven number U new Odd (ven GH# declares a local object reference variable in the main method named number. This variable can hold a reference to an object of t pe Odd (ven. The declaration initialiEes number b first creating an instance of the Odd (ven class, using the new ke word and the Odd (venGH constructor, and then assigning this instance to the variable.
The statement number.show1ialogGH# calls the calculate method. The instance of Odd (ven object referenced b the number local variable is used to invoke the method and passed as the undeclared this parameter to the calculate method.
Input U new Integer GAOption)ane.showInput1ialogGJ)lease (nter $ 5umberJHH# is a statement that converts the t pe of String to the primitive t pe int b taking advantage of the wrapper class Integer.
;%
Spe !a- -a++e+ App-e# Aava applets are programs that are embedded in other applications, t picall in a 'eb page displa ed in a 'eb browser. 33 Oello.java import java=.swing.A$pplet# import java.awt.&raphics# public class Oello e=tends A$pplet S public void paint>omponentG&raphics gH S g.drawStringGJOello, worldRJ, 2-, D-H# T T The import statements direct the Aava compiler to include the java=.swing.A$pplet and java.awt.&raphics classes in the compilation. The import statement allows these classes to be referenced in the source code using the simple class name Gi.e. A$ppletH instead of the full 0ualified class name Gi.e. java=.swing.A$ppletH. The Oello class e=tends GsubclassesH the A$pplet GAava $ppletH class# the A$pplet class provides the framework for the host application to displa and control the lifec cle of the applet. The A$pplet class is a A>omponent GAava &raphical >omponentH which provides the applet with the capabilit to displa a graphical user interface G&?IH and respond to user events. The Oello class overrides the paint>omponentG&raphicsH method inherited from the >ontainer superclass to provide the code to displa the applet. The paintGH method is passed a &raphics object that contains the graphic conte=t used to displa the applet. The paint>omponentGH method calls the graphic conte=t drawStringGString, int, intH method to
;;
displa the JOello, worldRJ string at a pi=el offset of G2-, D-H from the upper"left corner in the applet's displa . WR1O>TX)( OT,: )?/:I> J"33';>331T1 OT,: <..133(5J JhttpB33www.w;.org3T+3html<3strict.dtdJY WR"" Oello.html ""Y WhtmlY WheadY WtitleYOello 'orld $ppletW3titleY W3headY Wbod Y Wapplet codeUJOelloJ widthUJ%..J heightUJ%..JY W3appletY W3bod Y W3htmlY $n applet is placed in an OT,: document using the WappletY OT,: element. The applet tag has three attributes setB codeUJOelloJ specifies the name of the A$pplet class and widthUJ%..J heightUJ%..J sets the pi=el width and height of the applet. $pplets ma also be embedded in OT,: using either the object or embed element, although support for these elements b 'eb browsers is inconsistent. Oowever, the applet tag is deprecated, so the object tag is preferred where supported. The host application, t picall a 'eb browser, instantiates the Oello applet and creates an $pplet >onte=t for the applet. Once the applet has initialiEed itself, it is added to the $'T displa hierarch . The paint method is called b the $'T event dispatching thread whenever the displa needs the applet to draw itself. Ser0-e# Aava Servlet technolog provides 'eb developers with a simple, consistent mechanism for e=tending the functionalit of a 'eb server and for accessing e=isting business s stems. Servlets are server"side Aava (( components that generate responses Gt picall OT,:
;<
pagesH to re0uests Gt picall OTT) re0uestsH from clients. $ servlet can almost be thought of as an applet that runs on the server sideZwithout a face. 33 Oello.java import java.io.Q# import java=.servlet.Q# public class Oello e=tends &enericServlet S public void serviceGServlet+e0uest re0uest, Servlet+esponse responseH throws Servlet(=ception, IO(=ception S response.set>ontentT peGJte=t3htmlJH# final )rint'riter pw U response.get'riterGH# pw.printlnGJOello, worldRJH# pw.closeGH# T T The import statements direct the Aava compiler to include all of the public classes and interfaces from the java.io and java=.servlet packages in the compilation. The Oello class e=tends the &enericServlet class# the &enericServlet class provides the interface for the server to forward re0uests to the servlet and control the servlet's lifec cle. The Oello class overrides the serviceGServlet +e0uest, Servlet +esponseH method defined b the Servlet interface to provide the code for the service re0uest handler. The serviceGH method is passed a Servlet +e0uest object that contains the re0uest from the client and a Servlet +esponse object used to create the response returned to the client. The serviceGH method declares that it throws the e=ceptions Servlet (=ception and IO (=ception if a problem prevents it from responding to the re0uest. The set >ontent T peGStringH method in the response object is called to set the ,I,( content t pe of the returned data to Jte=t3htmlJ. The get'riterGH method in the response returns a )rint'riter object that is used to write the data that is sent to the client. The printlnGStringH method is called to write the JOello, worldRJ string to the response and then
;-
the closeGH method is called to close the print writer, which causes the data that has been written to the stream to be returned to the client.
;a0aSer0er Pa)e AavaServer )ages GAS)sH are server"side Aava (( components that generate responses, t picall OT,: pages, to OTT) re0uests from clients. AS)s embed Aava code in an OT,: page b using the special delimiters WV and VY. $ AS) is compiled to a Aava servlet, a Aava application in its own right, the first time it is accessed. $fter that, the generated servlet creates the response.
Sw!%) app-! a#!$% Swing is a graphical user interface librar for the Aava S( platform. It is possible to specif a different look and feel through the pluggable look and feel s stem of Swing. >lones of 'indows, &TM and ,otif are supplied b Sun. $pple also provides an $0ua look and feel for ,ac OS 4. 'here prior implementations of these looks and feels ma have been considered lacking, Swing in Aava S( 2 addresses this problem b using more native widget drawing routines of the underl ing platforms. This e=ample Swing application creates a single window with JOello, worldRJ insideB 33 Oello.java GAava S( -H import java.awt./order:a out# import java=.swing.Q# public class Oello e=tends A6rame S public OelloGH S superGJhelloJH# set1efault>loseOperationG'indow>onstants.(4IT[O5[>:OS(H# set:a outGnew /order:a outGHH# addGnew A:abelGJOello, worldRJHH#
;2
packGH# T public static void mainGStringKL argsH S new OelloGH.set*isibleGtrueH# T T The first import statement directs the Aava compiler to include the /order:a out class from the java.awt package in the compilation# the second import includes all of the public classes and interfaces from the java=.swing package. The Oello class e=tends the A6rame class# the A6rame class implements a window with a title bar and a close control. The OelloGH constructor initialiEes the frame b first calling the superclass constructor, passing the parameter JhelloJ, which is used as the window's title. It then calls the set1efault>loseOperationGintH method inherited from A6rame to set the default operation when the close control on the title bar is selected to 'indow>onstants.(4IT[O5[>:OS( Z this causes the A 6rame to be disposed of when the frame is closed Gas opposed to merel hiddenH, which allows the A*, to e=it and the program to terminate. 5e=t, the la out of the frame is set to a /order :a out# this tells Swing how to arrange the components that will be added to the frame. $ A :abel is created for the string JOello, worldRJ and the addG>omponentH method inherited from the >ontainer super class is called to add the label to the frame. The pack GH method inherited from the 'indow super class is called to siEe the window and la out its contents, in the manner indicated b the /order :a out. The mainGH method is called b the A*, when the program starts. It instantiates a new Oello frame and causes it to be displa ed b calling the set *isibleG/ooleanH method inherited from the >omponent super class with the /oolean parameter true. Once the frame is displa ed, e=iting the main method does not cause the program to terminate because the $'T event dispatching thread remains active until all of the Swing top"level windows have been disposed.
;C
Ge%er! + In %..< generics were added to the Aava language, as part of A%S( -... )rior to the introduction of generics, each variable declaration had to be of a specific t pe. 6or container classes, for e=ample, this is a problem because there is no eas wa to create a container that accepts onl specific t pes of objects. (ither the container operates on all subt pes of a class or interface, usuall Object, or a different container class has to be created for each contained class. &enerics allow compile"time t pe checking without having to create a large number of container classes, each containing almost identical code. C-a++ -!,rar!e+
Aava libraries are the compiled b te codes of source code developed b the A+( implementer to support application development in Aava. (=amples of these libraries areB
o
>ollection libraries that implement data structures such as lists, dictionaries, trees and sets 4,: )rocessing G)arsing, Transforming, *alidatingH libraries Securit InternationaliEation and localiEation libraries
The integration libraries, which allow the application writer to communicate with e=ternal s stems. These libraries includeB
The Aava 1atabase >onnectivit GA1/>H $)I for database access Aava 5aming and 1irector discover Interface GA51IH for lookup and
+,I and >O+/$ for distributed application development A,4 for managing and monitoring applications The Gheav weight, or nativeH $bstract 'indow Toolkit G$'TH, which provides &?I components, the means for la ing out those
;8
components and the means for handling events from those components
The GlightweightH Swing libraries, which are built on $'T but provide Gnon"nativeH implementations of the $'T widget $)Is for audio capture, processing, and pla back
$ platform dependent implementation of Aava virtual machine GA*,H that is the means b which the b te codes of the Aava libraries and third part applications are e=ecuted
)lug"in, which enable applets to be run in 'eb browsers Aava 'eb Start, which allows Aava applications to be efficientl distributed to end users across the Internet :icensing and documentation. Aava is generall thought of in terms of three platformsB Standard (dition
GS(H, (nterprise (dition G((H, and ,icro (dition G,(H. (ach describes the combination of a language version, a set of standard libraries, and a virtual machine to e=ecute the code. (( is a superset of S(""an (( application can assume the e=istence of all of the S( libraries""and (('s use of the language is identical to S('s. /ecause of the limitations of small devices like phones and seta top bo=, Aava ,icro (dition differs significantl from its siblings. It is not a subset of S( Gas S( is of ((H, as some of its libraries e=ist onl in ,icro (dition. ,oreover, ,( eliminate some language features, such as the float primitive and 6loat class, reflecting the computing limitations of the platforms it runs on. +e0uiring different tools than S( and ((, and with profound differences in devices that makes code portabilit far less realistic in the micro space, man Aava developers see ,( as utterl alien.
T(e ;a0a <!r#2a- Ma (!%e $t some point, Aava source needs to become platform"native e=ecutable code. This t picall re0uires a two"step processB the developer compiles his or her source into Aava b te code, and then a Aava *irtual ,achine GA*,H converts this into native code for the
;D
host platform. This latter step originall was performed b interpretation""taking each A*, instruction and converting it on the fl to one or more native instructions. :ater, just"in" time GAITH compilers converted all of a Aava program from A*, b te code to native code as the program started up. In the modern era, there are multiple approaches. Swing GAavaH Swing is a &?I toolkit for Aava. It is one part of the Aava6oundation >lasses GA6>H. Swing includes graphical user interface G&?IH widgets such as te=t bo=es, buttons, split" panes, and tables.
Sw!%) w!d)e#+ pr$0!de '$re +$p(!+#! a#ed GUI $'p$%e%#+ The earlier $bstract 'indow Toolkit. Since the are written in pure Aava, the run the same on all platforms, unlike the $'T which is tied to the underl ing platform's windowing s stem. Swing supports pluggable look and feel N not b using the native platform's facilities, but b roughl emulating them. This means ou can get an supported look and feel on an platform. The disadvantage of lightweight components is slower e=ecution. The advantage is uniform behavior on all platforms. ,ain 5ew 6eatures
:ightweight. 5ot built on native window"s stem windows. ,uch bigger set of built"in controls. Trees, image buttons, tabbed panes, sliders, toolbars, color choosers, tables, te=t areas to displa OT,: or +T6, etc. ,uch more customiEable. >an change border, te=t alignment, or add image to almost an control. >an customiEe how minor features are drawn. >an separate internal representation from visual appearance.
J)luggableJ look and feel. >an change look and feel at runtime, or design own look and feel. ,an miscellaneous new features. 1ouble"buffering built in, tool tips, dockable tool bars, ke board accelerators, custom cursors, etc.
<.
S&L Ser0er2993: A Re-a#!$%a- Da#a /a+e Ma%a)e'e%# S*+#e' >RD/MS? 6rom S base >orporation, S9: Server was designed for client3server use and is accessed b applications using S9:. It runs on OS3%, 'indows 5T, 5et'are servers, *$4en, and ?5I4 workstations. &enericall , an database management s stem G1/,SH that can respond to 0ueries from client machines formatted in the S9: language. 'hen capitaliEed, the term generall refers to either of two database management products from S base and ,icrosoft. $ ,icrosoft database technolog more powerful than, and compatible with, ,icrosoft $ccess. OrganiEations with e=isting S9: Server databases that function well ma elect to create new $ccess applications as front ends that link to their S9: Server tables. These h brid projects e=tend e=isting s stems or add new IT capacit to an organiEation that wants to make their e=isting information useful in new wa s. ,icrosoft S9: Server is a relational model database server produced b ,icrosoft. Its primar 0uer languages are T"S9: and $5SI S9:. H!+#$r* The code base for ,S S9: Server Gprior to version C..H originated in S base S9: Server, and was ,icrosoft's entr to the enterprise"level database market, competing against Oracle, I/,, and, later, S base itself. ,icrosoft, S base and $shton"Tate originall teamed up to create and market the first version named S9: Server 1.. for OS3% Gabout 1D8DH which was essentiall the same as S base S9: Server ;.. on ?ni=, *,S, etc. ,icrosoft S9: Server <.% was shipped around 1DD% Gavailable bundled with ,icrosoft OS3% version 1.;H. :ater ,icrosoft S9: Server <.%1 for 'indows 5T was released at the same time as 'indows 5T ;.1. ,icrosoft S9: Server v2.. was the first version designed for 5T, and did not include an direction from S base.
<1
$bout the time 'indows 5T was released, S base and ,icrosoft parted wa s and each pursued their own design and marketing schemes. ,icrosoft negotiated e=clusive rights to all versions of S9: Server written for ,icrosoft operating s stems. :ater, S base changed the name of its product to $daptive Server (nterprise to avoid confusion with ,icrosoft S9: Server. ?ntil 1DD<, ,icrosoft's S9: Server carried three S base cop right notices as an indication of its origin. Since parting wa s, several revisions have been done independentl . S9: Server C.. was a rewrite from the legac S base code. It was succeeded b S9: Server %..., which was the first edition to be launched in a variant for the I$"2< architecture. In the eight ears since release of ,icrosoft's previous S9: Server product GS9: Server %...H, advancements have been made in performance, the client I1( tools, and several complementar s stems that are packaged with S9: Server %..-. These includeB an (T: tool GS9: Server Integration Services or SSISH, a +eporting Server, an O:$) and data mining server G$nal sis ServicesH, and several messaging technologies, specificall Service /roker and 5otification Services.
S&L Ser0er 2993 S9: Server %..- Gcodenamed XukonH, released in October %..-, is the successor to S9: Server %.... It included native support for managing 4,: data, in addition to relational data. 6or this purpose, it defined an =ml data t pe that could be used either as a data t pe in database columns or as literals in 0ueries. 4,: columns can be associated with 4S1 schemas# 4,: data being stored is verified against the schema. 4,: is converted to an internal binar data t pe before being stored in the database. SpecialiEed inde=ing methods were made available for 4,: data. 4,: data is 0ueried using 49uer # S9: Server %..added some e=tensions to the T"S9: language to allow embedding 49uer 0ueries in T" S9:. In addition, it also defines a new e=tension to 49uer , called 4,: 1,: that allows 0uer "based modifications to 4,: data. S9: Server %..- also allows a database server to
<%
be e=posed over web services using T1S packets encapsulated within SO$) GprotocolH re0uests. 'hen the data is accessed over web services, results are returned as 4,:. 6or relational data, T"S9: has been augmented with error handling features and support for recursive 0ueries. S9: Server %..- has also been enhanced with new inde=ing algorithms and better error recover s stems. 1ata pages are check summed for better error resilienc , and optimistic concurrenc support has been added for better performance. )ermissions and access control have been made more granular and the 0uer processor handles concurrent e=ecution of 0ueries in a more efficient wa . )artitions on tables and inde=es are supported nativel , so scaling out a database onto a cluster is easier. S9: >:+ was introduced with S9: Server %..- to let it integrate with the .5(T 6ramework. S9: Server %..- introduced J,$+SJ G,ultiple $ctive +esults SetsH, a method of allowing usage of database connections for multiple purposes.
S&L Ser0er 2996 The current version of S9: Server, S9: Server %..8, Gcode"named JMatmaiJ,H was released G+T,H on $ugust 2, %..8 and aims to make data management self"tuning, self organiEing, and self maintaining with the development of S9: Server $lwa s On technologies, to provide near"Eero downtime. S9: Server %..8 will also include support for structured and semi"structured data, including digital media formats for pictures, audio, video and other multimedia data. In current versions, such multimedia data can be stored as /:O/s Gbinar large objectsH, but the are generic bitstreams. Intrinsic awareness of multimedia data will allow specialiEed functions to be performed on them. $ccording to )aul 6lessner, senior *ice )resident, Server $pplications, ,icrosoft >orp., S9: Server %..8 can be a data storage backend for different varieties of dataB 4,:, email, time3calendar, file, document, spatial, etc as well as perform search, 0uer , anal sis, sharing, and s nchroniEation across all data t pes.
<;
Other new data t pes include specialiEed date and time t pes and a Spatial data t pe for location"dependent data. /etter support for unstructured and semi"structured data is provided using the new 6I:(ST+($, data t pe, which can be used to reference an file stored on the file s stem. Structured data and metadata about the file is stored in S9: Server database, whereas the unstructured component is stored in the file s stem. Such files can be accessed both via 'in;% file handling $)Is as well as via S9: Server using T" S9:# doing the latter accesses the file data as a /:O/. /acking up and restoring the database backs up or restores the referenced files as well. S9: Server %..8 also nativel supports hierarchical data, and includes T"S9: constructs to directl deal with them, without using recursive 0ueries. The 6ull"Te=t Search functionalit has been integrated with the database engine, which simplifies management and improves performance. Spatial data will be stored in two t pes. $ J6lat (arthJ G&(O,(T+X or planarH data t pe represents geospatial data which has been projected from its native, spherical, coordinate s stem into a plane. $ J+ound (arthJ data t pe G&(O&+$)OXH uses an ellipsoidal model in which the (arth is defined as a single continuous entit which does not suffer from the singularities such as the international dateline, poles, or map projection Eone JedgesJ. $ppro=imatel C. methods are available to represent spatial operations for the Open &eospatial >onsortium Simple 6eatures for S9:, *ersion 1.1. S9: Server includes better compression features, which also helps in improving scalabilit . It also includes +esource &overnor that allows reserving resources for certain users or workflows. It also includes capabilities for transparent encr ption of data as well as compression of backups. S9: Server %..8 supports the $1O.5(T (ntit 6ramework and the reporting tools, replication, and data definition will be built around the (ntit 1ata ,odel.K1;L S9: Server +eporting Services will gain charting capabilities from the integration of the data visualiEation products from 1undas 1ata *isualiEation Inc., which was ac0uired b ,icrosoft. On the management side, S9: Server %..8 includes the 1eclarative ,anagement 6ramework which allows configuring policies and constraints, on
<<
the entire database or certain tables, declarativel . The version of S9: Server ,anagement Studio included with S9: Server %..8 supports IntelliSense for S9: 0ueries against a S9: Server %..8 1atabase (ngine. S9: Server %..8 also makes the databases available via 'indows )owerShell providers and management functionalit available as >mdlets, so that the server and all the running instances can be managed from 'indows )owerShell.
S&L Ser0er 2996 R2 S9: Server %..8 +% Gformerl codenamed S9: Server JMilimanjaroJH was announced at Tech(d %..D. S9: Server %..8 +% adds certain features to S9: Server %..8 including master data management s stem branded as ,aster 1ata Services, a centraliEed console to manage multiple S9: Server instances, and support for more than 2< logical processors. ,icrosoft makes S9: Server available in multiple versions, with different feature sets and targeting different users. These versions areB S&L Ser0er C$'pa # Ed!#!$% >S&L CE? The compact edition is an embedded database engine. ?nlike the other versions of S9: Server, the S9: >( engine is based on S9: ,obile Ginitiall designed for use with hand" held devicesH and does not share the same binaries. 1ue to its small siEe G1,/ 1:: footprintH, it has a markedl reduced feature set compared to the other editions. 6or e=ample, it supports a subset of the standard data t pes, does not support stored procedures or *iews or multiple"statement batches Gamong other limitationsH. It is limited to <&/ ma=imum database siEe and cannot be run as a 'indows service, >ompact (dition must be hosted b the application using it. The ;.- version includes considerable work that supports $1O.5(T S nchroniEation Services. S&L Ser0er De0e-$per Ed!#!$% S9: Server 1eveloper (dition includes the same features as S9: Server (nterprise (dition, but is limited b the license to be onl used as a development and test s stem, and
<-
not as production server. This version is available to download b students free of charge as a part of ,icrosoft's 1reamSpark program. S&L Ser0er 2993 E',edded Ed!#!$% >SSEE? S9: Server %..- (mbedded (dition is a speciall configured named instance of the S9: Server (=press database engine which can be accessed onl b certain 'indows Services.
S&L Ser0er E%#erpr!+e Ed!#!$% S9: Server (nterprise (dition is the full"featured version of S9: Server, including both the core database engine and add"on services, while including a range of tools for creating and managing a S9: Server cluster. S&L Ser0er E0a-2a#!$% Ed!#!$% S9: Server (valuation (dition, also known as the Trial (dition, has all the features of the (nterprise (dition, but is limited to 18. da s, after which the tools will continue to run, but the server services will stop. S&L Ser0er E1pre++ Ed!#!$% S9: Server (=press (dition is a scaled down, free edition of S9: Server, which includes the core database engine. 'hile there are no limitations on the number of databases or users supported, it is limited to using one processor, 1 &/ memor and < &/ database files. The entire database is stored in a single .mdf file, and thus making it suitable for 4>O)X deplo ment. It is intended as a replacement for ,S1(. Two additional versions provide a superset of features not in the original (=press (dition. The first is S9: Server (=press with Tools, which includes S9: Server ,anagement Studio /asic. S9: Server (=press with $dvanced Services adds full"te=t search capabilit and reporting services. S&L Ser0er Fa+# Tra @
<2
S9: Server 6ast Track is specificall for enterprise"scale data warehousing storage and business intelligence processing, and runs on reference"architecture hardware that is optimiEed for 6ast Track. S&L Ser0er S#a%dard Ed!#!$% S9: Server Standard edition includes the core database engine, along with the stand"alone services. It differs from (nterprise edition in that it supports fewer active instances Gnumber of nodes in a clusterH and does not include some high"availabilit functions such as hot"add memor Gallowing memor to be added while the server is still runningH, and parallel inde=es.
Ar (!#e #2re Pr$#$ $- -a*er )rotocol la er implements the e=ternal interface to S9: Server. $ll operations that can be invoked on S9: Server are communicated to it via a ,icrosoft"defined format, called Tabular 1ata Stream GT1SH. T1S is an application la er protocol, used to transfer data between a database server and a client. Initiall designed and developed b S base Inc. for their S base S9: Server relational database engine in 1D8<, and later b ,icrosoft in ,icrosoft S9: Server, T1S packets can be encased in other ph sical transport dependent protocols, including T>)3I), 5amed pipes, and Shared memor . >onse0uentl , access to S9: Server is available over these protocols. In addition, the S9: Server $)I is also e=posed over bando web services.
Da#a +#$ra)e The main unit of data storage is a database, which is a collection of tables with t ped columns. S9: Server supports different data t pes, including primar t pes such as Integer, 6loat, 1ecimal, >har Gincluding character stringsH, *archar Gvariable length character stringsH, binar Gfor unstructured blobs of dataH, Te=t Gfor te=tual dataH among
<C
others. It also allows user"defined composite t pes G?1TH to be defined and used. S9: Server also makes server statistics available as virtual tables and views Gcalled 1 namic ,anagement *iews or 1,*H. $ database can also contain other objects including views, stored procedures, inde=es and constraints, in addition to tables, along with a transaction log. $ S9: Server database can contain a ma=imum of %;1 objects, and can span multiple OS"level files with a ma=imum file siEe of %%. T/. The data in the database are stored in primar data files with an e=tension .mdf. Secondar data files, identified with an .ndf e=tension, are used to store optional metadata. :og files are identified with the .ldf e=tension. Storage space allocated to a database is divided into se0uentiall numbered pages, each 8 M/ in siEe. $ page is the basic unit of I3O for S9: Server operations. $ page is marked with a D2"b te header which stores metadata about the page including the page number, page t pe, free space on the page and the I1 of the object that owns it. )age t pe defines the data contained in the page " data stored in the database# inde=, allocation map which holds information about how pages are allocated to tables and inde=es, change map which holds information about the changes made to other pages since last backup or logging, or contain large data t pes such as image or te=t. 'hile page is the basic unit of an I3O operation, space is actuall managed in terms of an e=tent which consists of 8 pages. $ database object can either span all 8 pages in an e=tent GJuniform e=tentJH or share an e=tent with up to C more objects GJmi=ed e=tentJH. $ row in a database table cannot span more than one page, so is limited to 8 M/ in siEe. Oowever, if the data e=ceeds 8 M/ and the row contains *archar or *arbinar data, the data in those columns are moved to a new page Gor possibl a se0uence of pages, called an $llocation unitH and replaced with a pointer to the data. 6or ph sical storage of a table, its rows are divided into a series of partitions Gnumbered 1 to nH. The partition siEe is user defined# b default all rows are in a single partition. $ table is split into multiple partitions in order to spread a database over a cluster. +ows in each partition are stored in either /"tree or heap structure. If the table has an associated inde= to allow fast retrieval of rows, the rows are stored in"order according to their inde= values, with a /"tree providing the inde=. The data is in the leaf node of the leaves, and other
<8
nodes storing the inde= values for the leaf data reachable from the respective nodes. If the inde= is non"clustered, the rows are not sorted according to the inde= ke s. $n inde=ed view has the same storage structure as an inde=ed table. $ table without an inde= is stored in an unordered heap structure. /oth heaps and /"trees can span multiple allocation units. /2""er 'a%a)e'e%# S9: Server buffers pages in +$, to minimiEe disc I3O. $n 8 M/ page can be buffered in"memor , and the set of all pages currentl buffered is called the buffer cache. The amount of memor available to S9: Server decides how man pages will be cached in memor . The buffer cache is managed b the /uffer ,anager. (ither reading from or writing to an page copies it to the buffer cache. Subse0uent reads or writes are redirected to the in"memor cop , rather than the on"disc version. The page is updated on the disc b the /uffer ,anager onl if the in"memor cache has not been referenced for some time. 'hile writing pages back to disc, as nchronous I3O is used whereb the I3O operation is done in a background thread so that other operations do not have to wait for the I3O operation to complete. (ach page is written along with its checksum when it is written. 'hen reading the page back, its checksum is computed again and matched with the stored version to ensure the page has not been damaged or tampered with in the meantime.
L$))!%) a%d Tra%+a #!$% S9: Server ensures that an change to the data is $>I1"compliant, i.e., it uses transactions to ensure that an operation either totall completes or is undone if fails, but never leaves the database in an intermediate state. ?sing transactions, a se0uence of actions can be grouped together, with the guarantee that either all actions will succeed or none will. S9: Server implements transactions using a write"ahead log. $n changes made to an page will update the in"memor cache of the page, simultaneousl all the operations performed will be written to a log, along with the transaction I1 which the operation was a part of. (ach log entr is identified b an increasing :og Se0uence 5umber G:S5H which ensure that no event overwrites another. S9: Server ensures that the log will be written onto the disc before the actual page is written back. This enables S9: Server to ensure integrit of
<D
the data, even if the s stem fails. If both the log and the page were written before the failure, the entire data is on persistent storage and integrit is ensured. If onl the log was written Gthe page was either not written or not written completel H, then the actions can be read from the log and repeated to restore integrit . If the log wasn't written then integrit is also maintained although the database state remains unchanged as if the transaction never occurred. If it was onl partiall written, then the actions associated with the unfinished transaction are discarded. Since the log was onl partiall written, the page is guaranteed to have not been written, again ensuring data integrit . +emoving the unfinished log entries effectivel undoes the transaction. S9: Server ensures consistenc between the log and the data ever time an instance is restarted.
C$% 2rre% * a%d -$ @!%) S9: Server allows multiple clients to use the same database concurrentl . $s such, it needs to control concurrent access to shared data, to ensure data integrit " when multiple clients update the same data, or clients attempt to read data that is in the process of being changed b another client. S9: Server provides two modes of concurrenc controlB pessimistic concurrenc and optimistic concurrenc . 'hen pessimistic concurrenc control is being used, S9: Server controls concurrent access b using locks. :ocks can be either shared or e=clusive. (=clusive lock grants the user e=clusive access to the data " no other user can access the data as long as the lock is held. Shared locks are used when some data is being read " multiple users can read from data locked with a shared lock, but not ac0uire an e=clusive lock. The latter would have to wait for all shared locks to be released. :ocks can be applied on different levels of granularit " on entire tables, pages, or even on a per"row basis on tables. 6or inde=es, it can either be on the entire inde= or on inde= leaves. The level of granularit to be used is defined on a per"database basis b the database administrator. 'hile a fine grained locking s stem allows more users to use the table or inde= simultaneousl , it re0uires more resources. So it does not automaticall turn into higher performing solution. S9: Server also includes two more lightweight mutual e=clusion solutions " latches and spinlocks " which are less robust than locks but are less
-.
resource intensive. S9: Server uses them for 1,* and other resources that are usuall not bus . S9: Server also monitors all worker threads that ac0uire locks to ensure that the do not end up in deadlocks " in case the do, S9: Server takes remedial measures, which in man cases is to kill one of the threads entangled in a deadlock and rollback the transaction it started. To implement locking, S9: Server contains the :ock ,anager. The :ock ,anager maintains an in"memor table that manages the database objects and locks, if an , on them along with other metadata about the lock. $ccess to an shared object is mediated b the lock manager, which either grants access to the resource or blocks it. S9: Server also provides the optimistic concurrenc control mechanism, which is similar to the multi version concurrenc control used in other databases. The mechanism allows a new version of a row to be created whenever the row is updated, as opposed to overwriting the row, i.e., a row is additionall identified b the I1 of the transaction that created the version of the row. /oth the old as well as the new versions of the row are stored and maintained, though the old versions are moved out of the database into a s stem database identified as Tempdb. 'hen a row is in the process of being updated, an other re0uests are not blocked Gunlike lockingH but are e=ecuted on the older version of the row. If the other re0uest is an update statement, it will result in two different versions of the rows " both of them will be stored b the database, identified b their respective transaction I1s.
Da#a re#r!e0aThe main mode of retrieving data from an S9: Server database is 0uer ing for it. The 0uer is e=pressed using a variant of S9: called T"S9:, a dialect ,icrosoft S9: Server shares with S base S9: Server due to its legac . The 0uer declarativel specifies what is to be retrieved. It is processed b the 0uer processor, which figures out the se0uence of steps that will be necessar to retrieve the re0uested data. The se0uence of actions necessar to e=ecute a 0uer is called a 0uer plan. There might be multiple wa s to process the same 0uer . 6or e=ample, for a 0uer that contains a join statement and a select statement, e=ecuting join on both the tables and then e=ecuting select on the results would give the same result as selecting from each table and then e=ecuting the join, but result in -1
different e=ecution plans. In such case, S9: Server chooses the plan that is supposed to ield the results in the shortest possible time. This is called 0uer optimiEation and is performed b the 0uer processor itself. S9: Server includes a cost"based 0uer optimiEer which tries to optimiEe on the cost, in terms of the resources it will take to e=ecute the 0uer . &iven a 0uer , the 0uer optimiEer looks at the database schema, the database statistics and the s stem load at that time. It then decides which se0uence to access the tables referred in the 0uer , which se0uence to e=ecute the operations and what access method to be used to access the tables. 6or e=ample, if the table has an associated inde=, whether the inde= should be used or not " if the inde= is on a column which is not uni0ue for most of the columns Glow Jselectivit JH, it might not be worthwhile to use the inde= to access the data, finall , it decides whether to e=ecute the 0uer concurrentl or not. 'hile a concurrent e=ecution is more costl in terms of total processor time, because the e=ecution is actuall split to different processors might mean it will e=ecute faster. Once a 0uer plan is generated for a 0uer , it is temporaril cached. 6or further invocations of the same 0uer , the cached plan is used. ?nused plans are discarded after some time. S9: Server also allows stored procedures to be defined. Stored procedures are parameteriEed T"S9: 0ueries that are stored in the server itself Gand not issued b the client application as is the case with general 0ueriesH. Stored procedures can accept values sent b the client as input parameters, and send back results as output parameters. The can call defined functions, but not other stored procedures. The can be selectivel provided access to. ?nlike other 0ueries, stored procedures have an associated name, which is used at runtime to resolve into the actual 0ueries. $lso because the code need not be sent from the client ever time Gas it can be accessed b nameH, it reduces network traffic and somewhat improves performance. (=ecution plans for stored procedures are also cached as necessar . S&L CLR ,icrosoft S9: Server %..- includes a component named S9: >:+ via which it integrates with .5(T 6ramework. ?nlike most other applications that use .5(T 6ramework, S9: -%
Server itself hosts the .5(T 6ramework runtime, i.e., memor , threading and resource management re0uirements of .5(T 6ramework are satisfied b S9:OS itself, rather than the underl ing 'indows operating s stem. S9:OS provides deadlock detection and resolution services for .5(T code as well. 'ith S9: >:+, stored procedures and triggers can be written in an managed .5(T language, including >\ and */.5(T. ,anaged code can also be used to define ?1T's Guser defined t pesH, which can persist in the database. ,anaged code is compiled to .5(T assemblies and after being verified for t pe safet , registered at the database. $fter that, the can be invoked like an other procedure. Oowever, onl a subset of the /ase >lass :ibrar is available, when running code under S9: >:+. ,ost $)Is relating to user interface functionalit are not available. 'hen writing code for S9: >:+, data stored in S9: Server databases can be accessed using the $1O.5(T $)Is like an other managed application that accesses S9: Server data. Oowever, doing that creates a new database session, different from the one in which the code is e=ecuting. To avoid this, S9: Server provides some enhancements to the $1O.5(T provider that allows the connection to be redirected to the same session which alread hosts the running code. Such connections are called conte=t connections and are set b setting conte=t connection parameter to true in the connection string. S9: Server also provides several other enhancements to the $1O.5(T $)I, including classes to work with tabular data or a single row of data as well as classes to work with internal metadata about the data stored in the database. It also provides access to the 4,: features in S9: Server, including 49uer support. These enhancements are also available in T"S9: )rocedures in conse0uence of the introduction of the new 4,: 1atat pe G0uer ,value,nodes functionsH.
Ser0! e+ S9: Server also includes an assortment of add"on services. 'hile these are not essential for the operation of the database s stem, these provide value added services on top of the core database management s stem. These services either run as a part of some S9: Server
-;
component or out"of"process as 'indows Service and presents their own $)I to control and interact with them. Ser0! e /r$@er The Service /roker, which runs as a part of the database engine, provides a reliable messaging and message 0ueuing platform for S9: Server applications. ?sed inside an instance, it is used to provide an as nchronous programming environment. 6or cross instance applications, Service /roker communicates over T>)3I) and allows the different components to be s nchroniEed together, via e=change of messages. Rep-! a#!$% Ser0! e+ S9: Server +eplication Services are used b S9: Server to replicate and s nchroniEe database objects, either in entiret or a subset of the objects present, across replication agents, which might be other database servers across the network, or database caches on the client side. +eplication follows a publisher3subscriber model, i.e., the changes are sent out b one database server GJpublisherJH and are received b others GJsubscribersJH. S9: Server supports three different t pes of replicationB Tra%+a #!$% rep-! a#!$% (ach transaction made to the publisher database Gmaster databaseH is s nced out to subscribers, who update their databases with the transaction. Transactional replication s nchroniEes databases in near real time. Mer)e rep-! a#!$% >hanges made at both the publisher and subscriber databases are tracked, and periodicall the changes are s nchroniEed bi"directionall between the publisher and the subscribers. If the same data has been modified differentl in both the publisher and the subscriber databases, s nchroniEation will result in a conflict which has to be resolved " either manuall or b using pre"defined policies. S%ap+($# rep-! a#!$%
-<
Snapshot replication published a cop of the entire database Gthe then"snapshot of the dataH and replicates out to the subscribers. 6urther changes to the snapshot are not tracked. A%a-*+!+ Ser0! e+ S9: Server $nal sis Services adds O:$) and data mining capabilities for S9: Server databases. The O:$) engine supports ,O:$), +O:$) and OO:$) storage modes for data. $nal sis Services supports the 4,: for $nal sis standard as the underl ing communication protocol. The cube data can be accessed using ,14 0ueries. 1ata mining specific functionalit is e=posed via the 1,4 0uer language. $nal sis Services includes various algorithms " 1ecision trees, clustering algorithm, 5aive /a es algorithm, time series anal sis, se0uence clustering algorithm, linear and logistic regression anal sis, and neural networks " for use in data mining. Rep$r#!%) Ser0! e+ S9: Server +eporting Services is a report generation environment for data gathered from S9: Server databases. It is administered via a web interface. +eporting services features a web services interface to support the development of custom reporting applications. +eports are created as +1: files. +eports can be designed using recent versions of ,icrosoft *isual Studio Gincluding *isual Studio.5(T %..; onwardsH with /usiness Intelligence 1evelopment Studio, installed or with the included +eport /uilder. Once created, +1: files can be rendered in a variet of formats including (=cel, )16, >S*, 4,:, TI66 Gand other image formatsH, and OT,: 'eb $rchive. N$#!"! a#!$% Ser0! e+ Originall introduced as a post"release add"on for S9: Server %..., 5otification Services was bundled as part of the ,icrosoft S9: Server platform for the first and onl time with S9: Server %..-.K with S0l Server %..-, S9: Server 5otification Services is a mechanism for generating data"driven notifications, which are sent to 5otification Services subscribers. $ subscriber registers for a specific event or transaction Gwhich is registered on the
--
database server as a triggerH# when the event occurs, 5otification Services can use one of three methods to send a message to the subscriber informing about the occurrence of the event. These methods include S,T), SO$), or b writing to a file in the file s stem. I%#e)ra#!$% Ser0! e+ S9: Server Integration Services is used to integrate data from different data sources. It is used for the (T: capabilities for S9: Server for data warehousing needs. Integration Services includes &?I tools to build data e=traction workflows integration various functionalit such as e=tracting data from various sources, 0uer ing data, transforming data including aggregating, duplication and merging data, and then loading the transformed data onto other sources, or sending e"mails detailing the status of the operation.
F2-- Te1# Sear ( Ser0! e S9: Server 6ull Te=t Search service is a specialiEed inde=ing and 0uer ing service for unstructured te=t stored in S9: Server databases. The full te=t search inde= can be created on an column with character based te=t data. It allows for words to be searched for in the te=t columns. 'hile it can be performed with the S9: :IM( operator, using S9: Server 6ull Te=t Search service can be more efficient. 6ull Te=t Search G6TSH allows for ine=act matching of the source string, indicated b a +ank value which can range from . to 1... " a higher rank means a more accurate match. It also allows linguistic matching GJinflectional searchJH, i.e., linguistic variants of a word Gsuch as a verb in a different tenseH will also be a match for a given word Gbut with a lower rank than an e=act matchH. )ro=imit searches are also supported, i.e., if the words searched for do not occur in the se0uence the are specified in the 0uer but are near each other, the are also considered a match. T"S9: e=poses special operators that can be used to access the 6TS capabilities. The 6ull Te=t Search engine is divided into two processes " the 6ilter 1aemon process Gmsftefd.e=eH and the Search process Gmsftes0l.e=eH. These processes interact with the S9: Server. The Search process includes the inde=er Gthat creates the full te=t inde=esH and the full te=t 0uer processor. The inde=er scans through te=t columns in the database. It can -2
also inde= through binar columns, and use i6ilters to e=tract meaningful te=t from the binar blob Gfor e=ample, when a ,icrosoft 'ord document is stored as an unstructured binar file in a databaseH. The i6ilters are hosted b the 6ilter 1aemon process. Once the te=t is e=tracted, the 6ilter 1aemon process breaks it up into a se0uence of words and hands it over to the inde=er. The inde=er filters out noise words, i.e., words like $, $nd etc, which occur fre0uentl and are not useful for search. 'ith the remaining words, an inverted inde= is created, associating each word with the columns the were found in. S9: Server itself includes a &atherer component that monitors changes to tables and invokes the inde=er in case of updates. 'hen a full te=t 0uer is received b the S9: Server 0uer processor, it is handed over to the 6TS 0uer processor in the Search process. The 6TS 0uer processor breaks up the 0uer into the constituent words, filters out the noise words, and uses an inbuilt thesaurus to find out the linguistic variants for each word. The words are then 0ueried against the inverted inde= and a rank of their accurateness is computed. The results are returned to the client via the S9: Server process. T$$-+ S&LCMD S9:>,1 is a command line application that comes with ,icrosoft S9: Server, and e=poses the management features of S9: Server. It allows S9: 0ueries to be written and e=ecuted from the command prompt. It can also act as a scripting language to create and run a set of S9: statements as a script. Such scripts are stored as a .s0l file, and are used either for management of databases or to create the database schema during the deplo ment of a database. S9:>,1 was introduced with S9: Server %..- and this continues with S9: Server %..8. Its predecessor for earlier versions was OS9:, which is functionall e0uivalent and man of the command line parameters are identical.
-C
<!+2a- S#2d!$ ,icrosoft *isual Studio includes native support for data programming with ,icrosoft S9: Server. It can be used to write and debug code to be e=ecuted b S9: >:+. It also includes a data designer that can be used to graphicall create, view or edit database schemas. 9ueries can be created either visuall or using code. SS,S %..8 onwards, provides intellisense for S9: 0ueries as well. S&L Ser0er Ma%a)e'e%# S#2d!$ S9: Server ,anagement Studio is a &?I tool included with S9: Server %..- and later for configuring, managing, and administering all components within ,icrosoft S9: Server. The tool includes both script editors and graphical tools that work with objects and features of the server. S9: Server ,anagement Studio replaces (nterprise ,anager as the primar management interface for ,icrosoft S9: Server since S9: Server %..-. $ version of S9: Server ,anagement Studio is also available for S9: Server (=press (dition, for which it is known as S9: Server ,anagement Studio (=press GSS,S(H. $ central feature of S9: Server ,anagement Studio is the Object (=plorer, which allows the user to browse, select, and act upon an of the objects within the server. It can be used to visuall observe and anal Ee 0uer plans and optimiEe the database performance, among others. S9: Server ,anagement Studio can also be used to create a new database, alter an e=isting database schema b adding or modif ing tables and inde=es, or anal Ee performance. It includes the 0uer windows which provide a &?I based interface to write and e=ecute 0ueries. /2+!%e++ I%#e--!)e% e De0e-$p'e%# S#2d!$ /usiness Intelligence 1evelopment Studio G/I1SH is the I1( from ,icrosoft used for developing data anal sis and /usiness Intelligence solutions utiliEing the ,icrosoft S9: Server $nal sis Services, +eporting Services and Integration Services. It is based on the ,icrosoft *isual Studio development environment but customiEes with the S9: Server services"specific e=tensions and project t pes, including tools, controls and projects for reports Gusing +eporting ServicesH, >ubes and data mining structures Gusing $nal sis ServicesH.
-8
Pr$)ra''a,!-!#* TAS&L T"S9: GTransact"S9:H is the primar means of programming and managing S9: Server. It e=poses ke words for the operations that can be performed on S9: Server, including creating and altering database schemas, entering and editing data in the database as well as monitoring and managing the server itself. >lient applications, both which consume data or manage the server, leverage S9: Server functionalit b sending T"S9: 0ueries and statements which are then processed b the server and results Gor errorsH returned to the client application. S9: Server allows it to be managed using T"S9:. 6or this it e=poses read onl tables from which server statistics can be read. ,anagement functionalit is e=posed via s stem"defined stored procedures which can be invoked from T"S9: 0ueries to perform the management operation.
S&L Na#!0e C-!e%# S9: 5ative >lient is the native client side data access librar for ,icrosoft S9: Server, version %..- onwards. It nativel implements support for the S9: Server features S9: Server, as nchronous including the Tabular 1ata Stream implementation, support for mirrored S9: Server databases, full support for all data t pes supported b operations, 0uer notifications, encr ption support, as well as receiving multiple result sets in a single database session. S9: 5ative >lient is used under the hood b S9: Server plug"ins for other data access technologies, including $1O or O:( 1/. It is also used b the native S9: Server $1O.5(T provider, S0l>lient. The S9: 5ative >lient can also be directl used, b passing the generic data access la ers. Fea#2re+:
Oigh $vailabilit " 6ailover clustering and database mirroring technolog in S9: Server %..- will enable enterprises to deliver highl reliable, available applications to emplo ees, customers, and partners. -D
,anagement Tools " S9: Server %..- introduces an integrated suite of management tools and management application programming interfaces G$)IsH to provide ease of use, manageabilit , and support for operating large"scale S9: Server deplo ments. Securit (nhancements " S9: Server %..- has been designed to help provide the highest level of securit for enterprise data through features such as database encr ption, more secure default settings, password polic enforcement, granular permissions control, and an enhanced securit model. Scalabilit " Scalabilit advancements in S9: Server %..- include table
6ast +ecover " $ new faster recover option improves availabilit of S9: Server databases. $dministrators can reconnect to a recovering database after the transaction log has been rolled forward.
..2 Te+#!%) Software testing is a process of running with intent of finding errors in software. Software testing assures the 0ualit of software and represents final review of other phases of software like specification, design, code generation etc.
..2.1 U%!# Te+#!%) ?nit testing emphasiEes the verification effort on the smallest unit of software design i.e.# a software component or module. ?nit testing is a d namic method for verification, where program is actuall compiled and e=ecuted. ?nit testing is performed in parallel with the coding phase. ?nit testing tests units or modules not the whole software. I have tested each view3module of the application individuall . $s the modules were built up testing was carried out simultaneousl , tracking out each and ever kind of input and checking the corresponding output until module is working correctl . The functionalit of
2.
the modules was also tested as separate units. (ach of the three modules was tested as separate units. In each module all the functionalities were tested in isolation. In the Shop )roducts ,odule when a product has been added to cart it has been made sure that if the item alread e=ists in the shopping cart then the 0uantit is increased b one else a new item is created in the shopping cart. $lso the state of the s stem after a product has been dragged in to the shopping cart is same as the state of the s stem if it was added b clicking the add to cart button. $lso it has been ensured that all the images of the products displa ed in the shop products page are drag gable and have the product )opert so that the can be dropped in the cart area. In the )roduct 1escription ,odule it has been tested that all the images aredispla ed properl . ?sers can add review and the as soon as a user adds a review it is updated in the view customer review tab. It has been checked to see if the whole page refreshes or a partial page update happens when a user writes a review. In the >art 1etails it has been tested that when a user edits a 0uantit or removes a product from the cart, the total price is updated accordingl . It has been checked to see if the whole page refreshes or a partial page update happens when a user edits the cart. *isual Studio %..8 has in built support for testing the application. The unit testing can be done using visual studio %..8 without the need of an e=ternal application. *arious methods have been created for the purpose of unit testing. Test cases are automaticall generated for these methods. The tests run under the $S).5(T conte=t which means settings from 'eb.config file are automaticall picked up once the test case starts running. ,ethods were written to retrieve all the manufacturers from the database, strings that match a certain search term, products that match certain filter criteria, all images that belong to a particular product etc. ?nit test cases were automaticall generated for these methods and it can be seen in figure 2.1 that the tests have passed. ..2.2 I%#e)ra#!$% Te+#!%) In integration testing a s stem consisting of different modules is tested for problems arising from component interaction. Integration testing should be developed from the s stem specification. 6irstl , a minimum configuration must be integrated and tested. In m project I have done integration testing in a bottom up fashion i.e. in this project I have started construction and testing with atomic modules. $fter unit testing the modules are
21
integrated one b one and then tested the s stem for problems arising from component interaction. ..2.. <a-!da#!$% Te+#!%) It provides final assurances that software meets all functional, behavioral 7 performance re0uirement. /lack bo= testing techni0ues are used. There are three main components " *alidation test criteria Gno. in place of no. 7 char in place of charH " >onfiguration review Gto ensure the completeness of s3w configuration.H " $lpha 7 /eta testing"$lpha testing is done at developer!s site i.e. at home 7 /eta testing once it is deplo ed. Since I have not deplo ed m application, I could not do the /eta testing. Test >ases" I have used a number of test cases for testing the product. There were different cases for which different inputs were used to check whether desired output is produced or not. 1. $ddition of a new product to the cart should create a new row in the shopping cart. %. $ddition of an e=isting product to the cart has to update the 0uantit of the product. ;. $n changes to items in the cart have to update the summar correctl . <. /ecause same page is inserting data into more than one table in the database atomicit of the transaction is tested. -. The state of the s stem after a product has been dragged in to the cart should be ame as the state of the s stem if the same product is added to the cart b clicking button.
..2.4 :(!#e /$1 Te+#!%) In white bo= testing knowing the internal working of the product, tests can be conducted to ensure that internal operations are performed according to specification and will internal components have been ade0uatel e=ercised. In white bo= testing logical path through the software are tested b providing test cases that e=ercise specific sets of >onditions and loops. ?sing white"bo= testing software developer can derive test case that
2%
] &uarantee that all independent paths within a module have been e=ercised at least once. ] (=ercise all logical decisions on their true and false side. ] (=ercise all loops at their boundaries and within their operational bound. ] (=ercise internal data structure to ensure their validit . $t ever stage of project development I have tested the logics of the program b suppl ing the invalid inputs and generating the respective error messages. $ll the loops and conditional statements are tested to the boundar conditions and validated properl . ..2.4 Per"$r'a% e Te+#!%) Aakarta A,eter, a tool for testing applications was used to simulate the virtual users GclientsH and test the performance of the s stem. It can be used to test performance both on static and d namic resources Gfiles, Servlets, )erl scripts, Aava Objects, 1ata /ases and 9ueries, 6T) Servers and moreH. It can be used to simulate a heav load on a server, network or object to test its strength or to anal Ee overall performance under different load t pes. It can be used to make a graphical anal sis of performance and test the server3script3object behavior under heav concurrent load. I have done performance testing to achieve an estimate of the peak and sustained load the application. This has done with few pages like the Shop )roducts Ge=tensive 1atabase access, business logic Intensive and more ImagesH and the >art 1etails Gsimple pageH. $ few sample Screenshots of test results are shown below. The tests have been conducted b running the application GserverH and A,eter on same machine. These test results do not include factors like network bandwidth etc as the server is running on the same machine along with A,eter.
2;
4.1 Re+2-#+ C C(a--e%)e+ The application can be used for an (commerce application. It is eas to use, since it uses the &?I provided in the user dialog. ?ser friendl screens are provided. The application is eas to use and interactive making online shopping a recreational activit for users. It has been thoroughl tested and implemented. 4.1.1 C(a--e%)e+ >ompatibilit with browsers like ,oEilla 6irefo=, Internet e=plorer etc
2<
?sing a la ered approach in developing the application which would make the application maintainable. :earning new technologies like using AavaScript for drag and drop behavior and $ja= toolkit controls with little guidance. The overall idea of doing this project is to get a real time e=perience. :earn new technologies.
4.2 C$% -2+!$%+ The FOnline Shopping! is designed to provide a web based application that would make searching, viewing and selection of a product easier. The search engine provides an eas and convenient wa to search for products where a user can Search for a product interactivel and the search engine would refine the products available based on the user!s input. The user can then view the complete specification of each product. The can also view the product reviews and also write their own reviews. ?se of $ja= components would make the application interactive and prevents anno ing post backs. Its drag and drop feature would make it eas to use.
4.3 Limitations
This application does not have a built in check out process. $n e=ternal checkout package has to be integrated in to this application. $lso users cannot save the shopping carts so that the can access later i.e. the cannot create wish lists which the can access later. This application does not have features b which user can set price ranges for products and receive alerts once the price reaches the particular range.
2-
?sers can have multiple shipping and billing information saved. 1uring checkout the can use the drag and drop feature to select shipping and billing information.
4.3 Re"ere% e+ $ll about ,icrosoft controls in >\ httpB33www.msdn.microsoft.com3 'ikipedia for various diagrams 7 testing methods httpB33www.wikipedia.org3 >ool te=t for Images and /uttons httpB33coolte=t.com3 M"State +esearch (=change for samples in report writing httpB33kre=.k"state.edu3dspace3handle3%.DC3D-D Smart 1raw for drawing all the 1iagrams used in this report. httpB33www.smartdraw.com3 Sample (commerce $pplication httpB33www.5ew(gg.com $ja= Toolkit controls httpB33asp.net3aja=
22
2C