Benefit Based Data Caching in Ad Hoc Networks
1. INTRODUCTION
AD hoc networks are
multi hop wireless networks of small computing devices with wireless
interfaces. The computing devices could be conventional computers (for example,
PDA, laptop, or PC) or backbone routing plat forms or even embedded processors
such as sensor nodes. The problem of optimal placement of caches to reduce
overall cost of accessing data is motivated by the following two defining
characteristics of ad hoc networks.
First, the ad hoc
networks are multi hop networks without a central base station. Thus, remote
access of information typically occurs via multi hop routing, which can greatly
benefit from Caching to reduce access latency. Second, the network is generally
resource constrained in terms of channel bandwidth or battery power in the
nodes. Caching helps in reducing communication, which results in savings in
bandwidth, as well as battery energy. The problem of cache placement is
particularly challenging when each network node has a limited memory to cache
data items.
In this paper, our
focus is on developing efficient caching techniques in ad hoc networks with
memory limitations. Research into data storage, access, and dissemination techniques
in ad hoc networks is not new. In particular, these mechanisms have been investigated
in connection with sensor networking [14], [26], peer-to-peer networks [1] [18],
mesh networks [17], world wide Web [25], and even more general ad hoc networks
[12], [33]. However, the presented approaches have so far been somewhat “ad
hoc” and empirically based, without any strong analytical foundation. In
contrast, the theory literature abounds in analytical studies into the
optimality properties of caching and replica allocation problems (see, for
example, [3]).
However, distributed
implementations of these techniques and their performances in complex network
settings have not been investigated. It is even unclear whether these techniques
are amenable to efficient distributed implementations. Our goal in this paper
is to develop an approach that is both analytically tractable with a provable
performance bound in a centralized setting and is also amenable to a natural
distributed implementation. In our network model, there are multiple data
items; each data item has a server, and a set of clients that wish to access
the data item at a given frequency.
Each node carefully
chooses data items to cache in its limited memory to minimize the overall
access cost. Essentially, in this article, we develop efficient strategies to
select data items to cache at each node. In particular, we develop two
algorithms a centralized approximation algorithm, which delivers a
4-approximation (2-approximation for uniform size data items) solution, and a
localized distributed algorithm, which is based on the approximation algorithm and
can handle mobility of nodes and dynamic traffic conditions. Using simulations,
we show that the distributed algorithm performs very close to the approximation
algorithm. Finally, we show through extensive experiments on ns2 [10] that our proposed distributed algorithm
performs much better than a prior approach over a broad range of parameter
values. Ours is the first work to present a distributed implementation based on
an approximation algorithm for the general problem of cache placement of
2. Modules Analyzed
According to the analysis three
modules has been traced out in the design of work. The modules are as follows.
·
Self-Organizing
·
Self-Addressing
·
Self-Routing
·
Delete
the path update table in each node
3.
Proposed System
·
Each
node cache the items most frequently accessed by itself.
·
Eliminate
replications among neighboring nodes
·
Creation
of stable groups to gather neighborhood inform and determine caching
placements.
·
Each
node act as a server
·
Server
maintains nearest cache node and
·
Server
nearest cache node by using routing protocol
·
First
save data item on local space
·
IF
any other items are exist that will be replace.
5.1 Software requirements:
·
Operating
System: windows 2000/NT
·
Development
Kit: J2SE 5.0
·
RDBMS:
MS Access
5.2 Hardware requirements:
·
Hard
Disk: 256 MB
·
Process: Pentium IV
·
Memory
Storage: 40 GB
6. DESIGN ANALYSIS
6.1 SYSTEM DESIGN
Data Flow Diagrams
(DFD):
The data flow diagram (DFD) is one of the most
important modeling tools. It is used to model the system components. These
components are the system process, the data used by the process, an external
entity that interacts with the system and the information flows in the system.
DFD shows how the information moves through the
system and how it is modified by a series of transformations. It is a graphical
technique that depicts information flow and the transformations that are
applied as data moves from input to output.
DFD is also known as bubble chart. A DFD may be
used to represent a system at any level of abstraction. DFD maybe partitioned
into levels that represent increasing information flow and functional detail.
A level 0 DFD, also called as the context level
diagram, represents the entire system as a single module with input and output
data indicated by incoming outgoing arrows respectively. Additional process and
information flow paths are represented as the level 0 DFD is portioned to
reveal more details. The context level diagram for the proposed system is shown
in the fig.
A level 1 DFD, also called as top-level DFD,
represent the system with major modules and data stores. The other levels will
show each module in the top-level DFD in more detailed fashion. The top-level
and other level DFD s for the proposed systems are shown next.
To context a data flow diagram four basic
symbols are used. They are given below.
6.3 Unified Modeling Language (UML):
UML is a method for describing the
system architecture in detail using the blueprint. UML represents a collection
of best engineering practices that have proven successful in the modeling of
large and complex systems. The UML is a very important part of developing
objects oriented software and the software development process. The UML uses
mostly graphical notations to express the design of software projects. Using
the UML helps project teams communicate, explore potential designs, and
validate the architectural design of the software
Definition:
UML is a general-purpose visual modeling
language that is used to specify, visualize, construct, and document the
artifacts of the software system.
UML is a language:
It will provide vocabulary and rules for
communications and function on conceptual and physical representation. So it is
modeling language.
UML Specifying:
Specifying means building models that are
precise, unambiguous and complete. In particular, the UML address the
specification of all the important analysis, design and implementation
decisions that must be made in developing and displaying a software intensive
system.
UML Visualization:
The UML includes both graphical and textual
representation. It makes easy to visualize the system and for better
understanding.
UML Constructing:
UML
models can be directly connected to a variety of programming languages and it
is sufficiently expressive and free from any ambiguity to permit the direct
execution of models.
UML Documenting:
UML
provides variety of documents in addition raw executable codes.
Goal of UML:
The
primary goals in the design of the UML were:
·
Provide
users with a ready-to-use, expressive visual modeling language so they can develop
and exchange meaningful models.
·
Provide
extensibility and specialization mechanisms to extend the core concepts.
·
Be
independent of particular programming languages and development processes.
·
Provide
a formal basis for understanding the modeling language.
·
Encourage
the growth of the OO tools market.
·
Support
higher-level development concepts such as collaborations, frameworks, patterns
and components.
·
Integrate
best practices.
Uses of UML
The UML is intended primarily for
software intensive systems. It has been used effectively for such domain as
·
·
Banking
and Financial Services
·
Telecommunications
·
Transportation
·
Defense/Aerospace
·
Retails
·
Medical
Electronics
·
Scientific
Fields
·
Distributed
Web
Rules of UML
The
UML has semantic rules for
·
NAMES:
It will call things, relationships and diagrams.
·
SCOPE:
The content that gives specific meaning to a name.
·
VISIBILITY:
How those names can be seen and used by others.
·
INTEGRITY:
How things properly and consistently relate to another.
·
EXECUTION:
What it means is to run or simulate a dynamic model.
Building blocks of UML
The
vocabulary of the UML encompasses 3 kinds of building blocks
1. Things
2. Relationships
3. Diagrams
Things:
Things are the data
abstractions that are first class citizens in a model. Things are of 4 types
·
Structural
Things
·
Behavioral
Things
·
Grouping
Things
·
Annotational
Things
Relationships:
Relationships tie the
things together. Relationships in the UML are
·
Dependency
·
Association
·
Generalization
·
Specialization
UML Diagrams:
A diagram is
the graphical presentation of a set of elements, most often rendered as a
connected graph of vertices (things) and arcs (relationships).
There are
two types of diagrams, they are:
·
STRUCTURAL DIAGRAMS
·
BEHAVIORAL DIAGRAMS
STRUCTURAL DIAGRAMS:-
The UML‘s four
structural diagrams exist to visualize, specify, construct and document the
static aspects of a system. we can View the static parts of a system using one
of the following diagrams.
Structural diagrams
consists of
·
Class
Diagram
·
Object
Diagram
·
Component
Diagram
·
Deployment
Diagram
BEHAVIORAL DIAGRAMS :
The UML’s five
behavioral diagrams are used to visualize, specify, construct, and document the
dynamic aspects of a system. The UML’s behavioral diagrams are roughly
organized around the major ways which can model the dynamics of a system.
Behavioral diagrams
consists of
·
Use
case Diagram
·
Sequence
Diagram
·
Collaboration
Diagram
·
State
chart Diagram
·
Activity
Diagram
6.4
UML Diagrams
Class Diagram:
A class diagram is a type of
static structure diagram that describes the structure of a system by showing
the system's classes, their attributes, and the relationships between the
classes.
·
Class: Class is a description
of a set of objects that share the same attributes, operations, relationships
and semantics. A class implements one or more interfaces.
·
Interface: Interface is a
collection of operations that specify a service of a class or component. An
interface describes the externally visible behavior of that element. An
interface might represent the complete behavior of a class or component.
·
Collaboration: Collaboration
defines an interaction and is a society of roles and other elements that work
together to provide some cooperative behavior. So collaborations have
structural as well as behavioral, dimensions. These collaborations represent
the implementation of patterns that make up a system.
Relationships such as
·
Dependency: Dependency is a semantic
relationship between two things in which a change to one thing may affect the
semantics of the other thing.
·
Generalization: A generalization is a
specialization / generalization relationship in which objects of the
specialized element (child) are substitutable for objects of the generalized
element (parent).
·
Association: An association is a
structural relationship that describes a set of links, a link being a
connection among objects. Aggregation is a special kind of association,
representing a structural relationship between a whole and its parts.
A Use case diagram shows a set of use
cases and actors and their relationships. Use case diagrams address the static
Use case view of a system. These diagrams are especially important in
organizing and modeling the behaviors of a system. Use case diagram consists of
Use case, actors, and the relationships between them.
·
Use case: Use case is a description of set of sequence of actions that
a system performs that yields an observable result of value to a particular
actor. A use case is used to structure the behavioral things in a model. A use
case is realized by collaboration.
·
Actor: Actor is the user of the system, who performs action on the
system and to whom the system yields an observable result of value.
Sequence Diagram
The sequence diagram is an interaction diagram that emphasizes the time
ordering of messages for modeling a real time system. Graphically, a sequence
diagram is a table that shows objects arranged along the X axis and messages,
ordered in increasing time, along the Y axis. Sequence Diagram consists of
objects, links, lifeline, focus of control, and messages.
- Object: Objects are typically named or anonymous instances of
class. But may also represent instances of other things such as
components, collaboration and nodes.
- Link: A link is a semantic connection
among objects i.e., an object of an association is called as a link.
- Lifeline: A lifeline is
vertical dashed line that represents the lifetime of an object.
- Focus of Control: A Focus of Control
is tall, thin rectangle that shows the period of time during which an
object is performing an action.
- Messages:
A
message is a specification of a communication between objects that conveys
the information with the expectation that the activity will ensue.
Activity
Diagram
An
activity diagram shows the flow from activity to activity. The activity diagram
emphasizes the dynamic view of a system. It consists of activity states, action
states, transition, and object.
·
·
·
Transition: A transition specifies the path from one action
or activity state to the next action or activity state. The transition is
rendered as a simple directed line.
·
Object: An object is a concrete manifestation of an abstraction; an
entity with a well defined boundary and identity that encapsulates state and
behavior; an instance of a class. Objects may be involved in the flow of
control associated with an activity diagram.
State
chart Diagram:
A
state chart diagram shows a state machine, consisting of states, transitions,
events, and activities. The state chart diagram emphasizes the dynamic view of
a system. It consists of states, transitions, events, and actions.
·
State: A state is a condition or situation in
the life of an object during which it satisfies some condition, performs some
activity, or waits for some event.
·
Transition: A transition is a relationship between two
states indicating that an object in the first state will perform certain
actions and enter the second state when a specified event occurs and specified
conditions are satisfied.
·
Event: An event is the specification of a significant occurrence
that has a location in time and space.
·
Action: An action an executable atomic computation that results in a
change in state of the model or the return of a value.
SORCE CODE
package action;
/*
*
The class is used to maintain all the information
*
about the individual host eg(position, name, and windowSize)
*/
import java.io.*;
import java.util.Vector;
public class BufferTransfer implements
Serializable
{
String
source_name,destination_name,filename,destination_type,current_host,cross_host_name;
long
refuse_host_id; //Reject host id when
Vector
crossing_host_name=new Vector(); //List
for File traverse path
Vector
refuse_packet_container=new Vector(); //Refuse list for already file traversed
Vector
destination_not_reachable_list=new Vector(); //Refuse
list for packet not reachable
String
destination_not_reach_host;
byte[]
buffer=new byte[1024];
public
Vector getCrossing_host_name() {
//Get Info for file traversing Host
return
crossing_host_name;
}
public
void setCross_host_name(String cross_host_name) { //Add Cross host name to vector list
crossing_host_name.add(cross_host_name);
}
public
void setRefuse_host_id(long refuse_host_id) { //reject host for one host traverse
refuse_packet_container.add(refuse_host_id);
}
public
Vector getRefuse_packet_container() {
//get
Reject host
return
refuse_packet_container;
}
public
String getCurrent_host() { //get
Current host
return
current_host;
}
public
void setCurrent_host(String current_host) { //set
Current host
this.current_host
= current_host;
}
public
String getDestination_name() { //get
Destinatin Host
return
destination_name;
}
public
void setDestination_name(String destination_name) { //set Destinatin Host
this.destination_name
= destination_name;
}
public
String getDestination_type(){ //
get Destination type wheather that host is Process/Destination
return
destination_type;
}
public
void setDestination_type(String destination_type) { // set Destination type wheather that host is
Process/Destination
this.destination_type
= destination_type;
}
public
String getFilename() { // get Name for
which file want to trasfer through network
return
filename;
}
public
void setFilename(String filename) { //
get Name for which file want to trasfer through network
this.filename
= filename;
}
public
String getSource_name() { //get
Source name select by user
return
source_name;
}
public
void setSource_name(String source_name) { //
set Source name select by user
this.source_name
= source_name;
}
public
byte[] getBuffer() {
return
buffer;
}
public
void setBuffer(byte[] buffer) { //Set
output message read from input file given by user
this.buffer
= buffer;
}
public
Vector getDestination_not_reachable_list() { //Get
vector contains that not reachable host name
return
destination_not_reachable_list;
}
public
void setDestination_not_reach_host(String destination_not_reach_host) {
destination_not_reachable_list.add(destination_not_reach_host);
}
/*
* The class is used
to write information to log file
* about the Output
eg(Source Name,Destinatin name, Traverse path)
*/
package action;
import java.io.FileOutputStream;
import java.util.Date;
public class Writeobject
{
private
FileOutputStream fos;
public void
output(BufferTransfer bufferTransfer)
{
try
{
fos
= new FileOutputStream("Transfer_history.txt",true);
String
s_line="\n--------------------------------------------------------------------";
String
res_output="\n S.Name
==>"+bufferTransfer.getSource_name()+"D.Name==>"+bufferTransfer.getDestination_name(); //Assign Source and Destinatin name for write
the log file
String
date = "\n" +new Date().toString();
fos.write(date.getBytes());
fos.write(s_line.getBytes());
fos.write(res_output.getBytes());
fos.write(s_line.getBytes());
fos.write(bufferTransfer.getCrossing_host_name().toString().getBytes()); //Display traversing Data Packer path info
fos.write(s_line.getBytes());
fos.close();
}
catch(Exception
e)
{
System.out.println("File
Write"+e.getMessage());
}
}
}
package action;
import java.io.*;
import java.net.*;
import javax.swing.JOptionPane;
public class HostResponse implements Runnable
{
int
port;
Thread
thread;
public
HostResponse(int port)
{
this.port=port; //Assign
port
thread=new
Thread(this);
thread.start();
}
public
HostResponse(){}
public
void run()
{
while(true)
{
try
{
ServerSocket
socket;
Socket
connsocket;
BufferTransfer
bufferTransfer;
TransferObject
transferObject=new TransferObject();
ObjectInputStream
objectInputStream;
socket=new
ServerSocket(port);// create server socket and bind with port 6789
System.out.println("Server
Connected");
connsocket=socket.accept(); // waiting to accept data from socket
objectInputStream
= new ObjectInputStream(connsocket.getInputStream());
bufferTransfer
= (BufferTransfer) objectInputStream.readObject();// Read data from socket
if
(bufferTransfer.getDestination_type().equals("Process")) //Proect Next Host
{
transferObject.neighbour_node(bufferTransfer.getCurrent_host(),bufferTransfer.getDestination_name(),bufferTransfer.getFilename(),bufferTransfer); //Change source and destination and then
continue
}
else
if(bufferTransfer.getDestination_type().equals("Destination"))
//Confirm Data Packet reach destinatin
{
Writeobject
writeobject=new Writeobject();
//Generate Output when that file reach destination
writeobject.output(bufferTransfer);
bufferTransfer.getRefuse_packet_container().removeAll(bufferTransfer.getRefuse_packet_container());
bufferTransfer.getCrossing_host_name().removeAll(bufferTransfer.getCrossing_host_name());
bufferTransfer.getDestination_not_reachable_list().removeAll(bufferTransfer.getDestination_not_reachable_list());
}
else
if(bufferTransfer.getDestination_type().equals("Failure")) //Check status for Not Reachable
{
Writeobject
writeobject=new Writeobject();
writeobject.output(bufferTransfer);
}
connsocket.close();
socket.close();
}
catch(Exception
error)
{
System.out.println("error
in Server==>"+error);
}
}
}
}
9. TESTING
Testing is an activity in which a
system or component is executed under specified conditions, whose results are
observed or recorded, and an evaluation is made about some aspect of the system
or component. A successful testing uncovers errors in the software. So in
general testing demonstrates that the system is working according to the
specifications, and that it meets the performance requirements. This is the
final stage of any project. Testing is a process of executing the program with
the intent of finding an error, it is a set of activities that can be planned
in advance and conducted systematically. The purpose of System testing is to
correct the errors in the system. Nothing is completed without the testing, as
it is vital to the success of the system.
9.1 Testing Phases:
Software testing phases
include the following:
Test activities are determined and
Test data is selected. The test is conducted and test results are compared with
the expected results.
There
are various types of Testing:
Unit
Testing:
Unit testing is a procedure used to
validate that individual units of source code are working properly. A unit is
the smallest testable part of an application. In procedural programming a unit
may be an individual program, function, procedure etc, while in object-oriented
programming, the smallest unit is always a Class; which may be a base/super
class, abstract class or derived/child class. Units are distinguished from
modules in that modules are typically made up of units
Integration
Testing:
Integration Testing is the phase of software
testing in which individual software modules are combined and tested as a
group. It follows unit testing and precedes system testing. The goal is to see
if the modules are properly integrated and the emphasis being on the testing
interfaces among modules.
System Testing:
System testing is testing conducted on
a complete, integrated system to evaluate the system's compliance with its
specified requirements. System testing is actually done to the entire system
against the Functional Requirement Specification(s) (FRS) and/or the System
Requirement Specification (SRS).
It is also intended to test up to and beyond the
bounds defined in the software/hardware requirements specification(s).
Acceptance
Testing:
Acceptance
testing generally involves running a suite of tests on the completed system.
The acceptance test suite is run against the supplied input data or using an
acceptance test script to direct the testers. Then the results obtained are
compared with the expected results. If there is a correct match for every case,
the test suite is said to pass. If not, the system may either be rejected or
accepted on conditions previously agreed between the sponsor and the
manufacturer.
9.2 Testing Methods:
Testing
is a process of executing a program to find out errors. Any testing can be done
in two ways:
White Box Testing:
White Box testing uses an internal perspective
of the system to design test cases based on internal structure. It requires
programming skills to identify all paths through the software.
The tester chooses test case inputs to exercise
paths through the code and determines the appropriate outputs. Using the
testing a software engineer can derive the following
Test cases:
Exercise all the logical decisions on either
true or false sides.
Execute all loops at their boundaries and within their operational
boundaries. Exercise the internal data structures to assure their validity.
Black Box Testing:
Black box testing takes an external
perspective of the test object to derive test cases. These tests can be
functional or non-functional, though usually functional. The test designer
selects valid and invalid input and determines the correct output. There is no
knowledge of the test object's internal structure.
Black Box testing
attempts to find errors in the following categories:
·
Incorrect
or missing functions
·
Interface
errors
·
Errors
in data structures
·
Performance
errors
·
Initialization
and termination errors
9.3 Test Approach:
Testing can be done in two ways:
·
Bottom-up
approach
·
Top-down
approach
Bottom-up approach:
In a bottom-up
approach the individual base elements of the system are first specified in
great detail. These elements are then linked together to form larger
subsystems, which then in turn are linked, sometimes in many levels, until a
complete top-level system is formed. This strategy often resembles a
"seed" model, whereby the beginnings are small, but eventually grow
in complexity and completeness. However, "organic strategies", may
result in a tangle of elements and subsystems, developed in isolation, and
subject to local optimization as opposed to meeting a global purpose.
Top-down approach:
In
a top-down approach an overview of the system is first formulated,
specifying but not detailing any first-level subsystems. Each subsystem is then
detailed enough to realistically validate the model.
10. USER GUIDE
10.1 Installation/Environment setup
Setting up the java
environment
Our project has been coded using the
JAVA version 1.5.0 so before getting on to running the project we need to install
the java environment. Here is how we do it.
1. Java installation file
is included in the CD accompanying this document. You can find in the
requirements folder in the CD.
2. Go to the requirements
folder and run jdk-1_5_0_04-windows-i586-p.exe file
3. You will be greeted by
the java setup wizard. It will guide through the rest of the setup.
4. This above file should
install both JAVA runtime libraries as well as JAVA development kit
5. Now to set up the path,
right click on my computer and click properties.
6. Click on the advanced
tab on open environment variables.
7. There add the path were
java’s bin folder is located. Default is C:\Program Files\Java\jdk1.5.0_04\bin.
8. Now the environment is
up and ready to be used.
Extracting the source
files
The source files have been zipped so
you will need some utility like winrar to extract its content
1. To install winrar go to
requirements folder in the CD and click on winrar.exe
2. A wizard will pop up and
will guide through the setup.
3. Now copy
steganography.rar file on to the local drive.
4. Right click on the
copied file and click extract here.
5. This will extract all
the source files on to the local disk
6. Now the files are ready
to be complied and executed
Compiling the code
1. Using command “cd
manet1”
2. Type javac
–classpath <path of the source files>\javac *.java
3. That should compile the
manet1
4. Type javac –classpath<path of the source
files>\java
Running the application
1. To run the program make sure you are in the
application root folder.
2. Type “java –classpath <path of the source files>\javac
*.java;<path of the source files>; java
3. The application window
pops up. The details on how to operate the program is described in the next
section
10.2
How to Operate
1. The execution begins
with the interaction of GUI window which is called as the front end of the
program.
2. You can see buttons
containing “File”, “View database”.
3. First you have to enter
the mobile nodes into the network.
4. What ever the mobile
nodes joined in the network it will be form in a “Binary tree”.
5. The tree will be updating
when the new node joining in the network.
6. You have to add any file
to the particular “Host” , first have to click the “File” menu then “Add File”
have to select from that the file will be placed in the “Host”.
7. You have to search any
file in the “Host” have to click the
“File” menu then “Search” button there
it will be displayed the “Host” have to search in that.
8. You have to see the
“Database” have to click the “View Database” in that it will displays the
“Database” of the Hosts what you added the files in the “Hosts”.
11.1
Features of JAVA
The above mentioned algorithms have
been implemented on JAVA because of the characteristics of the language which
are listed below.
·
Simple
Java is simple to use for three main
reasons: First, Java is familiar to you if you know C. Second, Java eliminates
components of C that cause bugs and memory leaks. Java provides a powerful set
of pre-tested class libraries that give you ability to use their advanced
features with just a few additional lines of code.
·
Object-Oriented
Java is an object-oriented programming language
that uses software objects called classes and is based upon reusable,
extensible code. This means that you can use java’s classes, which are sets of
variables and methods, as templates to create other classes with added
functionality without rewriting the code from the parent classes or super
classes.
·
Robust
Java is robust because the language removes the
use of pointers and the java runtime system manages memory. The problems with
pointers in C and C++ were that pointers directly address memory space. In a
distributed environment like the internet, when code is downloaded to diverse
systems, there is no way of knowing for sure that memory space addressed by
pointers is not occupied by the system. Overwriting this memory space could
crash a system. Java also gives you automatic bounds checking for arrays, so
they cannot index address space not allocated to the array. Automatic memory
management is done using Garbage Collector, “Creating Your Own Objects.”
·
Architecture Neutral
Java is architecture neutral, so your
applications are portable across multiple platforms. Java’s applications are
written and compiled into byte code for java’s virtual machine. Byte code is
converted to binary machine code by java interpreter installed at the client,
so applications need to be written for individual platforms and then ported
from platform to platform. Java additionally ensures that your applications are
the same on every platform by strictly defining the sizes of its basic data
types and the behavior of its arithmetic operators. Operator overloading, the
process of modifying the behavior of operators, is prohibited by java.
·
Exception Handling
An exception is an abnormal condition that
arises in code sequence at run time. In other words, an exception is a run time
error. In computer languages that do not support exception handling, errors
must be checked and handled manually, typically through the use of error codes
and so on. This approach is as cumbersome as it is troublesome Java’s exception
handling avoids three problems and, in the process, brings run-time error
management into the object-oriented world.
·
Interpreted and High
Performance
Java enables the creation of cross-platform
programs by compiling into an intermediate representation called byte code.
This code can be interpreted on any system that provides Java Virtual Machine.
Java byte code was carefully designed so that it would be easy to translate
directly into native machine code for very high performance by using a
just-in-time compiler.
·
Java I/O:
A large part of what network programs do is
simple input and output, moving bytes from one system to another. I/O in Java
is built on streams. A stream represents a flow of data and is logical entity
that connects a data source with its destination.
There are two ways to read and write data to a
file in Java: the first uses byte streams and the second uses character
streams. Input stream read data. Output streams write data.
JAVA Foundation Classes
and JAVA Swing
Swing is a GUI toolkit for Java. Swing is one
part of the Java Foundation Classes (JFC). Swing includes graphical user
interface (GUI) widgets such as text boxes, buttons, split-panes, and tables.
Swing widgets provide more sophisticated GUI components than the earlier
Abstract Windowing Toolkit. Since they are written in pure Java, they run the
same on all platforms, unlike the AWT, which is tied to the underlying
platform's windowing system. Swing supports pluggable look and feel – not by
using the native platform's facilities, but by roughly emulating them. This
means you can get any supported look and feel on any platform. The disadvantage
of lightweight components is possibly slower execution. The advantage is
uniform behavior on all platforms.
With J2SE 1.4.x and now 1.5, Sun have taken
great strides in improving Swing. It's faster, and the new Ocean theme (though
it still draws criticism) is a big step forward in the modernization of Swing's
look, if not its feel.
Trouble is, the rest of the world has advanced
apace - and in certain cases (as we'll explore in this article) leapt ahead of
Swing. As a result, Swing's recent improvements fail to address certain key
issues that may prevent its wholesale adoption.
One of Swing's main advantages is its incredible
flexibility. If there's something you need to do with your UI, Swing will get
you there. You might have to write a custom tree-cell renderer, or even your
own custom look & feel, but ultimately you will be able to achieve what you
need to use Swing. Unfortunately, this flexibility comes at a price. Swing has
a steep learning curve for novices. It's also difficult to master.
REFERENCES
[1] S. Deering and R. Hinden, “Internet
protocol version 6 (IPv6) specification”, IETF RFC 2460, December 1998.
[2] Hinden, R.Hinden, and
[3] T.Narten, E.Nordmark, and W.Simpson,
“Neighbor Discovery for IPv6”, RFC 2461, Dec 1998.
[4] S.Thomson and T.Narten, “IPv6 Stateless
Address AutoConfiguration”, RFC 2462, Dec 1998.
[5] C.Perkins, J.Malinen, R.Wakikawa,
E.Belding-Royer, and Y.Sun, “IP Address AutoConfiguration for Ad Hoc Networks”,
IETF Internet Draft, Draft-ietf-manet-autoconf-01.txt, November 2001.
[6] R.Wakikawa, J.Malinen, C.Perkins,
A.Nilsson and A. Tuominen, “Global Connectivity for IPv6 Mobile Ad Hoc
Networks”, IETF Internet Draft, draft-wakikawa-manet-globalv6-03.txt, October
2003.
[7] I.K. Park, Y.H Kim and S.S.Lee, “IPv6
Address Allocation in Hybrid Mobile Ad Hoc Networks”, The 2nd IEEE
workshop on Software Technologies for Embedded and Ubiquitous Computing
Systems, May 2004, pp.58-62.
[8] C.E.Perkins, E.M.Belding-Royer and S.Das,
“Ad Hoc On-Demand Distance Vector (AODV) Routing”, Routing RFC 3561, July 2003.
[9] T.Clausen and P.Jacquet, “Optimized
[10] Z.J. Hass and M.R. Perlmn,“The Zone Routing
Protocol (ZRP) for Ad-Hoc Networks”, IETF Internet Draft,
draft-ietf-manet-zone-zrp-04.txt, July 2002.
Websites:
·
Java The complete reference
Comments
Post a Comment