103
TABLE OF CONTENTS Content Page No. Abstract 4-5 List of figures 6 List of screens 7 1. Introducation…………………………………………………………………….. 7-8 1.1. Organisation Profile………………………………………………………... 7 2. Requirements……………………………………………………………………. 9-23 2.1. Current System……………………………………………………………... 10 2.2. Need for Automation……………………………………………………….. 10 2.3. Proposed System……………………………………………………………. 11 2.3.1. Scope of the System…………………………………………………. 2.3.2. Objectives……………………………………………………………. 2.3.3. Functional Overvies…………………………………………………. 2.4. Actors……………………………………………………………………….. 12 2.5. Use Cases…………………………………………………………………… 13 2.6. Scenarios……………………………………………………………………. 13 2.7. UML Diagrams…………………………………………………………….. 15 2.8. Non functional requirements……………………………………………… 20 2.8.1. User Interface……………………………………………………….. 2.8.2. Harware Requirements…………………………………………….. 1

Ajax Chat Applicaiton

Embed Size (px)

Citation preview

TABLE OF CONTENTSContent Abstract List of figures List of screens 1.1. Organisation Profile... 2.1. Current System... 2.2. Need for Automation.. 2.3. Proposed System. 2.3.1. Scope of the System. 2.3.2. Objectives. 2.3.3. Functional Overvies. 2.4. Actors.. 2.5. Use Cases 2.6. Scenarios. 2.7. UML Diagrams.. 2.8. Non functional requirements 2.8.1. User Interface.. 2.8.2. Harware Requirements.. 2.8.3. Software Requirements.. 2.8.4. Performance considerations... 2.8.5. Error Handling and Extreme Conditions. 2.8.6. Security Issues.. 3. System Analysis.. 24-33 3.1. Entity Objects.. 3.2. Boundary Objects... 24 26 12 13 13 15 20 Page No. 4-5 6 7 7 10 10 11

1. Introducation.. 7-8 2. Requirements. 9-23

1

3.3. Control Objects... 3.4. Interaction between objects... 3.5. Object Behaviour..... 4.1. Design Goals..... 4.2. System Architecture... 4.3. Global Control Flow... 4.4. Boundary Conditions.. 5.1. Types,Visibility and Signatures..... 5.2. Exceptions.... 5.3. Associations..... 5.4. Algorithms...

31 31 32 34 34 36 36 38 41 41 42

4. System Design.. 34-37

5. OBJECT SPECIFICATIONS..... 38-43

6. Coding. 44-57 6.1. Coding Approach... 6.2. Information Handling.... 6.3. Programming Style.... 6.4. Sample Code... 6.5. Verification and Validation... 44 44 45 45 57

7. System Testing..... 58-63 7.1. Testing concepts.. 58 7.2. Tesing Activities.. 58 7.3. Test Cases... 63 8. Technical Notes.... 64-70 8.1. Introduction to AJAX... 10. CONCLUSION.... 11. BIBLIOGRAPHY.... 64 76 77 9. SCREENS..... 71-75

2

ABSTRACT AJAXChat with Servlets and StrutsIt is to build a nice multilevel, multiroom chat application. Using this we can chat with anyone online. This application supports multiple users and multiple rooms. We can adjust font size of messages displayed in the room we are chatting in. we can see our messages in one color and other peoples messages in another color. We have an option to clear the history in a room so that the user can have a clean display at any time.

Modules: Client Server

Existing System:Existing system uses a normal web application, which will be suffered by numerous post backs during the order processing time. The main drawbacks in the existing systems are In the past, web applications were limited because a web page had to be reloaded (or another page loaded in its place) in order for new data to be obtained. The Web was originally designed for browsing HTML documents. As a result, the classic Web application model adopts:

Proposed system:This project develops a web application that eliminates synchronous page level post backs that causes entire page to post back.

3

AJAX is the technique of making web pages more interactive by using JavaScript to pull updated information from the server and modify the page displayed in the browser on the fly. In the AJAX model: o "Partial screen update" replaces the "click, wait, and refresh" user interaction model. o Asynchronous communication replaces "synchronous request/response model."

Software and Hardware Requirements: Software Requirements

Operating system: windows 98, MS-DOS Backend : ORACLE 10g Front end : HTML, DHTML. Language : Java1.5.0 (JDBC, SERVLETS), Java script Browser : Internet Explorer4.0 Server : Tomcat Apache 5.0.

Hardware Requirements RAM Hard disk Monitor Keyboard : 256 MB : 1.74MB : SVGA color monitor : 105 standard and mouse.

Technologies used: Servlets

4

JSP AJAX Struts

LIST OF FIGURES:Page no.

Figure 1 Use Case Diagram1.. 15 Figure 2 Use Case Diagram2...... 16 Figure 3 Sequence Diagram.... 17 Figure 4 Collaboration Diagram..... 18 Figure 5 Class Diagram... 19 Figure 6 State Chart Diagram 32

List of Screens:Page no.

Screen 1 Boundary object for Login Form.. 26 Screen 2 Boundary object for Use.............. 27 Screen 3 Boundary object for Chat Room.. 28 Screen 4 Boundary object for Music Chat Room .. 29 Screen 5 Boundary object for Television 30

5

1.INTRODUCTION1.1 Organization Profile: About the companyHoneypot IT Consulting Private Limited is an internationally established software development company with offices USA and India. The Indian office and development centre is located in a state-of-art facility in the heart of Hyderabad; India. Honeypot IT is into software product development and enterprise consulting services. Honeypot IT service offerings cater to multiple industry domains and verticals, following full or partial SDLC, optimally customized to cater to specific client needs. Honeypot also provide human resources for the different areas of a software development life cycle.

VisionHoneypot IT Solutions is an interactive and technology solution Provider. We help clients to plan their online strategy, budget their technology investments, integrate critical applications, and implement projects that achieve business objectives and improve performance. Since our inception we have focused on building dynamic, user-focused web sites, intranet's and extranets, supported by interactive marketing and e-communication campaigns.

Mission ValuesSince its inception, Honeypot IT has been governed by its core values. They shape the culture and define the character of our company. They guide how we behave and make decisions.

6

Client Value CreationImproving our clients business performance, creating long-term, win-win relationships and focusing on execution excellence.

Respect for the IndividualValuing diversity, ensuring an interesting and inclusive environment and treating people as we would like to be treated ourselves.

IntegrityInspiring trust by taking responsibility, acting ethically and encouraging honest and open debate.

Honeypot IT Consulting services range from customized software design and developmentservices to product based enterprise and web application development. Honeypot IT service offerings cater to multiple industry domains and verticals, following full or partial SDLC, optimally customized to cater to specific client needs.

Honeypot IT service offerings are based on its understanding of clients' business processesand functional requirements. The business domain knowledge is then applied to develop software solutions by utilizing the available pool of technical skill sets and proven methodologies. Honeypot IT offer specialized services in outsourced software development, which allows our clients to focus on their core competencies, while outsourcing IT requirements to Honeypot IT. The clients benefit from Honeypot its spectrum of technology tools, quality services and low cost of development.

List of servicesApplication Services Product Engineering Web Designing & Development

7

Search Engine Optimization QA & Testing Service

2.REQUIREMENTSRequirement Elicitation focuses on describing the purpose of the system. The client, the developers and the users identify the problem area and define a system that addresses the problem. Such a definition is called a system specification and serves as a contract between the client and the developers. The system specification is structured and formalized during analysis to produce an analysis model. They differ only in the language and notation they use. The system specification is written in natural language, where as the analysis model is expressed in a formal or semiformal notation. The system specification supports the communication with the client and the users and among the developers. They are the models of the system in the sense that they attempt to accurately represent the external the aspects of the system. Since the models represent the same aspects of the system, the requirement elicitation and elicitation and analysis occur concurrently and iteratively. Requirement elicitation and analysis focuses only on the user view of the system. For example the system functionality, the interaction b/t the user and the system, the errors that the system can detect and handle and the environmental conditions in which the system functions are the parts of the requirements. The system structure, the implementation technology, and other aspects are not directly visible to the user and not the parts of the requirements. Requirements documentation involves studying the current system to find out how it works and where improvements should be made. Information will be gathered from all areas. A requirement is a feature that must be included in a new system. It may include a way of capturing or processing data, producing information, controlling system activity. Requirement Elicitation focuses on describing the purpose of the system. The client, developers and the users identify the problem area and define the specification servers as 8

contract between the client and the developers. Here the focuses mainly on the users view of the system.

2.1 Current System:Earlier people used to make orders manually as more number of users could not access the system efficiently. One advantage of a single-screen is that users can see the big picture of the application, seeing all of the steps necessary to complete the application. This gives users a clear idea of what is expected of them during a transaction. Later it was made online through page based web application so that any number of users can make their orders simultaneously in which the users can also modify their contents and reorder them. Developers typically build these applications, which mimic the sophistication of desktop applications developers who build page-based applications using standard web technologies are forced to deal with the load-reload effect of normal web pages. . Typically, when users enter information into an input field on a page-based web application, nothing is done with that information until they press "submit". After they press, "submit" the information is sent to the server, a response is returned, notifying the user of success or failure. During this time, which typically changes based on the speed of the connection and the amount of processing being done, the user sits and waits while the page refreshes.

2.2 Need For Automation:The current system needs to be automated for loading or reloading the pages in the page based web applications so that the new system may consume less time for refreshing the pages. The problems in the current system are:

9

There may be several users using the same system at different times. They

may change the any content, and added very important orders. These situations may damage the system or make the system work improperly. There is no proper report for administrator to know these changes and act During the submission of the details, which typically changes based on the accordingly. speed of the connection and the amount of processing being done, the user sits and waits while the page refreshes. On a page-based application, they might have to click through several pages without knowing what is ahead of them.

2.3 Proposed System:Since the current system needs to be automated to rectify the problems , we use a new technological approach, dubbed Ajax, might just be the right mix of single screen and page based web application. Ajax is a new web approach that marries the benefits of both screen and paged-based approaches. By allowing more sophisticated functionality using easier-toimplement web standards, Ajax is proving a real alternative for creating powerful web applications Ajax applications, on the other hand, don't need to refresh the entire page to update information on it. Instead, Ajax applications can simply update parts of the page at any time, giving users an instantaneous response to their inputs and queries. This allows users to continually see what they're working on and react to any changes, errors, or updates the interface notifies them of. Because Ajax applications are built using nothing more than current web standards, they are relatively easy to create.

2.3.1 Scope of the System:The AJAX implementation of the online order processing system can help to reduce the time to refresh the loaded pages even after the application encounters the changes. When

10

many users are processing orders through intranet or internet, this system will be a bit easier to implement so that the changed pages will be refreshed thoroughly.

2.3.2 Objectives:The objective of the project is to make effective and efficient automated system. We can analyze the awareness about various activities of the project. Success of the project lies in aspects such as How well to automate the System. How well the user feels ease with the System. How well the client -server interacts with the system

2.3.3 Functional overview:The following are the functionalities of the present system: To process the user orders. To add Customer details and orders specified machine. To maintain Data and Details of all Transitions. To generate report.

2.4 Actors:Actors represent external entities that interact with the system. An actor can be human or an external system. During this activity, developers identify the Actors involved in this system are: Administrator:

11

Administrator is an actor who starts the service and who control the unnecessary deletions in the file system. User: User is an actor who uses the files and who may deletes the files in the client systems.

2.5 Use Cases:Use cases are used during requirement elicitation and analysis to represent the functionality of the system. Use cases focus on the behavior of the system from an external point of view. A use case describes a function provided by the system that yields a visible result for an actor. An actor describes any entity that interacts with the system. The identification of actors and use cases results in the definition of the boundary of the system, which is, in differentiating the tasks accomplished by the system and the tasks accomplished by its environment. The actors are outside the boundary of the system, where as the use cases are inside the boundary of the system. Actors are external entities that interact with the system. Use cases describe the behavior of the system as seen from an actors point of view. Actors initiate a use case to access the system functionality. The use case then initiates other use cases and gathers more information from the actors. When actors and use cases exchange information, they are said to be communicate

2.6 Scenarios:A Use Case is an abstraction that describes all possible Scenarios involving the described functionality. A scenario is an instance of a use case describing a concrete set of actions. Scenarios are used as examples for illustrating common cases. Their focus is on

12

understandability. Use cases are used as examples for illustrating common cases. Their focus is on completeness. We describe a scenario using a template with three The name of the scenario enables us to refer to it ambiguously. The name of a scenario is underlined to indicate it is an instance. The participating actor instances field indicates which actor instances are involved in this scenario. Actor instances also have underlined names The flow of events of a scenario describes the sequence of events step by step.

13

2.7 UML DIAGRAMS Use Case Diagrams

14

GENERAL TOPICS

PROGRAMMING

MOVIES USER

MUSIC

TELIVISION

LOG OUT

15

GENERAL TOPICS

PROGRAMMING

MOVIES USER

MUSIC

TELIVISION

LOG OUT

16

Sequential Diagram

USER

TOPICS

SENDER

RECIVER

GENERAL TEXT BOX TEXT RECIEVED PROGRAMMING LEAVE ROOM

LEAVE ROOM

MOVIES CLEAR HISTORY MUSIC SEND MUSIC YOUR COLOR TELEVISION THAIR COLOR PINK LOG OUT RECIEVED

17

Collabration Diagram1: GENERAL 4: PROGRAMMING 8: MOVIES 10: MUSIC 12: MUSIC 15: TELEVISION USER

TOPICS

7: LEAVE ROOM 2: TEXT BOX LOG OUT 18: 5: LEAVE ROOM 9: CLEAR HISTORY 11: SEND 14: YOUR COLOR 16: THAIR COLOR

6:

3: TEXT RECIEVED 13: RECIEVED 17: PINK

RECIVE R

SENDE R

18

Class Diagram

USER

CHAT ROOMS

GENERAL MESSAGE BOX SENDING() RECIEVING() UPDATING COLOUR() CLEAR HISTORY()

MOVIES MESSAGE BOX SENDING() RECIEVING() UPDATING COLOUR() CLEAR HISTORY()

TELEVISION MESSAGE BOX SENDING() RECIEVING() UPDATING COLOUR() CLEAR HISTORY()

TELEVISION MESSAGE BOX SENDING() RECIEVING() UPDATING COLOUR() CLEAR HISTORY()

19

2.8 Non functional requirements:Non-functional requirements describe user visible aspects of the system. Nonfunctional requirements span a number of issues from user interface look and feel to response time requirements to security issues. Non-functional requirements are defined at the same time as functional requirements are, because they have as much impact on the development and cost of the system. Non functional requirements describe user-visible aspects of the system that are not directly related to functionality of the system

2.8.1 User InterfaceThe system is provided with click and goes type of graphical user interface with buttons and links that can be easily understood by the user so that the errors in the entering the date in appropriate fields can be reduced. The system is designed in such a way that a user without any computer knowledge can also use the system with the aid of help file that is also called as user manual. A menu interface has been provided to the client that is compatible with Windows environment and is designed to be user friendly. The client is provided with an introductory help about the client interface and the user documentation has been developed through help menu. The system is user-friendly and the system can be implemented on any software environment.

2.8.2 Hardware Requirements: PIII 500MHZ or above

128MB RAM 2 GB Hard disk space. Network interface card or Modem (For Remote Sources)

20

LAN Network (For Remote Sources)

2.8.3 Software Requirements: WINDOWS NT 4 | 2000 | 9.X | ME Jdk1.5 Java Script HTML MS Access

2.8.4 Performance considerations: workload. Requests should be processed within no time. Users should be authenticated for accessing the requested data. System should be responsive and should be in a position to handle any

2.8.5 Error Handling and Extreme Conditions:In case of User Error, the System should display a meaningful error message to the user, such that the user can correct his Error. The high level components in proposed system should handle exceptions that occur while connecting to database server, IO Exceptions etc. Quality Issues refer to how reliable, available and robust should the system be? While developing the proposed system the developer must be able to guarantee the reliability transactions so that they will be processed completely and accurately. The ability of system to detect failures and recovery from those failures refers to the availability of system.

21

Robustness of system refers to the capability of system providing information when concurrent users requesting for information

2.8.6 Security Issues:The system can withstand against all the instructions because administrator is the only person who can change the settings of the system. The login form will be there for every user to uniquely identify them. Access control policies are applied to provide security to the system from users. Analysis focuses on producing a model of the system which is correct, complete, consistent and verifiable. Developers formalize the system specification produced during requirement elicitation and examine in more details boundary conditions. Analysis is different from requirement elicitation in that developers focus on formalizes the requirements elicited from users. Although the analysis model may not be understandable to the users and the client, it helps developers verify the system specification produced during requirement elicitation. There is a natural tendency for users and developers to post pone difficult decisions until later in the project. A decision may be difficult because of disagreements among users and developers. Postponing decisions enables the project to move on smoothly and avoid confrontation with reality or peers. Unfortunately, difficult decisions will eventually need to be made, often at higher cost when intrinsic problems are discovered during testing, or worse, during user evaluation. Translating a system specification into formal or semiformal model forces developers to identify and resolve difficulty issues early in the development. The analysis model is composed of 3 individual model: the functional model, represented by use cases and scenarios, the analysis object model, represented by class and object diagrams, and dynamic model, represented by state chart and sequence diagrams. This leads to a more precise and complete specifications as details are add to the analysis model. The analysis model represents the system under development from the users point of view. The analysis object model is a part of the analysis and focuses on the individual

22

concepts that are manipulated by the system, their properties and their relationships. The analysis object model, depicted with UML class diagrams, includes classes, attributes, and operations. The analysis object model is a visual dictionary of the main concepts visible to the user.

23

3.SYSTEM ANALYSIS3.1 Entity Objects:An entity represents a real time object that can be uniquely identified by a set of attributes. Entity objects represent the output or input data item through which the system can have information. That is, Entity objects represent the persistent information tracked by the system. The current process involves the following entity objects: The below structure defines the login details Structure login { Char uname[20]; Char pwd[20]; Char role[20]; } The following structure defines the company details: Structure Company { int Compid; char compname[20]; char Email[20]; int phno; char Comments[50]; } The following structure defines the customer details:

24

Structure Customer { int custid; char Customername[20]; char Email[20]; } The following structure defines the Products details: Structure Products { int Productid; char Productname[20]; int Compid; char color[20]; double Pur_price; double Sale_price; int Stock; int reorderlevel; } The following structure defines the Orders details: Structure Products { int Orderid; int Custid[20]; date Orddt; date delidt; }

25

3.2 Boundary Objects

The boundary objects identified in the present system are:

Boundary Object for Login Form:

26

This form is the starting form of our application. A user enters his username and password and the role. If the user is identified as an administrator account holder then he will be navigated to the administrators welcome page. Else if he is a limited user, he will be navigated to the users home page.

Boundary object for User:

This form is the administrators welcome page. This is the main page of the administrator giving him options of generating orders, customer details, company details. Not only these, but also he is provided with a powerful feature which makes him the administrator.

27

Boundary Object for Chat Room:

28

Boundary Object for MusicChat Room:

29

Boundary Objects of Television

30

3.3 Control Objects:Control objects are responsible for coordinating entity objects and boundary objects. A control object is creating at the beginning of the use cases and ceases to exist at its end. Control objects usually do not have a concrete counter part in the real world. Control object is a responsible for collecting information from the boundary objects and dispatching it to entity objects. Here in my application the quantity of products is acts as a control object. So we have to convert it into the integer. So Integer. ParseInt() function is used for this purpose.

3.4 Interaction between objects:Interaction between objects can be described by means of sequence diagrams. A sequence diagram ties uses cases with objects. It shows how the behavior of a use case (or a scenario) is distributed among its participating objects. Sequence diagrams are usually not good for communication with the user. An object interacts with another object by sending messages. The reception of a message by an object triggers the execution of an operation, which in turn may send messages to other objects. Arguments may be passed along with a message and are bound to the parameters of the executing operation in the receiving object. Sequence diagrams describe interactions among classes in terms of an exchange of messages over time. Typically, we use a sequence diagram to describe the event flow of a use case, identify the objects that participate in the use case, and assign pieces of the use case behavior to the objects in the form of services. The columns of a sequence diagram represent the objects that participate in the use case. The leftmost column is actor who initiates the use case. Horizontal arrows, across columns represent messages, or stimuli, which are from top to bottom. The activation is represented by rectangle from which other message can originate .the length of the represent the time the operation is active.

31

3.5 Object Behavior:The object behavior can be represented by the use of state chart diagram. There are two state chart diagrams for the current system. The following state chart diagrams describe the behavior of the objects:

State chart Diagram for Login Form :

Enter into Login Form

Choose the needed Option

Select and fill with data

Update data into Database

32

Design is the first step in the development phase for any techniques and principles for the purpose of defining a device, a process or system in sufficient detail to permit its physical realization.

Once the software requirements have been realized, analyzed and specified the software design involves three technical activities design, coding, generation and testing that are required to build and verify the software. The design activities are of main importance in this phase, because in this activity, decisions ultimately affecting the success of software implementation and its ease of maintenance are made. These decisions have the final bearing upon reliability and maintainability of the system. Design is the place where quality is fostered in development. Software design is a process through which requirements are translated into a representation of software. System Design is the transform of analysis model into a system design model. Developers define the design goals of the project and decompose the system into smaller subsystems that can be realized by individual teams. Developers also select strategies for building the system, such as the hardware/software platform on which the system will run, the persistent data management strategy, the goal control flow the access control policy and the handling of boundary conditions. The result of the system design is model that includes a clear description of each of these strategies, subsystem decomposition, and a UML deployment diagram representing the hardware/software mapping of the system. The Analysis model describes the system completely form the actors point of view and serves as the basis of communication between the client and the developers. The Analysis model, however, does not contain information about the internal structure of the system, its hardware configuration or more generally, how the system should be realized. System design is the first step in this direction. During the system design activities, Developers Bridge the gap between the requirements specification, produced during requirements elicitation and analysis, and the system that is delivered to the users.

33

4.SYSTEM DESIGN4.1 Design Goals:The definition of goals is the first step of system design, it defines the qualities that our system should focus on many design goals can be inferred from the non function requirements or from the application domain, other will have to the elicited from the Client, it is necessary to state them explicitly such that every important design decisions can be made consistently following the same set of criteria. The following are the design goals for the current system:

a.

Reliability: The application should be reliable in keeping the data secure during computation

of the orders. b. Fault Tolerance: The application should handle all the expected faults that a user is highly

probable to commit. c. Security: It should never compromise on the security of orders and data. Once it fails to

maintain security to the orders/data, the application becomes a worthless bauble. d. Modifiability: It should be easy to be understood. The design and implementation should not

be too complex for another person to understand it. It should be feasible for modification.

4.2 System Architecture:

Finding sub systems during system design has many similarities to finding objects during analysis. System decomposition is constantly revised whenever new issues are addressed. The initial sub system decomposition should be delivered from the functional requirements.

34

A starting point is to take the use cases and assign the participating objects that have been identified in each of them to the sub systems. As the complexity of systems increases, the specification of the system decomposition is critical. Moreover, subsystem decomposition is constantly revised whenever new issues are addressed. Subsystems are merged into alone subsystem, a complex subsystem is split into parts, and some subsystems are added to take care of new functionality. The first iterations over the subsystem decomposition can introduce drastic changes in the system design model. These are often best handled through brainstorming sessions.

4.3 Global Control Flow:Control flow is the sequencing of actions in a system. It defines the order of execution of operations. These decisions are based on external events generated by an actor or on the passage of time. These are three possible control flow mechanisms.

(a) Procedure Driven Control:Operations wait for input whenever they need data from an actor. In this application, System will wait until the administrator produce Company, Customer details and products details.

(b)Event Driven Control:A main loop waits for an external event. Whenever an event is available, it is dispatched to appropriate program based on information associated with the event. In this system when ever the user wants to make an order then the inner loop waits until the administrator gave the company details and product then only the loop executes and the details are retrieved.

35

4.4 Boundary Conditions:During this activity we review the design decisions we made so far and identify additional conditions i.e., how the system is started, initialized, shutdown and how to deal with major failures such as data corruption.

Configure: For each persistent object, we examine in which use cases it is created ordestroyed. We determine whether data is being written in the database in a standard format according to Oracle conventions.

Start up and Shutdown:

For each component we add three use cases to start,

shutdown and configure the component.

Exception Handling: For each type of component failure we decide how the systemshould react. In general exception is an event or error that occurs during the execution of the system. Exceptions are caused by different sources.

Hardware Failure: Hardware ages and fails. For example; the failure of the data base serveretc..,

During Analysis, we describe the purpose of the system. This results in the identification of application objects that represent user concepts. During system design, we describe the system in terms of its architecture, such as its subsystem decomposition, its global

36

control flow, and its persistency management. During system design, we also define the hardware /software platform on which we build the system. This results in the selection of offthe shelf components that provide a higher level of abstraction than the hardware. During Object design developers close the gap between the application objects and the off-the-shelf components by identifying additional solution objects and refining existing objects. Object design includes: 1. Service specification 2. Component selection 3. Object model restructuring 4. Object model optimization Object design, like system design is not algorithmic. During object design, we refine the analysis and system design models, identify new objects, and close the gap between application objects and off-the-shelf components. This includes the identification of custom objects, the adjustment of off-the-shelf components, and the precise specification of each subsystem interface and class. as a result, the object design model can be partitioned into sets of components such that they can implemented by individual developers. Object design is non-linear. Although the group of activities describes above each addresses a specific object design issue, they need to occur concurrently. A specific off-the-shelf components may contain the number of types of exceptions mentioned in the specification of an operation and thus may impact the subsystem interface. The larger number of objects and developers, the high rate of change, and the concurrent number of decisions made during object design make this activity much more complex than analysis or system design is.

37

5. Object Specification:

The System design model focuses on the subsystem decomposition and global system decision such as hardware/software mapping persistent storage or access control. We identify top-level subsystems and define them in terms of the services they provide. Object design includes service specification activity. During this we specify the sub system services in terms of class interfaces, including operations, arguments, type signatures and exceptions. During this activity, we also needed missing operations and objects needed to transfer data among subsystem. The result of this activity is a complete interface for each subsystem

Specification activities during Object Design Identifying missing attributes and operations Specifying type signatures and visibility Specifying constraints Specifying exceptions

5.1 Types, Visibility and Signatures:In this we specify the types of attributes the signature of operation and visibility of attributes and operation specifying type refines the object design model into two ways Add detail to the model by specifying the range of each attributes The map classes and attributes of the objects model to built in types provided by the development environment

38

In this we also consider the relationship between the classes we identify and classes form the off the shelf components Finally we determine visibility of each attribute and operation.

Private: A private attribute can be accessed only by the class in which it is defined. Similarly only the class in which it is defined can invoke a private operation subclass or other classes cannot access private attributes and operations. Protect: A protected attribute or operation can be accessed by the class in which it is denied and on any descendant of the class. Public: A public attribute or operation can be accessed by any class.

1. Object Name: Login Processlogin

User name : string UserPwd : string Role : string

Boolean Login ()

Type:User name: This is a character variable describing the user name Pass word: This is the character variable describing the pass word Role: This is the character variable describing the role. Bool Login (): This is Boolean function describing whether the user logged in is valid or not.

39

Signature:Char User name; Char Password; Char Role; Bool Login ();

Visibility:Here the variables are private and the methods are public.

2. Object Name: Add/ Modify/delete Details

Add/modify details

CustmerId : number companyId: number ProductId :number

addDetails () modifyDetails() deleteDetails()

Type:Customer id: This is the integer variable describing the customer id. Company id: This is the integer variable describing the customer id. Product id: This is the integer variable describing the customer id. addDetails (): This is function is used for adding details of the customer, products and company. modifyDetails (): This is function is used for modifying details of the customer, products and company.

40

deleteDetails (): This is function is used for deleting details of the customer, products and company.

Signature:int companyid; int customerid; int customerid; void addDetails(); void modifyDetails(); void deleteDetails();

Visibility:Here the variables are private and the methods are public.

5.2 Exceptions:In this we specify constraints that the caller needs to specify before invoking on operation or specify condition that the operation detect and treat as errors by raising an exception. In language such as java and ADA we have built in mechanism for exception handling. Other languages such as c and c++ do not support explicit handling. So the developers need to establish conventions and mechanisms for handling exceptions. These can be found systematically by examining each parameter of the operation by examining the states in which the operation may be invoked.

5.3 Associations:Associations are UML concepts that denote collections of bi conditional limits between two or more objects. References are unidirectional and take place between two objects. 1. One_to_one association

41

The simplest association is one_to_one association. In the present ,the association between user and system is one to one. User system

2. One_to_many association: In the present system the association between administrator and the users is one to many Administrator 3. Many_to_many association: In the present system the association between users Internet is many to many User Internet users

5.4 Algorithms:

AJAX interaction that will provide the validation logic.

42

The steps for interaction are: 1. A client event occurs. 2. A XMLHttpRequest object is created and configured. 3. The XMLHttpRequest object makes a call. 4. The request is processed by the ValidateServlet. 5. The ValidateServlet returns an XML document containing the results. 6. The XMLHttpRequest object calls the callback () function and processes the result. 7. The HTML DOM is updated.

43

6.CODINGThe goal of the coding or programming phase is to translate the design of the system produced during the design phase into code in a given programming language, which can be executed by a computer and that performs the computation specified by the design. The coding phase affects both testing and maintenance. The goal of coding is not to reduce the implementation cost but the goal should be to reduce the cost of later phases. In other words the goal is not to simplify the job of programmer. Rather the goal should be to simplify the job of the tester and maintainer.

6.1 Coding Approach:There are two major approaches for coding any software system. They are Top-Down approach and bottom up approach. 44

Bottom-up Approach can best suit for developing the object-oriented systems. During system design phase of reduce the complexity. We decompose the system into an appropriate number of subsystems, for which objects can be modeled independently. These objects exhibit the way the subsystems perform their operations. Once objects have been modeled they are implemented by means of coding. Even though related to the same system as the objects are implemented of each other the Bottom-Up approach is more suitable for coding these objects. In this approach, we first do the coding of objects independently and then we integrate these modules into one system to which they belong.

6.2 Information Handling:Any software system require some amount of information during its operation selection of appropriate data structures can help us to produce the code so that objects of the system can better operate with the available information decreased complexity.

6.3 Programming Style:Programming style deals with act of rules that a programmer has to follow so that the characteristics of coding such as Trace ability, Understandability, Modifiability, Extensibility can be satisfied. In the current system we followed the coding rules for naming the variables and methods. As part of coding internal documentation is also provided that help the readers to better understand the code.

6.4 Sample Code:45

HomePage.jsp var st; function validate1() { var usid=""; usid = document.getElementById("usid"); st=frm.s1.value; var url = "validateuser1.jsp?usid="+usid.value; if (window.XMLHttpRequest) req = new XMLHttpRequest(); else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP"); if(st=="customer") { req.open("GET", url, true); req.onreadystatechange =callback; req.send(null); } }

46

function callback() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseText; msg1.innerText=message; } } } function check() { st=frm.s1.value; } function callpage() { st=frm.s1.value; var usid = document.getElementById("usid"); var pswd = document.getElementById("pswd"); if(st=="customer") window.open("customerh.jsp?usid="+usid.value+" &pswd="+pswd.value,"_self"); else if(st=="admin" && usid.value=="admin" && pswd.value=="admin") window.open("admin.jsp","_self"); else alert("Invalid id..."); }

47

Online Order Processing System (AJAX)

Role : Choose Role Admin Customer User Name :

48

Password :

Admin.jsp: function validate1() { var usid = document.getElementById("usid"); var url = "validateuser.jsp?usid="+usid.value; if (window.XMLHttpRequest) req = new XMLHttpRequest(); else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP"); req.open("GET", url, true); req.onreadystatechange =callback;

49

req.send(null); } function callback() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseText; msg1.innerText=message; } } } function insertcallback() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseText; alert(message); } } } function insert1() { var usid = document.getElementById("usid"); var pswd = document.getElementById("pswd"); if(usid.value!="" && pswd.value!="") {

50

var url = "insert1.jsp?usid="+usid.value+"&pswd="+pswd.value; if (window.XMLHttpRequest) req = new XMLHttpRequest(); else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP"); req.open("GET", url, true); req.onreadystatechange = insertcallback; req.send(null); } else alert("Fill the fields..."); } Administrator [ home ]

Customer

51

Product Company Reports

Validatecid.jsp:

Cost.jsp: var uc=0,q=0; function getcomp() { var sp = document.getElementById("sp"); var url = "getprice.jsp?sp="+sp.value; if (window.XMLHttpRequest) req = new XMLHttpRequest(); else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP"); req.open("GET", url, true); req.onreadystatechange=compcallback; req.send(null); }

53

function getprice() { var sp=document.getElementById("sp"); var comp=document.getElementById("comp"); var url = "getprice1.jsp?sp="+sp.value+"&comp="+comp.value; if (window.XMLHttpRequest) req = new XMLHttpRequest(); else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP"); req.open("GET", url, true); req.onreadystatechange=pricecallback; req.send(null); } function pricecallback() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseText; frm.uc.value=message; costcal(); frm.q.focus(); frm.q.select(); } } } function compcallback() { if (req.readyState == 4) { if (req.status == 200) { frm.comp.remove(0); frm.comp.remove(1); frm.comp[0]=new Option("Company"); var message = req.responseText; var f1=message.indexOf(":"); var fitem=message.substring(0,f1); var sitem=message.substring(f1+1,message.length-1); frm.comp[1]=new Option(fitem.substring(2),fitem.substring(2));

54

if(sitem!=":") frm.comp[2]=new Option(sitem,sitem); }}} function costcal() { uc=eval(frm.uc.value); q=eval(frm.q.value); var cs=q*uc; frm.c.value=cs; } function fun() { frm.q.select(); frm.sp.focus(); } function orderadd() { var sp = document.getElementById("sp"); var uc = document.getElementById("uc"); var q = document.getElementById("q"); var c = document.getElementById("c"); var url = "processorder.jsp?sp="+sp.value+"&uc="+uc.value+"&q="+q.value+"&c="+c.value; if (window.XMLHttpRequest) req = new XMLHttpRequest(); else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP"); req.open("GET",url,true); req.onreadystatechange=ordercallback; req.send(null); } function ordercallback() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseText; alert(message); } } }

55

User : Order Processing



Select Product : Product

56

Select Company : Unit Cost : Quantity : Cost :
Select More Products



order date
Process Order

57

6.4 Verification and Validation:Verification is the process of checking the product built is right. Validation is the process of checking weather the right product is built. During the Development of the system Coding for the object has been thoroughly verified from different aspects regarding their design, in the way they are integrated and etc. The various techniques that have been followed for validation discussed in testing the current system.

7.TESINGTesting is the process of finding differences between the expected behavior specified by system models and the observed behavior of the system.

7.1 TESTING CONCEPTS: A component is a part of the system that can be isolated for testing. A component A fault, also called bug or defect, is a design or coding mistake that may cause

can be an object, a group of objects, or one or more subsystems. abnormal component behavior. An error is a manifestation of a fault during the execution of the system.

58

A failure is a deviation between the specification of a component and its behavior. A test case is a set of inputs and expected results that exercise a component with

A failure is triggered by one or more errors. the purpose of causing failures and detecting faults.

7.2 TESTING ACTIVITIES: Inspecting a component, this finds faults in an individual component through the manual inspection of its source code. Unit testing, which finds faults by isolating an individual component using test stubs and drivers and by exercising the components using a test case. Integration testing, which finds faults by integrating several components together. System testing, which focuses on the complete system, its functional and nonfunctional requirements and its target environment.

Testing is the phase where the errors remaining from all the previous phases must be detected. Hence, testing performs a very critical role for quality assurance and for ensuring the reliability of software. Testing of designed software consists of providing the software wit a set of test outputs and observing if the software behaves as expected. If the software fails to behave as expected, then the conditions under which a failure occurs are needed for debugging and correction. The following terms are some commonly used terms associated with testing.

ErrorThe discrepancy term a error is used in two different ways. It to human action refers that to the between computed, observed, or measured value and is also used to refer true, specified, or results in

theoretically correct value. Error

59

software containing a defect or fault. This definition is quite general and encompasses all the phases.

FaultFault is a condition that causes a system to fail in performing its required function. In other words a fault is an incorrect intermediate state that may have been entered during program execution.

FailureFailure required is the inability to of the its system or component to perform a

function

according

specifications. In other words a

failure is a

manifestation of error. But the mere presence of an error may not cause a failure. Presence of an error implies that a failure must have occurred, and the observation of a failure implies that a fault must be present in the system. However, the presence of a fault does not imply that a failure must occur.

A test case is the triplet [i, s, o], where i stands for the data input to the system, s is the output of the state of the system at which the data is input, and o is the expected system .a test suite is the set of all test cases with which a given software

product is to be tested.

Verification and ValidationVerification errors. is the process of determining whether one phase of the software

product confirms to its previous phase. Verification is concerned with phase containment of

60

Validation is the process of determining whether a fully developed system confirms to its required specification. The aim is to make the final product error free.

Types of testing: 1. White box testing. 2. Black box testing. White box testing:1. In the white box testing the designer can derive test cases that guarantee that all independent once. 2. Exercise all logical decision on their true and false sides. 3. Exercise all bounds. 4. Exercise internal data structures to ensure their validity. loops at their boundaries and within their operational paths within a module have been exercised at least

There are several methods used in the white box testing in the software design.

Statement

coverageIn this, each statement in a program is executed at least once. This is done by

checking the program in debug mode and by verifying each statement.

Branch coverageIn this, each and every branch is tested whether the different branch conditions are true or false. It is a stronger test criterion over statement coverage testing.

Condition coverage61

In this, each component of a condition of a composite conditional expression is given both true and false values. It is a stronger test criterion over branch coverage testing.

Path coverage:In this testing, all the linearly independent paths in the program are executed once. A linearly independent path is defined in terms of the control flow graph of a program. The control flow graph describes how the flow of control passes through the program.

Data-flow based testingIn this method, selects the test paths of a program according to the locations of the definitions statements. and use of different variables in program. Data-flow based testing strategies are useful for selecting tested paths of a program containing nested if and loop

Mutation testingIn this method, the software is first tested by the above methods after the initial testing. In the mutation testing few small changes to program at a time such as, changing a conditional operator or changing the type of variable each time the program is changed, is data is called a mutated program and the change effected is called mutant. Then it is tested if it gives an error, then the mutant is said to be enhanced to kill the mutant. dead, if it is working properly then the test

Black box testingThe black box testing focuses on the functional requirement of the software. That is for a swinger the black box testing will give the desired results for what it is

62

meant for, it means that he has to exercise all functional requirements for a program. The black box testing is done after the software is developed. Black box testing attempts to find errors in the following: 1. Incorrect or missing functions. 2. Interface errors. 3. Errors in data structures or external database access. 4. Performance errors. 5. Initialization and termination errors.

Testing object oriented programs are different from testing functional oriented programs. As the test cases in black box testing are selected independently of the internal structure of the code, it does not matter whether the software is object oriented or function oriented however, if the testing is white box, then the test cases are determined based on the structure of the program. Testing classes is fundamentally different from testing functions as a function has a clearly defined input-output behavior while a class does not have an input-output behavior specification. Further a class cannot be tested directly; only an instance of class can be tested. This means that, we test a class indirectly by testing its instance. Further there is no sequential control flow with in a class like in functions. In a function, arguments, passed to the function with global data determine the path of execution within the procedure, but in an object, the state associated with object also influences the path of execution, and methods of a class can communicate each other among themselves through this state, because this state is persistent across invocation of methods. Hence, state of an object plays a major role in testing objects.

System testing:System tests are designed to validate a fully developed system with a view to

assuring that it meets requirements. There are three kinds of system testing.

Alpha testing

63

Alpha testing refers to the system testing that its carried out by the customer with in the organization along with the developer. The alpha tests are conducted in a controlled manner.

Beta testingBeta testing is the system testing performed by a select group customers .The developer is not present at the site and the user will inform the problems that are encountered. As a result of problems reported during the Beta test, the software developer makes the modifications and then prepares for release of the software to the customer.

Acceptance TestingAcceptance Testing is the system testing performed by the customer to whether or not of accept the delivery of the system.

7.3 TEST CASESA test case is a set of input data and an expected result that exercises the component with the purpose of causing failures and detecting faults. Test cases are classified into black box test and white box test. Black box test focus on input/output behavior of the component. White box

8.TECHNICAL NOTES8.1 Introduction to AJAX:Ajax, shorthand for Asynchronous JavaScript and XML, is a web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user makes a change. This is meant to increase the web page's interactivity, speed, and usability. 64

Prior to AJAX, any retrieval of data from the server required that the entire Web page be refreshed in the user's computer. As a result, systems were often designed with less interaction; for example, to have the user submit a form only at the end, after all fields were filled in. In contrast, AJAX systems can validate one or two items at a time "behind the scenes" without making the session cumbersome, especially over slow connections. AJAX, also known as "remote scripting," allows Web-based applications to be designed like LAN-based applications.

The Main Features of AJAX are: Mainly to build a fast, dynamic website, but also to save resources. For improving sharing of resources, it is better to use the power of all the client Ajax allows to perform processing on client computer (in JavaScript) with data The processing of web page formerly was only server-side, using web services or scripts, before the whole page was sent within the network. But Ajax can selectively modify a part of a page displayed by the browser, and update it without the need to reload the whole document with all images, menus,etc... For example, fields of forms, choices of user, may be processed and the result displayed immediately into the same page.

computers rather than just an unique server and network. taken from the server. Php

How does it work?

Instead of a user request being made of the server via, for example, a normal HTTP POST or GET request, such as would be made by submitting a form or clicking a hyperlink, an Ajax script makes a request of a server by using the JavaScript XMLHTTPRequest object. Although this object may be unfamiliar to many, in fact it behaves like a fairly ordinary JavaScript object. As you may well know, when using a JavaScript image object we may dynamically change the URL of the image source without using a page refresh. XMLHTTPRequest retrieves information from the server in a similarly invisible manner.

AJAX is a Browser TechnologyAJAX is a technology that runs in your browser. It uses asynchronous data transfer (HTTP requests) between the browser and the web server, allowing web pages to request small bits of information from the server instead of whole pages. The technology makes Internet 65

applications smaller, faster and more user friendly. AJAX is a web browser technology independent of web server software.

AJAX Is Based On Open StandardsAJAX is based on the following open standards: JavaScript XML HTML CSS The open standards used in AJAX are well defined, and supported by all major browsers. AJAX applications are browser and platform independent. (Cross-Platform, Cross-Browser technology)

AJAX Is About Better Internet Applications:Web applications have many benefits over desktop applications, they can reach a larger audience, they are easier to install and support, and easier to develop. However, Internet applications are not always as "rich" and user-friendly as traditional desktop applications. With AJAX, Internet applications can be made richer (smaller, faster, and easier to use).

AJAX Uses XML And HTTP Requests: A traditional web application will submit input (using an HTML form) to a web server. After the web server has processed the data, it will return a completely new web page to the user. Because the server returns a new web page each time the user submits input, traditional web applications often run slowly and tend to be less user friendly. With AJAX, web applications can send and retrieve data without reloading the whole web page. This is done by sending HTTP requests to the server (behind the scenes), and by modifying only parts of the web page using JavaScript when the server returns data. XML is commonly used as the format for receiving server data, although any format, including plain text, can be used.

Defining Ajax:

66

Ajax isnt a technology. Its really several technologies, each flourishing in its own right, coming together in powerful new ways. Ajax incorporates: Standards-based presentation using XHTML and CSS; Dynamic display and interaction using the Document Object Model; Data interchange and manipulation using XML and XSLT; Asynchronous data retrieval using XMLHttpRequest and JavaScript binding

The classic web application model works like this:Most user actions in the interface trigger an HTTP request back to a web server. The server does some processing retrieving data, crunching numbers, talking to various legacy systems and then returns an HTML page to the client. Its a model adapted from the Webs original use as a hypertext medium, but as fans of The Elements of User Experience know, what makes the Web good for hypertext doesnt necessarily make it good for software applications.

67

The traditional model for web applications (left) compared to the Ajax model (right).

This approach makes a lot of technical sense, but it doesnt make for a great user experience. While the server is doing its thing, whats the user doing? Thats right, waiting. And at every step in a task, the user waits some more. Obviously, if we were designing the Web from scratch for applications, we wouldnt make users wait around. Once an interface is loaded, why should the user interaction come to a halt every time the application needs something from the server? In fact, why should the user see the application go to the server at all?

How Ajax is Different:An Ajax application eliminates the start-stop-start-stop nature of interaction on the Web by introducing an intermediary an Ajax engine between the user and the server. It seems like adding a layer to the application would make it less responsive, but the opposite is

68

true. Instead of loading a web page, at the start of the session, the browser loads an Ajax engine written in JavaScript and usually tucked away in a hidden frame. This engine is responsible for both rendering the interface the user sees and communicating with the server on the users behalf. The Ajax engine allows the users interaction with the application to happen asynchronously independent of communication with the server. So the user is never staring at a blank browser window and an hourglass icon, waiting around for the server to do something.

Every user action that normally would generate an HTTP request takes the form of a JavaScript call to the Ajax engine instead. Any response to a user action that doesnt require a trip back to the server such as simple data validation, editing data in memory, and even some navigation the engine handles on its own. If the engine needs something from the server in order to respond if its submitting data for processing, loading additional interface code, or

69

retrieving new data the engine makes those requests asynchronously, usually using XML, without stalling a users interaction with the application.

AJAX Interaction:What makes AJAX-based clients unique is that the client contains page-specific control logic embedded as JavaScript technology. The page interacts with the JavaScript technology based on events such as the loading of a document, a mouse click, focus changes, or even a timer. AJAX interactions allow for a clear separation of presentation logic from the data. An HTML page can pull in bite-size pieces to be displayed. AJAX will require different serverside architecture to support this interaction model. Traditionally, server-side web applications have focused on generating HTML documents for every client event resulting in a call to the server. The clients would then refresh and re-render the complete HTML page for each response. Rich web applications focus on a client fetching an HTML document that acts as a template or container into which to inject content, based on client events using XML data retrieved from a server-side component. Some uses for AJAX interactions are the following: Real-time form data validation: Form data such as user IDs, serial numbers, postal codes, or even special coupon codes that require server-side validation can be validated in a form before the user submits a form. See Real-time Form Validation for details. Auto completion: A specific portion of form data such as an email address, name, or city name may be auto completed as the user types. Load on demand: Based on a client event, an HTML page can fetch more data in the background, allowing the browser to load pages more quickly. Sophisticated user interface controls and effects: Controls such as trees, menus, data tables, rich text editors, calendars, and progress bars allow for better user interaction and interaction with HTML pages, generally without requiring the user to reload the page.

Refreshing data and server push: HTML pages may poll data from a server for up-todate data such as scores, stock quotes, weather, or application-specific data. A client may use AJAX techniques to get a set of current data without reloading a full page. Polling is not the most efficient means of ensuring that data on a page is the most current. Emerging

70

techniques such as Comet are being developed to provide true server-side push over HTTP by keeping a persistent connection between the client and server. Partial submit: An HTML page can submit form data as needed without requiring a full page refresh. Mashups: An HTML page can obtain data using a server-side proxy or by including an external script to mix external data with your application's or your service's data. For example, you can mix content or data from a third-party application such as Google Maps with your own application. Page as an application: AJAX techniques can be made to create single-page applications that look and feel much like a desktop application. See the article on the use of AJAX and port lets for more on how you can use port let applications today. Though not all-inclusive, this list shows that AJAX interactions allow web applications to do much more than they have done in the past.

71

9.SCREENS Boundary Object for Login Form:

This form is the starting form of our application. A user enters his username and password and the role. If the user is identified as an administrator account holder then he will be navigated to the administrators welcome page. Else if he is a limited user, he will be navigated to the users home page.

72

Boundary object for User:

This form is the administrators welcome page. This is the main page of the administrator giving him options of generating orders, customer details, company details. Not only these, but also he is provided with a powerful feature which makes him the administrator.

73

Boundary Object for Chat Room:

74

Boundary Object for MusicChat Room:

75

Boundary Objects of Television

76

10.CONCLUSION

The main objective of the project is to build a nice multilevel, multiroom chat

application. By using ORACLE as back-end and HTML