Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

Chapter 1. Advanced Java > A First Look at Java Networking in Action - Pg. 27

Advanced Java 27 With several of the major benefits of the Java language under our belt, we can turn to finally devel- oping a networked application. Our networked applications will use many of the techniques we have discussed thus far, as well as several more we will introduce along the way. Congratulations! Your first foray into Java networking is about to begin. A First Look at Java Networking in Action So far you have learned the three basic things you need to know in order to write networked appli- cations in Java: · Object-oriented design · Input and output fundamentals · Threading A good object-oriented design will allow you great flexibility in creating clients and servers. You can extend the functionality of a well-designed class very easily. You can either alter the nuances of the class's architecture in order to facilitate the kind of communication you desire or publish your class to the "world" so that it can be used as it was intended to be used. Solid input and output fundamentals enable your classes to process data quickly and efficiently. With a strong I/O functionality, your classes can accept, manipulate, and return data without much hassle. And once again, you can publish your class to the "world," specifying exactly which data you will accept and streamlining the processing power of your objects. Effective threading principles will enable your class to produce fast turnaround times on object re- quests (those methods invoked upon your object), make good use of system resources, and begin to create an entire collection of objects that work together without affecting system performance. Figure 1-12 illustrates how a server can effectively handle information by spawning threads to proc- ess that information. Figure 1-12. Threading can prevent servers from being bogged down. Good networked applications have three things in common: · Useful interface definitions · Pragmatic data definitions · Efficient processing of data