Sie sind auf Seite 1von 41

ACKNOWLEDGEMENT I oblige to acknowledge my heartiest gratitude to all honourable people who helped me during my summer training at HP, Noida.

I would like to thank Mr. R.S Sharma officer of training for granting me the permission for doing my summer training at this project.

HARSHITA VERMA

Hewlett-Packard Company

Type

Public (NYSE: HPQ) Dow Jones Industrial Average Component Computer Systems Computer Peripherals

Industry

Computer Software IT consulting IT Services

Founded Founder(s) Headquarters Area served Key people

Palo Alto, California (1939) Bill Hewlett David Packard 3000 Hanover Street, Palo Alto, California, USA Worldwide Lo Apotheker
CEO

Computer Monitors Digital Cameras Enterprise Software Indigo Digital Press Mobile Phones Networking Products Personal Computers and Laptops Personal Digital Assistants Printers Scanners Servers Storage Televisions Telecommunications hardware and

software List of HP products Revenue $114.552 billion

Operating income $10.136 billion Net income Total assets Total equity Employees $7.660 billion $114.799 billion $40.517 billion 310,000 (after 3Com acquisition) Compaq Snapfish HP Labs ProCurve Subsidiaries HP Enterprise Services VoodooPC Palm, Inc. HP CDS List of acquisitions by HP Website HP.com

HP founders Bill Hewlett and David Packard

IDEA ABOUT HP
Hewlett-Packard Company (NYSE: HPQ), commonly referred to as HP, is an American multinational information technology corporation headquartered in Palo Alto, California, USA. The company was founded in a one-car garage in Palo Alto by Bill Hewlett and Dave Packard, and is now one of the world's largest information technology companies, operating in nearly every country. HP specializes in developing and manufacturing computing, data storage, and networking hardware, designing software and

delivering services. Major product lines include personal computing devices, enterprise servers, related storage devices, as well as a diverse range of printers and other imaging products. HP markets its products to households, small- to medium-sized businesses and enterprises directly as well as via online distribution, consumer-electronics and office-supply retailers, software partners and major technology vendors. HP's posted net revenue in 2009 was $115 billion, with approximately $40 billion coming from services. In 2006, the intense competition between HP and IBM tipped in HP's favor, with HP posting revenue of US$91.7 billion, compared to $91.4 billion for IBM; the gap between the companies widened to $21 billion in 2009. In 2007, HP's revenue was $104 billion, making HP the first IT company in history to report revenues exceeding $100 billion. In 2008 HP retained its global leadership position in inkjet, laser, large format and multi-function printers market, and its leadership position in the hardware industry. Also HP became #2 globally in IT services as reported by IDC & Gartner. Major company changes include a spin-off of part of its business as Agilent Technologies in 1999, its merger with Compaq in 2002, and the acquisition of EDS in 2008, which led to combined revenues of $118.4 billion in 2008 and a Fortune 500 ranking of 9 in 2009. In November 2009, HP announced the acquisition of 3Com; with the deal closing on April 12, 2010. On April 28, 2010, HP announced the buyout of Palm for $1.2 billion. On July 1, 2010, the acquisition of Palm was final. On September 2, 2010 won its bidding war for 3PAR with a $33 a share offer ($2.07 billion) which Dell declined to match. On August 6, 2010 CEO Mark Hurd resigned. Cathie Lesjak assumed the role interim CEO, and on September 30, 2010, Lo Apotheker became HP's

new permanent CEO and Ray Lane, Managing Partner at Kleiner Perkins Caufield & Byers, was elected to the position of non-executive Chairman. Both appointments are effective November 1, 2010.

Company history
Founding

Bill Hewlett and Dave Packard graduated in electrical engineering from Stanford University in 1935. The company originated in a garage in nearby Palo Alto during a fellowship they had with a past professor, Frederick Terman at Stanford during the Great Depression. Terman was considered a mentor to them in forming Hewlett-Packard. In 1939, Packard and Hewlett established Hewlett-Packard (HP) in Packard's garage with an initial capital investment of US$538. Hewlett and Packard tossed a coin to decide whether the company they founded would be called Hewlett-Packard or PackardHewlett Packard won the coin toss but named their electronics manufacturing enterprise the "Hewlett-Packard Company". HP incorporated on August 18, 1947, and went public on November 6, 1957. Of the many projects they worked on, their very first financially successful product was a precision audio oscillator, the Model HP200A. Their innovation was the use of a small light bulb as a temperature dependent resistor in a critical portion of the circuit. This allowed them to sell the Model 200A for $54.40 when competitors were selling less stable oscillators for over $200. The Model 200 series of generators continued until at least 1972 as the 200AB, still tube-based but improved in design through the years. At 33 years, it was perhaps the longest-selling basic electronic design of all time.

One of the company's earliest customers was The Walt Disney Company, which bought eight Model 200B oscillators (at $71.50 each) for use in certifying the Fantasound surround sound systems installed in theaters for the movie Fantasia.
Early years

The company was originally rather unfocused, working on a wide range of electronic products for industry and even agriculture. Eventually they elected to focus on high-quality electronic test and measurement equipment. From the 1940s until well into the 1990s the company concentrated on making electronic test equipment: signal generators, voltmeters, oscilloscopes, frequency counters, thermometers, time standards, wave analyzers, and many other instruments. A distinguishing feature was pushing the limits of measurement range and accuracy; many HP instruments were more sensitive, accurate, and precise than other comparable equipment. Following the pattern set by the company's first product, the 200A, test instruments were labelled with three to five digits followed by the letter "A". Improved versions went to suffixes "B" through "E". As the product range grew wider HP started using product designators starting with a letter for accessories, supplies, software, and components.
The 1960s

HP is recognized as the symbolic founder of Silicon Valley, although it did not actively investigate semiconductor devices until a few years after the "Traitorous Eight" had abandoned William Shockley to create Fairchild Semiconductor in 1957. Hewlett-Packard's HP Associates division, established around 1960, developed semiconductor devices primarily for

internal use. Instruments and calculators were some of the products using these devices. HP partnered in the 1960s with Sony and the Yokogawa Electric companies in Japan to develop several high-quality products. The products were not a huge success, as there were high costs in building HP-looking products in Japan. HP and Yokogawa formed a joint venture (Yokogawa-HewlettPackard) in 1963 to market HP products in Japan. HP bought Yokogawa Electric's share of Hewlett-Packard Japan in 1999. HP spun off a small company, Dynac, to specialize in digital equipment. The name was picked so that the HP logo "hp" could be turned upside down to be an reverse reflect image of the logo "dy" of the new company. Eventually Dynac changed to Dymec, then was folded back into HP in 1959. HP experimented with using Digital Equipment Corporation minicomputers with its instruments. But after deciding that it would be easier to build another small design team than deal with DEC, HP entered the computer market in 1966 with the HP 2100 / HP 1000 series of minicomputers. These had a simple accumulator-based design, with registers arranged somewhat similarly to the Intel x86 architecture still used today. The series was produced for 20 years, in spite of several attempts to replace it, and was a forerunner of the HP 9800 and HP 250 series of desktop and business computers.

The 1970s
The HP 3000 was an advanced stack-based design for a business computing server, later

redesigned with RISC technology, that has only recently been retired from the market. The HP 2640 series of smart and intelligent terminals introduced forms-based interfaces to ASCII terminals, and also introduced screen

labeled function keys, now commonly used on gas pumps and bank ATMs. The HP 2640 series included one of the first bit mapped graphics displays that when combined with the HP 2100 21MX F-Series microcoded Vector Instruction Set enabled the first commercial WYSIWYG Presentation Program, BRUNO that later became the program HP-Draw on the HP 3000. Although scoffed at in the formative days of computing, HP would eventually surpass even IBM as the world's largest technology vendor, in terms of sales.

"The new Hewlett-Packard 9100A personal computer is ready, willing, and able ... to relieve you of waiting to get on the big computer." HP is identified by Wired magazine as the producer of the world's first marketed, mass-produced personal computer, the Hewlett-Packard 9100A, introduced in 1968. HP called it a desktop calculator because, as Bill Hewlett said, "If we had called it a computer, it would have been rejected by our customers' computer gurus because it didn't look like an IBM. We therefore decided to call it a calculator, and all such nonsense disappeared." An engineering triumph at the time, the logic circuit was produced without any integrated circuits; the assembly of the CPU having been entirely executed in discrete components. With CRT display, magnetic-card storage, and printer, the price was around $5000. The machine's keyboard was a cross between that of a scientific calculator and an adding machine. There was no alphabetic keyboard.

Steve Wozniak, co-founder of Apple, originally designed the Apple I computer while working at HP and offered it to them under their right of first refusal to his work, but they did not take it up as the company wanted to stay in scientific, business, and industrial markets. The company earned global respect for a variety of products. They introduced the world's first handheld scientific electronic calculator in 1972 (the HP-35), the first handheld programmable in 1974 (the HP-65), the first alphanumeric, programmable, expandable in 1979 (the HP-41C), and the first symbolic and graphing calculator, the HP-28C. Like their scientific and business calculators, their oscilloscopes, logic analyzers, and other measurement instruments have a reputation for sturdiness and usability (the latter products are now part of spin-off Agilent's product line). The company's design philosophy in this period was summarized as "design for the guy at the next bench". The 98x5 series of technical desktop computers started in 1975 with the 9815, and the cheaper 80 series, again of technical computers, started in 1979 with the 85. These machines used a version of the BASIC programming language which was available immediately after they were switched on, and used a proprietary magnetic tape for storage. HP computers were similar in capabilities to the much later IBM Personal Computer, although the limitations of available technology forced prices to be high.

The 1980s

The garage in Palo Alto where Hewlett and Packard began their company In 1984, HP introduced both inkjet and laser printers for the desktop. Along with its scanner product line, these have later been developed into successful multifunction products, the most significant being single-unit printer/scanner/copier/fax machines. The print mechanisms in HP's tremendously popular LaserJet line of laser printers depend almost entirely on Canon's components (print engines), which in turn use technology developed by Xerox. HP develops the hardware, firmware, and software that convert data into dots for the mechanism to print. On March 3, 1986, HP registered the HP.com domain name, making it the ninth Internet .com domain ever to be registered. In 1987, the Palo Alto garage where Hewlett and Packard started their business was designated as a California State historical landmark.
The 1990s

Hewlett-Packard logo used until 2008

In the 1990s, HP expanded their computer product line, which initially had been targeted at university, research, and business users, to reach consumers. HP also grew through acquisitions, buying Apollo Computer in 1989 and Convex Computer in 1995. Later in the decade, HP opened hpshopping.com as an independent subsidiary to sell online, direct to consumers; in 2005, the store was renamed "HP Home & Home Office Store." From 1995 to 1998, Hewlett-Packard were sponsors of the English football team Tottenham Hotspur. In 1999, all of the businesses not related to computers, storage, and imaging were spun off from HP to form Agilent. Agilent's spin-off was the largest initial public offering in the history of Silicon Valley. The spin-off created an $8 billion company with about 30,000 employees, manufacturing scientific instruments, semiconductors, optical networking devices, and electronic test equipment for telecom and wireless R&D and production. In July 1999, HP appointed Carly Fiorina as CEO, the first female CEO of a company in the Dow Jones Industrial Average. Fiorina served as CEO during the tech downturn of the early 2000s. During her tenure, the market value of HP halved and the company incurred heavy job losses. The HP Board of Directors asked Fiorina to step down in 2005, and she resigned on February 9, 2005.

The 2000s

The current two dimensional HP logo used on corporate documents, letterheads, etc.

HP's recent campaign, The Computer is Personal Again, features several celebrity endorsements, including a TV commercial with Gwen Stefani. On September 3, 2001, HP announced that an agreement had been reached with Compaq to merge the two companies. In May, 2002, after passing a shareholder vote, HP officially merged with Compaq. Prior to this, plans had been in place to consolidate the companies' product teams and product lines. The merger occurred after a proxy fight with Bill Hewlett's son Walter, who objected to the merger. Compaq itself had bought Tandem Computers in 1997 (which had been started by ex-HP employees), and Digital Equipment Corporation in 1998. Following this strategy, HP became a major player in desktops, laptops, and servers for many different markets. After the merger with Compaq, the new ticker symbol became "HPQ", a combination of the two previous symbols, "HWP" and "CPQ", to show the significance of the alliance and also key letters from the two companies Hewlett-Packard and Compaq (the latter company being famous for its "Q" logo on all of its products.)

In the year 2004 HP released the DV 1000 Series, including the HP Pavilion dv 1658 and 1040 two years later in May 2006, HP began its campaign, The Computer is Personal Again. The campaign was designed to bring back the fact that the PC is a personal product. The campaign utilized viral marketing, sophisticated visuals, and its own web site (www.hp.com/personal). Some of the ads featured well-known personalities, including Pharrell, Petra Nemcova, Mark Burnett, Mark Cuban, Jay-Z, Gwen Stefani, and Shaun White. On May 13, 2008, HP and Electronic Data Systems announced that they had signed a definitive agreement under which HP would purchase EDS. On June 30, HP announced that the waiting period under the Hart-Scott-Rodino Antitrust Improvements Act of 1976 had expired. "The transaction still requires EDS stockholder approval and regulatory clearance from the European Commission and other non-U.S. jurisdictions and is subject to the satisfaction or waiver of the other closing conditions specified in the merger agreement." The agreement was finalized on August 26, 2008, and it was publicly announced that EDS would be re-branded "EDS an HP company." As of September 23, 2009, EDS is known as HP Enterprise Services. On November 11, 2009, 3Com and Hewlett-Packard announced that Hewlett-Packard would be acquiring 3Com for $2.7 billion in cash.[31] The acquisition is one of the biggest in size among a series of takeovers and acquisitions by technology giants to push their way to become one-stop shops. Since the beginning of the financial crisis in 2007, tech giants have constantly felt the pressure to expand beyond their current market niches. Dell purchased Perot Systems recently to invade into the technology consulting business area previously dominated by IBM. Hewlett-Packard's latest move marked its incursion into enterprise networking gear market dominated by Cisco.

The 2010s

On April 28, 2010, Palm, Inc. and Hewlett-Packard announced that HP would be acquiring Palm for 1.2 billion in cash and debt, the deal officially closed on July 1, 2010. In the months leading up to the buyout it was rumored that Palm was going to be purchased by either HTC, Dell, RIM or HP. The addition of Palm handsets to the HP product line provides some overlap with the current iPAQ mobile products but will significantly increase their mobile presence as those devices have not been selling well. The addition of Palm brings HP a library of valuable patents as well the mobile operating platform known as webOS. On July 1, 2010, the acquisition of Palm was final. On September 2, 2010 won its bidding war for 3PAR with a $33 a share offer ($2.07 billion) which Dell declined to match. On August 6, 2010 CEO Mark Hurd resigned amid controversy and CFO Cathie Lesjak assumed the role of interim CEO. On September 30, 2010, Lo Apotheker was named as HP's new CEO and President. Apothekers appointment sparked a strong reaction from Oracle chief executive Larry Ellison, who complained that Apotheker had been in charge of SAP when one of its subsidiaries was systematically stealing software from Oracle. SAP accepted that its subsidiary, which has now closed, illegally accessed Oracle intellectual property.

Facilities
The main entrance to Hewlett-Packard corporate headquarters in Palo Alto, California HP's global operations are directed from its headquarters in Palo Alto, California, USA. Its U.S. operations are directed from its facility in Houston, Texas, USA, the site originally belonging to Compaq, which it acquired.

Latin America operations are directed from Miami, Florida, USA, European operations from Geneva, Switzerland, and Asia-Pacific operations from Singapore. It also has large operations in Boise, Idaho, Roseville, California, San Diego, California, and Plano, Texas (the former headquarters of EDS, which HP acquired).

Products and organizational structure


HP has successful lines of printers, scanners, digital cameras, calculators, PDAs, servers, workstation computers, and computers for home and small business use computers; many of the computers came from the 2002 merger with Compaq. HP today promotes itself as supplying not just hardware and software, but also a full range of services to design, implement, and support IT infrastructure. HP's Imaging and Printing Group (IPG) is "the leading imaging and printing systems provider in the world for printer hardware, printing supplies and scanning devices, providing solutions across customer segments from individual consumers to small and medium businesses to large enterprises." Products and technology associated with IPG include Inkjet and LaserJet printers, consumables and related products, Officejet all-in-one multifunction printer/scanner/faxes, Large Format Printers, Indigo Digital Press, HP Web Jetadmin printer management software, HP Output Management suite of software, LightScribe optical recording technology, HP Photosmart digital cameras and photo printers, HP SPaM, and Snapfish by HP, a photo sharing and photo products service. On December 23, 2008, HP released iPrint Photo for iPhone a free downloadable software application that allows the printing of 4" x 6" photos. HP's Personal Systems Group (PSG) claims to be "one of the leading vendors of personal computers ("PCs") in the world based on unit volume

shipped and annual revenue." PSG includes business PCs and accessories, consumer PCs and accessories, (e.g., HP Pavilion, Compaq Presario, VoodooPC), handheld computing (e.g., iPAQ Pocket PC), and digital "connected" entertainment (e.g., HP MediaSmart TVs, HP MediaSmart Servers, HP MediaVaults, DVD+RW drives). HP resold the Apple iPod until November 2005. HP Enterprise Business (EB) incorporates Technical services, Enterprise Services (formerly known as EDS), HP Software & Solutions, and Enterprise Servers, Storage and Networking Group (ESSN). The Enterprise Servers, Storage and Networking Group (ESSN) oversees "back end" products like storage and servers. HP's networking business unit ProCurve is responsible for the family of network switches, wireless access points, and routers. They are currently a business unit of ESSN. HP Software & Solutions is the company's enterprise software division. For years, HP has produced and marketed its brand of enterprise management software, HP OpenView. HP has purchased a total of 12 software companies as part of a publicized, deliberate strategy to augment its software offerings for large business customers. The division markets its software in four categories: HP IT Management Software (also known as business technology optimization software), HP Information Management Software, business intelligence solutions, and communications and media software and solutions.

A Project on

Intranet Chat Client / Server

Objective of the Project


This is a chat Client / Server model which can be used for chatting over internet. This model could be used in the schools or in the organizations where students, teachers or employees could chat with each other. Moreover, they can have discussions with each other without leaving their seats and that obviously saves time.

In this model I will make two class files. One of them will act as a server file which will be responsible for the connection establishment with the specified port number. This file will be saved as ChatServer.java. The other class file that I will create will be responsible for the creating the GUI window interface, through which two or more clients can chat with each other simulteneously.

In this application, the user will have to select the name of a particular person, from a list displayed in the window, with which he or she wants to chat with.

Project Specifications

Project Category This project can be placed in the category of a Network Application that works in a Local Area Network.

Tools and Environment (Platform & Language) to be used Language used for this application is JAVA 2. It is an Object Oriented language. It is platform independent and best suited for the Internet. As this is a Chat Client Server application, so different users might run this application on different platforms, because JAVA, unlike C and C++, is a platform independent language. It could be run on any kind of platform. Here we have used JAVAs built-in classes with which the code becomes very compact and easy to be understood. Due to its feature of inheritance, it becomes easy to develop the applications.

There are number of built-in classes in JAVA which do the specific work and therefore we dont need to write the whole code by ourselves. We only have to inherit those classes and everything will be done. JAVA is also considered to be the safe language over the net.

JAVA is a platform independent language i.e., it could be run on any kind of platform. In this application one can not tell before hand that which client will be using what platform. So with JAVA being platform independent language it becomes quite simple. Unlike any other programming language JAVA produces the byte codes. This code can be interpreted on any system that have a JAVA

Virtual Machine environment installed, which enables JAVA to create crossplatform programs.

JAVA is designed for the distributed environment of the internet, because it handles TCP/IP protocol. It is also very robust because, the programmer does not have to worry about the memory allocation or memory deallocation, that is automatically done by the JAVA Runtime Environment (JRE). Exceptions and errors are also handled by the JRE.

Platform used to make this application is JAVA Runtime Environment. To run this application we use Java Virtual Machine.

Scope of Future Application


Chatting in the present scenario is a very popular task. A person sitting in India can chat with other person sitting anywhere in the world.

Via internet at a very nominal cost. In a small Intranet one can use this application via local aea network and can communicate with each other. This can reduce the expense of using the telephone. In addition to this, if the feature of voice communication is added to this application, it could become very cheap (in terms of cost) way of communication.

Further, this application can be modified to be compared with the other chat client models which are present in the market. Moreover, it could also be improved to support the transfer of the text or graphics files. This could be done by using the classes of advance JAVA.

This application can be further improved for the purpose of private chatting, in which the message sent by one client will not be displayed on the other clients window. One more feature can be added to this application, that is to accept new users at the run time. Then the new user will be given a kind of password so that in future if that client wants to chat then the application will ask for the password to check the authentication of the user.

With the help of RMI (Advance JAVA), this code could be further improved so that it could be used over internet for the same purpose.

System Analysis

The Process Logic


The Chat Client / Server process is initiated by a user on the intranet or local area network. The user first sends a login request to be connected with the specified terminal address to which the user wants to be connected to for chatting.

Validation Check The Chat Client / Server process first checks the validity of the login and if it is found to be valid then the number of already logged-in users. If this number exceeds the limit of 20, it denies the login request; otherwise it looks for the specified destination port whether it is free or not. If everything goes right, a session between the sender of login request and the destination port user is started for chatting.

Feasibility Study
This project is worth implementing because of many point of views; technical, economical as well as operational. As we know that chatting is gaining popularity day by day not only for the purpose of time passing, an entertainment but for the sake of professional use also. Since it can be used at the places where it is not possible for the users at different locations to meet frequently and talk time to time as and whenever required. At such times chatting proves to be very much useful and important. Now let us see how feasible is the implementaion of the chat client server project.

Technical Feasibility As far as an organization is concerned, we know that it is not possible for all the employees or the users to interact physically with each other to discuss technical or other matters. Moreover, if it is possible too, then it is very time consuming to arrange the meetings and organize each and every thing formally. In such situations it is very feasible technically to chat with the desired person only and at the specific tpoic only. There mey be some misuses but thats part of life.

Echonomic Feasiblity

Whenever anything is planned to be developed, the first question, that arises in the minds of the project leaders as well as the programmers, is that if it is worth developing the project. If it is so, how much time, money and labour is required for the implementation of the project. Labour indicates the manpower involved in the development process of the project. Apart from the cost of the project, it is also sought that if it will be able to gain some profit or not. Because nobody will be desirous to develop the project if there is no benefit promised. This aspect of feasibility study also helps the cost estimation of the project and is a vital part of the feasibility report. This feasibility report is produced by the system analyst before the management committee so that they can decide whether to proceed or not to proceed towards the development process of the project. If this phase is passed, a major hurdle is cleared. Because this phase give the green signal for the design phase.

Operational Feasibility As we know that chatting provides us an easy way to communicate between two persons, it also saves the time from many point of views. First of all, when anything has to be discussed among some persons, it is not always possible to arrange time specifically for the same due to their respectibe busy schedules.

Secondly, we dont have to leave our desks while chatting, but in most of the cases we can continue woorking on our system at the same time while we are chatting with the other users.

Thirdly, chatting can also avail the status of the users that are available when we are also free or can spare time to discuss the matters.

Thus we can see that the project on the chat client / server is feasible to be developed from the operational point of view too.

Context Data Flow Diagram ( 0 Level DFD )

Detailed Data Flow Diagram

Modulewise Functionality
1. Connection Establishment Process
This process recieves the connect request from user with his/hers loginidentification and destination machines port number. The process then forwards these input parameters to the process 2 (chat client server process) to check whether the specified user is valid and destination port is available. Whatever is the response of chat client /server process, the user is informed about the connection status accordingly.

2. Create Chat Client / Server Process


This process gets two input parameters from process-1 (connection

establishment process) and then the process checks the source machines loginid validity and looks for the availability of the destination machines part. After the source login is verified, the process checks whether the spscified destination port is free or not and if the no. of already logged in users for chatting has become 20 or not. If the port is free and no. of logged in users is less than 20 then only a new connection is initialized or not. The process-1 gets the response accordingly. After that this process sends a call to the third process to launch the frame.

3. Launch Frame Method


This process creates a window with two buttons visible called send & close. The whole window is visible over the terminal of the user who has initiated the connection and his/her request is granted.

The user types the text and then he/she has to press any of the two visible buttons within the window. As soon as any one of the buttons is selected the Action Listener Widget (process 4) gets the appropriate control signal so that process can decide what to do next.

4. Action Listner Widget


This process gets either send or close request from the process 3. Whatever the user selects the window listner process gets either the text sent from the process 3 or the close message which is then visible in the second window.

5. Window Listner
This window listner process gets the text being typed in the launched frame for chatting as soon as the ENTER KEY is pressed after typing the text or Send button is pressed.The text typed there is copied to the window listener and if the user sending the text selects Close button the user on the other side is informed by a close dialog box, that the session has been terminated.

Introduction to Proejct
In todays world of Internet chatting is one of the most common work which a person does on net. May it is a teenager or a professional everyone may be because of fun or some official work indulge himself/herself in chatting. So, my objective here is to develop a chat client and a chat server. Which would be easy to use . In chat client we will create a GUI based chat room for a particular company in which employees can logon and send messages to another person with chat ID in the chat room via the chat server. With this it becomes easy and time saving for them to exchange their views. This becomes as easy as talking to each other.

Tools Used and Environment


Language used for this application is JAVA 2. It is an Object Oriented language. It is platform independent and best suited for the Internet. As this is a Chat Client server application so different users might run this application different platforms, So JAVA unlike C and c++ is platform independent. It could be run on any kind of platform. Here the we have used JAVAs built in classes with which the code becomes very compact and easy to understand .because of its inheritance feature it becomes easy to develop the applications. There are number of built in classes in JAVA which do the specific work we do not have to write the code by ourselves. We only have to inherit those classes and everything will be done. JAVA is also considered to be the safe language over the net. JAVA is a platform independent language i.e., it could be run on any kind of platform .In this application one can not tell before hand that which client will be using what platform. So with JAVA it becomes simple ,JAVA being platform independent language .Unlike any other programming language JAVA produces the byte codes. This code can be interpreted on any system that provides a JAVA Virtual Machine which enables JAVA to create cross-platform programs. JAVA is designed for the distributed environment of the internet, because it handles TCP/IP protocols. It is also very robust because in this programmer does not have to worry about the memory allocation or memory release, that is done by the JRE .Exceptions and errors are also handled by the JAVA run time environment. Platform used to make this application is Java Runtime Environment. To run this application we use Java Virtual Machine.

Analyses and Design Report


Client Server(GUI window) We will create a class called ChatClient that implements the following GUI design: As you can see, there are four components in this GUI. The main component is a TextArea. The bottom component is a TextField. There are two Button components on the right. You will need to refer to Appendix C in the textbook for instructions on how to use the text components. 1. Create the ChatClient class with four private attributes; one for each component. In the constructor, initialize each of these component attributes: the text area should be 10 rows tall and 50 columns wide, the text field should be 50 columns wide, the send button should have the word "send" in the display, and likewise for the quit button. 2. Create a launchFrame method which constructs the layout of the components. Feel free to use nested panels and any layout managers that will help you construct the layout in the GUI design shown above. 3. Create the main method. This method will instantiate a new ChatClient object and then call the launchFrame method. First of all we will have to be clear about the outlook of the client window. For this GUI window we will need one text field where the user will type the text which the user will want to send to the other end .Then we will need one text

area where the output i.e., the text send or received will be displayed. Then we will need two buttons one will be labeled as send and other as quit. To let these function work we will be using event handling for the process: 1. Create an ActionListener which will copy the text from the input textfield into the output textarea when the send button is pressed. Use an inner class to implement this because you will need access to the ChatClient's private attributes. 2. Create an ActionListener which will quit the program when the quit button is pressed. 3. Create a WindowListener which will quit the program when the close widget is pressed on the frame. 4. Create an ActionListener which will copy the text from the input textfield into the output textarea when the <Enter> key is pressed in the input textfield. 5. Modify the launchFrame method to add instances of your listeners to the appropriate components. Point to be taken care of while handling events: Have the listeners (inner classes) access the instance variables of their containing class to refer to the components like the output textarea and the input textfield. Remember that you made the components instance variables in the previous lab. Also, don't forget to import the java.awt.event.* package.

To get the text from a TextArea or TextField you can use the getText method; to set the text use setText or append.

The function of the send button will be to send the text from the text field to the text area of all the visible GUI windows of all the clients .If the client wishes to end the chatting then he will press the quit button which will close the GUI window .There are also two menu items which will be displayed on the menu bar. Then we will have to think about the placing of all the components on to the window . For that we will use panels which will be placed on to the layout of type Gridlayout. Text field will be placed at the south of the layout , text area will be placed to the center of the layout, then we will make one panel which will contain two buttons and a choicebox in a flowlayout fashion ,then this panel will be further placed on to the right of gridlayout. Chat Client Server Here we will finish the "Chat Room" client program. This client will connect to "Chat Server" so that the client is able to chat with the other clients. 1. To make this application In the launchFrame method, we need to make the connection to the server (by making a socket connection). 2. Then we need to get streams (input and output) from the socket connection so that we can send our messages to the server, and receive other

messages from the server.

3. We also need a RemoteReader -- a runnable object -- which can be run by a thread and continually listen for input on the input stream which we get from the socket. 4. Then we need to modify the actionPerformed method so that when the user clicks the "send" button you send the text of the message to the server (using the output stream) rather than putting it into the text area. 5. We also need to modify the action listener on the "input" text field to do the same as above (send the message to the server). 6. We also need to have the RemoteReader object to put the incoming

messages into the text area.

Basic Requirements
Here we need to declare Instance variables for input and output streams and the socket. We should not make these as the local variables. It should be like this : Socket connection; PrintStream serverOut; BufferedReader serverIn; 1. Then the RemoteReader implementing the class. 2. Put all the connection code (and get the streams) in the launchFrame method. 3. Instantiate RemoteReader (RemoteReader r = new RemoteReader();) in your launchFrame method, then instantiate a Thread object using r as the runnable target. 4. Start the thread for the RemoteReader (t.start();) as the last thing you do before making your Frame visible. 5. Don't forget you are using two new packages java.io and java.net. 6. Your RemoteReaders should have a run method which runs in a while(true) loop. 7. Don't forget to surround your risky code (like anything connected with reading, sockets, etc.) in a try/catch block! Runnable should be an inner

Software Engineering Pardigm Applied


The incremental model combines elements of the linear sequential model with the iterative philosophy of prototyping. The incremental model applies linear sequences in a staggered fashion as calendar time progresses. Each linear sequence produces a deliverable increment of the software. For example, word-processing software developed using the incremental paradigm might deliver basic file management, editing, and document production functions in the first increment; more sophisticated editing and document production capabilities in the second increment; spelling and grammer checking in the third increment; and advancedpage layout capability in the fourth increment. It should be noted that the process flow for any increment can incorporate the prototyping paradigm. When an incremental model is used, the first increment is often a core product.That is, basic requirements are addressed, but many supplementary features remain undelivered. The core product is used by the customer. As a result of use and/or evalution, a plan is developed for the next increment. The plan addresses the modification of the core product to better meet the needs of the customer and the delivery od additional features and functionality. This process is repeated following the delivery of each increment, until the complete product is produced. The incremental process model, like prototyping and other evolutionary approaches, is iterative in nature. But unlike prototyping, the incremental model focuses on the deivery of an operational product with each increment. Early increments are stripped down versions of the final product, but they do provide

capability that serves the user and also provide a platform for evalution by the user. Incremental development is particularly useful when staffing is unavailable for a complete implementation by the business deadline that has been established for the project. Early increments can be implemented with fewer people. If the core product is well received, then received, then additional staff can be added to implement the next increment. In addition, increments can be planned to manage technical risks. For example, a major system might require the availability of new hardware that is under development and whose delivery date is uncertain. It might be possible to plan early increments in a way that avoids the use of this hardware, thereby enabling partial functionality to be delivered to end-users without inordinate delay.

Implementation
How to make the class 1. How to make a socket: connection = new Socket(hostnameOrIP,portNum); Example: connection = new Socket("127.0.0.1",2000); 2. How to get streams from the socket: serverIn = new BufferedReader(new

InputStreamReader(connection.getInputStream())); serverOut = new PrintStream(connection.getOutputStream()); 3. How to write to a PrintStream (a type of output stream) serverOut.println("Yippy Skippy"); 4. How to read from a BufferedReader: String aLine = serverIn.readLine(); // This blocks until there is something to read.

General format of the class


// Here we have to import number of statements public class ChatClient { // lots of instance variables for send button, socket, streams, etc. public ChatClient() { // initialize GUI components and other data } public void launchFrame() { // make the GUI // establish socket connection // make a thread and start it with an instance of RemoteReader // create/instantiate the streams from the socket connection // show the gui } // the inner class listening for the send button private class SendListener implements ActionListener { public void actionPerformed(ActionEvent e) {

// get info from text field // send it to the server using the printstream object // clear the text field } } // an inner class to listen to server private class RemoteReader implements Runnable { public void run() { try { while(true) { // do stuff here to continuously read from the server using the // input stream you made // put the received text into the text area } } } }

public static void main(String[] args) { // create an instance of ChatClient // call the launchFrame method } }

Das könnte Ihnen auch gefallen