Coding

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Coding as PDF for free.

More details

  • Words: 817
  • Pages: 7
Online Shopping

3.3.1. SELECTION OF LANGUAGE: Ideally software requirements should precipitate the selection of a language that is best fit to the processing functions to be carried out. By considering the requirements and different language features required in the design phase, the best-suited software could be selected The process, which is specified in the design phase, needs data structures, memory speed and efficiency, graphic support, control structures and file manipulation operations. The concept of modularity and module independence is mainly required for object oriented programming specifications like windows programming. 3.3.2. KEY FEATURES OF SERVLETS: Unlike CGI and FastCGI, which use multiple processes to handle separate requests, servlets are handled by separate threads within the web server. •

Servlets are efficient and scalable.



Servlets are portable across operating systems and across



server implementations.



Servlet invocation is highly efficient. Once a servlet is loaded,it generally remains in the server’s memory as a single object instance.



Servlet code is clean, object oriented, modular, and amazingly simple.

48 Dept of C.S.E. Narayana Engineering College., Nellore.

Online Shopping



Servlets can handle errors safely, due to Java’s exception-handling mechanism.



Servlets are also quite flexible and easily extensible. 3.3.3. CODING STANDARDS: Code documentation: While concerning the procedural design language specified

in

the

design

phase for each module, the

code

documentation, the identifier naming is done meaningfully for the ease of understanding. The related data names with the remarks are specified in each module of the project. Data declaration: The different types of data are declared namely integer, real, char and long integer data types, which are needed for the huge data streams processing. Statement constructs: The statement constructs used are sequence, conditions and looping. For each construct the coding is done as a block of statements for easy understanding, for the complex arithmetic statements the parentheses are used.

49 Dept of C.S.E. Narayana Engineering College., Nellore.

Online Shopping

3.3.4 PSUEDO CODE OF MODULES: The screens used in this project are developed using HTML. Various Text fields, buttons, forms and a display are used in the development process.

1. Login Screen In the coding of the screens various Java packages has been imported. import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.sql.*; import java.lang.String.*; import java.util.*; import util.StringTokenizer.*; Servlets use classes and interfaces from two packages javax.servlt and javax.servlet.http.The javax.servlet contain classes to support generic, protocol-independent servlets. Every

servlet

must

implement

the

javax.servlet.Servlet

interface. Most servlets implement it by extending one of two special classes:javax.servlet.GenericServlet or javax.servlet.HttpServlet. public class Sample extends Httpservlet 50 Dept of C.S.E. Narayana Engineering College., Nellore.

Online Shopping

{ public void doGet (HttpServletRequest req, HttpServletREsponse res) throws servletException, IOException {

Any servlet uses the setContentType () method of the response object to set the content type of its response to “text/html”, the standard MIME content type for HTML pages. Then, it uses the get Writer() method to retrieve a print-Writer, the international-friendly counterpart to a printStream. When a client connects to a server and makes an HTTP request, the request can be of several different types, called methods. The more frequently used methods are GET and POST. The Get method is designed for getting information, while the POST method is designed for posting information. A servlet can identity the user through her username and thereby track her session. String sessionid=req.getpathInfo(); If(sessionid==null) { sessionid=user_id; } For the first time the sessionid is null, so we are generating the sessionid as user_id. The sessionid is passed to the next servlet as:

51 Dept of C.S.E. Narayana Engineering College., Nellore.

Online Shopping

out.println("
"); Through the a href the sessionid is passed as: out.println("
+

sessionid

+

" rel="nofollow">signout
"); In the Homepage various text fields like customer_id and password are used in which the user enters his ID and password. Userid: Password:

2.Registration Screen: Registration form contains various text fields like username, user id, password, city, state etc.., in which the user enters the details.

3. Items Screen: 52 Dept of C.S.E. Narayana Engineering College., Nellore.

Online Shopping

The administrator can insert the items in his shop. This HTML contains Text fields like Itemcode, Itemname, Itemdescription, Number of items etc.

4. Items Deletion Screen: The Administrator can delete the items in his shop by specifying the Itemcode he wants to delete.

5. Receiving Credit card Number: This screen gathers the Credit card number of the customer and checks the validity of the credit card.

53 Dept of C.S.E. Narayana Engineering College., Nellore.

Online Shopping



54 Dept of C.S.E. Narayana Engineering College., Nellore.

Related Documents

Coding
December 2019 22
Coding
July 2020 13
Coding
November 2019 26
Coding
April 2020 13
Coding
November 2019 26
Source Coding
June 2020 4