Friday, November 30, 2007

Java Language Specification

Java Language Specification (Second Edition)
Introduction

The Java programming language is a general-purpose, concurrent, class-based, object-oriented language. It is designed to be simple enough that many programmers can achieve fluency in the language. The Java programming language is related to C and C++ but is organized rather differently, with a number of aspects of C and C++ omitted and a few ideas from other languages included. It is intended to be a production language, not a research language, and so, as C. A. R. Hoare suggested in his classic paper on language design, the design has avoided including new and untested features.
The Java programming language is strongly typed. This specification clearly distinguishes between the compile-time errors that can and must be detected at compile time, and those that occur at run time. Compile time normally consists of translating programs into a machine-independent byte code representation. Run-time activities include loading and linking of the classes needed to execute a program, optional machine code generation and dynamic optimization of the program, and actual program execution.

Read the complete book (Java Language Specification second edition) here:http://java.sun.com/docs/books/jls/second_edition/html/jTOC.doc.html

Tuesday, November 27, 2007

Rich Internet Applications (RIAs)

Rich Internet Applications (RIAs) are web applications that offer the responsiveness, “rich” features and functionality approaching that of desktop applications. Early Internet applications supported only a basic HTML graphical user interface (GUI). Though they could serve simple functions, these applications did not have the look or feel of a desktop application. The relatively slow Internet connections these applications relied on led to the term “World Wide Wait.” RIAs are a result of today’s more advanced technologies that allow greater responsiveness and advanced GUIs.
Technologies used to develop Rich Client Applications are:

  • Ajax
  • Dojo
  • Flex
  • Silverlight
  • Java FX
  • Ruby on Rails
  • Script.aculo.us
  • JavaServer Faces
  • ASP.NET Ajax
  • Adobe Integrated Runtime and Google Gears

Refer these links for more details on above technologies

“History.” The Dojo Toolkit, 10 April 2007 <http://dojotoolkit.org/book/dojo-book-0-9/introduction/history>.
“Adobe Flex 2.” Adobe <http://www.adobe.com/products/flex/whitepapers/pdfs/flex2wp_technicaloverview.pdf>.
Cubrilovic, N. “Silverlight: The Web Just Got Richer.” TechCrunch, 30 April 2007 <http://www.techcrunch.com/2007/04/30/silverlight-the-web-just-got-richer>.
“Sun Radically Simplifies Content Authoring—Previews JavaFX Script.” Sun Microsystems, 8 May 2007 <http://www.sun.com/aboutsun/pr/2007-05/sunflash.20070508.2.xml>.
“Prototype Tips and Tutorials.” Prototype JavaScript <http://prototypejs.org/learn>.
“Core Effects.” Script.aculo.us Wiki <http://wiki.script.aculo.us/scriptaculous/show/CoreEffects>.
Berlind, D. “Google Gears Vies to be De Facto Tech for Offline Web Apps.” ZDNet, 31 May 2007 <http://blogs.zdnet.com/Berlind/?p=504>.
Mills, E. “Google Gears Churns Toward Microsoft.” CNET, 31 May 2007 <http://news.com.com/2100-1012_3-6187942.html>.
“The 70 Percent Solution.” Business 2.0, 28 November 2005 <http://money.cnn.com/2005/11/28/news/newsmakers/schmidt_biz20_1205/>.
“The Dojo Offline Toolkit.” The Dojo Toolkit <http://dojotoolkit.org/offline>.

Monday, November 26, 2007

What is in java.lang package?

The lang package

The java.lang package provides classes that are fundamental to the Java programming language.
java.lang is automatically imported in all programs. It is java's most widely used package.

java.lang package provides 29 classes and three interfaces. Due to its importance, the java.lang package is provided with all Java platforms ranging from Embedded Java to the JDK.

Interfaces in java.lang

The java.lang package contains three interfaces namely

  • Cloneable
  • Comparable
  • Runnable

Cloneable : A class implements Cloneable to indicate the Object.clone() method that it is authorized to make a copy of instances of that class.

The exception CloneNotSupportedException will be thrown if the user clones instances, which do not implement the Cloneable interface. The interface Cloneable declares no methods.

Comparable : Java 2 adds a new interface to java.lang called Comparable. Classes that implement Comparable interface contain objects that can be compared with each other.

The comparable method declares only one method. The syntax is:

int compareTo(Object obj)

this method compares the invoking object with 'obj'. It returns 0 if the values are equal.

Runnable : Any class that initiates a separate thread of execution must implement the Runnable interface.

Runnable defines only one abstract method, called run(), which is the entry point to the thread. Threads that are created by the user must implement abstract void run() method.

Saturday, November 17, 2007

XML, XSLT, Java, and JSP: A Case Study in Developing a Web Application

XML, XSLT, Java, and JSP: A Case Study in Developing a Web Application

XML, XSLT, Java, and JSP: A Case Study in Developing a Web Application

Publisher:New Riders Press (2001-07-19) | ISBN-10: 0735710899 | PDF | 4.3 Mb | 768 pages

As a Web Developer, you know the challenge of building robust applications on multiple platforms. Creating truly portable applications becomes possible by using Java for code and XML for organizing and managing data. “XML, XSLT, Java, and JSP:A Case Study” will help you maximize the capabilities of XML, XSLT, Java, and JSP in your Web applications.

Monday, November 12, 2007

Fast Track to Sun Certified Java Programmer (SCJP) 5.0 Upgrade Exam

Fast Track to Sun Certified Java Programmer (SCJP) 5.0 Upgrade ExamKa, Iok Tong, “Fast Track to Sun Certified Java Programmer (SCJP) 5.0 Upgrade Exam”

ISBN:143030393X | November 30, 2006 | 152 pages | PDF | 0.5MB

If you’d like to learn the new features in Java SE 5.0 and pass the Sun Certified Java Programmer Upgrade Exam (CX-310-056), then this book is for you. It covers all the Java SE 5.0 new features required in the exam. You don’t need to read about the existing features that you already know. 117 review questions and mock exam questions are included.

Java/J2EE Job Interview Companion - 400+ Questions & Answers, 2nd Edition

Java/J2EE Job Interview Companion - 400+ Questions & Answers, 2nd Edition
Arulkumaran Kumaraswamipillai, Sivayini Arulkumaran, “Java/J2EE Job Interview Companion - 400+ Questions & Answers”
ISBN:1411668243 | April 5, 2007 | 356 pages | PDF | 3.5MB

Sunday, November 11, 2007

Java All-In-One Desk Reference For Dummies 2nd Edition




Publisher: For Dummies ISBN: 0470124512 2nd Edition Author: Doug Lowe, Barry Burd 914 pages June 25, 2007 English CHM 12.3 MB
- Eight minibooks comprising nearly 900 pages give developers the tips and techniques they need to get up and running on the new J2SE 6 (Java Standard Edition 6) and JDK 6 (Java Development Kit 6)- This friendly, all-inclusive reference delivers the lowdown on Java language and syntax fundamentals as well as Java server-side programming, with explanations, reference information, and how-to instructions for both beginning and intermediate-to-advanced programmers- Minibooks cover Java basics; programming basics; strings, arrays, and collections; programming techniques; Swing; Web programming; files and databases; and fun and games

DOWNLOAD

Friday, November 9, 2007

An Overview of the Java APIs for XML

An Overview of the APIs
This page gives you a map so you can find your way around JAXP and the associated XML APIs. The first step is to understand where JAXP fits in with respect to the major Java APIs for XML:

JAXP: Java API for XML Processing
This API is the subject of the present tutorial. It provides a common interface for creating and using the standard SAX, DOM, and XSLT APIs in Java, regardless of which vendor's implementation is actually being used..

JAXB: Java Architecture for XML Binding
This standard defines a mechanism for writing out Java objects as XML (marshalling) and for creating Java objects from such structures (unmarshalling). (You compile a class description to create the Java classes, and use those classes in your application.)


JDOM: Java DOM
The standard DOM is a very simple data structure that intermixes text nodes, element nodes, processing instruction nodes, CDATA nodes, entity references, and several other kinds of nodes. That makes it difficult to work with in practice, because you are always sifting through collections of nodes, discarding the ones you don't need into order to process the ones you are interested in. JDOM, on the other hand, creates a tree of objects from an XML structure. The resulting tree is much easier to use, and it can be created from an XML structure without a compilation step. For more information on JDOM, visit http://www.jdom.org. For information on the Java Community Process (JCP) standards effort for JDOM, see JSR 102.


DOM4J
Although it is not on the JCP standards track, DOM4J is an open-source, object-oriented alternative to DOM that is in many ways ahead of JDOM in terms of implemented features. As such, it represents an excellent alternative for Java developers who need to manipulate XML-based data. For more information on DOM4J, see http://www.dom4j.org.

JAXM: Java API for XML Messaging
The JAXM API defines a mechanism for exchanging asynchronous XML-based messages between applications. ("Asynchronous" means "send it and forget it".)

JAX-RPC: Java API for XML-based Remote Process Communications
The JAX-RPC API defines a mechanism for exchanging synchronous XML-based messages between applications. ("Synchronous" means "send a message and wait for the reply".)


JAXR: Java API for XML Registries
The JAXR API provides a mechanism for publishing available services in an external registry, and for consulting the registry to find those services.

Mock SCJP Exam

Hello visitors,

Here is a mock exam for all those preparing for SCJP certification. Just click on the below link and start testing your skills. These questions are from The complete Java 2 Certification guide.

Use the following URL to access the page and test your Java skills before going for the SCJP examination.


http://web.archive.org/web/20000510040645/http://developer.java.sun.com/developer/Books/certification/testyourself.html

Wednesday, November 7, 2007

SCJD (Sun Certified Java Developer) Exam Details

Sun Certified Developer for Java 2 Platform (Step 1 of 2) (CX-310-252A)
This certification is for Sun Certified Programmers who are already familiar with the basic structure and syntax of the Java programming language, and who have a need to demonstrate advanced proficiency in developing complex, production-level applications using Java 2 Platform, Standard Edition (J2SE) technology.
Exam number:CX-310-252A
Delivered at:CertManager database
Prerequisites:Must be Sun Certified Programmer for the Java Platform (any edition)
Other exams/assignments required for this certification:Step 2 (CX-310-027)
Exam Type:Programming assignment
Cost:250.00 USD
Number of questions:N/A
Pass score:320 points out of 400 possible points
Time Limit:None


Sun Certified Developer for Java 2 Platform (Step 2 of 2) (CX-310-027)
This certification is for Sun Certified Programmers who are already familiar with the basic structure and syntax of the Java programming language, and who have a need to demonstrate advanced proficiency in developing complex, production-level applications using Java 2 Platform, Standard Edition (J2SE) technology.
Exam number:CX-310-027
Delivered at:Authorized Prometric testing centers
Prerequisites:Must be Sun Certified Programmer for the Java Platform (any edition) Completion of Step 1 (CX-310-252A)

Other exams/assignments required for this certification:Step 1 (CX-310-252A)
Exam Type:Essay
Cost:250.00 USD
Number of questions:4
Pass score:Subject to the evaluation of the essay exam and validation of the authenticity of the assignment

Time Limit:120 minutes (2 hrs)

Teach Yourself Java 6 in 21 days.

Sams Teach Yourself Java 6 in 21 Days


Sams ISBN 0672329433 Edition 5th PDF 720 pages 3.8 MB
In just 21 days, you can acquire the knowledge and skills necessary to develop three kinds of programs with Java: applications on your computer, servlets on a web server, and browser-launched Java Web Start applications.

No previous programming experience required. By following the 21 carefully organized lessons in this book, anyone can learn the basics of Java programming.
Learn at your own pace. You can work through each chapter sequentially to make sure you thoroughly understand all of the concepts and methodologies, or you can focus on specific lessons to learn the techniques that interest you most.
Test your knowledge. Each chapter ends with a Workshop section filled with questions, answers, and exercises for further study. There are even certification practice questions.
* Completely revised, updated, and expanded to cover the latest features of Java 6

* Learn to develop standalone Java applications, web servlets, JavaServer Pages, and Java Web Start applications

* Easy-to-understand, practical examples clearly illustrate the fundamentals of Java programming

* Discover how Swing can help you quickly develop programs with a graphical user interface

* Find out about JDBC database programming, Internet client/server programming, and XML parsing with the open source XOM class library

* Covers new features of version 6 such as Java DB, the new relational database that is now a built-in part of Java

SCJP Exam Details

Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0 (CX-310-055)
The Sun Certified Programmer for Java 2 Platform 5.0 certification exam is for programmers experienced using the Java programming language.

Exam number: CX-310-055
Available at: Authorized Prometric testing centers
Prerequisites: None
Other exams/assignments required for this certification: None
Exam Type: Multiple choice and Drag and Drop
Cost: 150 USD
Number of questions: 72
Pass score: 59% (43 of 72 questions)
Time Limit: 175 minutes (2 hrs and 55 minutes)

Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0 Upgrade Exam (CX-310-056)
The Sun Certified Programmer for Java 2 Platform 5.0 certification exam is for programmers experienced using the Java programming language.

Exam number:CX-310-056
Available at:Authorized Prometric testing centers
Prerequisites:Successful completion of previous version of Sun Certified Programmer for Java 2 Platform exam

Other exams/assignments required for this certification:None
Exam Type:Multiple choice and Drag and Drop
Cost:100 USD
Number of questions:46
Pass score:58% (27 of 46 questions)
Time Limit:105 minutes (1 hr and 45 minutes)

Tuesday, November 6, 2007

What is Web 2.0 ?

What is Web 2.0?
Design patterns and business models for the next generation
by Tim O'Reilly

The bursting of the dot-com bubble in the fall of 2001 marked a turning point for the web. Many people concluded that the web was overhyped, when in fact bubbles and consequent shakeouts appear to be a common feature of all technological revolutions. Shakeouts typically mark the point at which an ascendant technology is ready to take its place at center stage. The pretenders are given the bum's rush, the real success stories show their strength, and there begins to be an understanding of what separates one from the other.

The concept of "Web 2.0" began with a conference brainstorming session between O'Reilly and MediaLive International. Dale Dougherty, web pioneer and O'Reilly VP, noted that far from having "crashed", the web was more important than ever, with exciting new applications and sites popping up with surprising regularity. What's more, the companies that had survived the collapse seemed to have some things in common. Could it be that the dot-com collapse marked some kind of turning point for the web, such that a call to action such as "Web 2.0" might make sense? We agreed that it did, and so the Web 2.0 Conference was born.

In the year and a half since, the term "Web 2.0" has clearly taken hold, with more than 9.5 million citations in Google. But there's still a huge amount of disagreement about just what Web 2.0 means, with some people decrying it as a meaningless marketing buzzword, and others accepting it as the new conventional wisdom.

This article is an attempt to clarify just what we mean by Web 2.0.

It is a good article by O'Reilly, dont forget to read the article; it provides a good introduction to web 2.0
Read the complete article here:
http://www.oreillynet.com/pub/a/oreilly/tim/news/2005/09/30/what-is-web-20.html

Java FAQs, interview questions

Java FAQs

1)How can I write a program that takes command line input?
A:
Java programs that take input from the command line declare a special static method called main, which takes a String array as an argument and returns void. The example program below loops through any arguments passed to the program on the command line and lists their values.

2)What does public static void main(String[]) mean?
A
: This is a special static method signature that is used to run Java programs from a command line interface (CLI). There is nothing special about the method itself, it is a standard Java method, but the Java interpreter is designed to call this method when a class reference is given on the command line, as below.


3)Why are command line arguments passed as a String?
A:
Command line arguments are passed to the application's main method by the Java runtime system before the application class or any supporting objects are instantiated. It would be much more complex to define and construct arbitrary object types to pass to the main method and primitive values alone are not versatile enough to provide the range of input data that strings can. String arguments can be parsed for primitive values and can also be used for arbitrary text input, file and URL references.

4)Why doesn't the main method throw an error with no arguments?
A:
When you invoke the Java Virtual Machine on a class without any arguments, the class' main method receives a String array of zero length. Thus, the method signature is fulfilled. Provided the main method does not make any reference to elements in the array, or checks the array length before doing so, no exception will occur.

5)Why do we only use the main method to start a program?
A:
The entry point method main is used to the provide a standard convention for starting Java programs. The choice of the method name is somewhat arbitrary, but is partly designed to avoid clashes with the Thread start() and Runnable run() methods, for example.


6)Can the main method be overloaded?
A:
Yes, any Java method can be overloaded, provided there is no final method with the same signature already. The Java interpreter will only invoke the standard entry point signature for the main method, with a string array argument, but your application can call its own main method as required.

7)Can the main method be declared final?
A:
Yes, the static void main(String[]) method can be declared final.

8)I get an exception if I remove the static modifier from main!
A:
The static void main(String[]) method is a basic convention of the Java programming language that provides an entry point into the runtime system. The main method must be declared static because no objects exist when you first invoke the Java Virtual Machine (JVM), so there are no references to instance methods. The JVM creates the initial runtime environment in which this static method can be called, if you remove the static modifier, it will throw a NoSuchMethodException.

9)How can the static main method use instance variables?
A:
For very simple programs it is possible to write a main method that only uses static variables and methods. For more complex systems, the main method is used to create an instance of itself, or another primary class, as the basis of the application. The primary application object reference uses instance methods to create and interact with other objects, do the work and return when the application terminates.


public class SimpleClass {
public void doSomething() {
// Instance method statements }
public static main(final String[] args)
{
simpleClass instance = new SimpleClass();
instance.doSomething(); }
}

10)main method from another class?
A:
Yes, the main method can be called from a separate class. First you must prepare the string array of arguments to pass to the method, then call the method through a static reference to the host class, MaxFactors in the example below.

String[] arguments = new String[] {"123"};
MaxFactors.main(arguments);

Taken from http://www.javabeat.net/

Monday, November 5, 2007

Introducing JavaFX: Sun’s new family of Java-based products

Introducing JavaFX: Sun’s new family of Java-based products
Author: Peter Mikhalenko


JavaFX is a new family of products and technologies from Sun Microsystems that you can use to create Rich Internet Applications (RIAs). JavaFX currently consists of JavaFX Script and JavaFX Mobile; other JavaFX products are planned for release in the future.
JavaFX is anticipated to compete in the space already occupied by
Adobe AIR and Microsoft’s Silverlight technologies. In a nutshell, Adobe AIR enables Flex and DHTML developers to build applications for the desktop; Silverlight allows developers to build rich media applications that run in the browser; and JavaFX Script lets developers build rich UIs for Java applications.

JavaFX products
JavaFX Mobile is a complete mobile operating and application environment built around Java and Linux. JavaFX Script is a highly productive scripting language for content developers to create rich media and content for deployment on Java technology. JavaFX Script is the core of the JavaFX family, and it’s the most interesting part of the product set. (Sun thinks that developers will shorten JavaFX Script to JavaFX in conversations, as long as JavaFX Script is the core in the JavaFX product family.)

JavaFX Script is intended to simplify the creation of rich UIs for Java clients. JavaFX Script is implemented in Java, and it uses Java APIs for 2D and 3D graphics as well as UI controls. JavaFX Script supports a declarative syntax for UI definition that is somewhat similar to the ones used by Microsoft in XAML and Adobe in MXML, yet it’s not XML-based. In fact, it’s a real programming language — not just a markup tool — so you can write an entire application in JavaFX Script.

If you want to write JavaFX applications directly from the IDE, the best way to do that is to download and install JDK 6.1 with NetBeans 5.5.1 or 6.0 and then install the JavaFX Script plug-in for NetBeans 5.5.1 or the JavaFX Script plug-in for NetBeans 6.0. There is also a JavaFX plug-in for Eclipse.

There is a separate initiative called OpenJFX Compiler, which focuses on creating a JavaFX compiler to translate JavaFX scripts directly into JVM class files (bytecode) without any intermediate steps. It is still in the very early stages of design and implementation.

Hello World application
This is the typical “Hello World” application:


import javafx.ui.*;
Frame { title: "Hello World JavaFX"
width: 300
height: 100
content: Box {
content:
[Label {
text: "Hello World"
toolTipText: "Tool tip"
font: Font {
size: 18
}
border: EmptyBorder {
top: 10
left: 10
}
background: Color {
blue: 255
green: 255
red: 255
}
}]
}
visible: true
}
View the code online.

In order to run this application in NetBeans 5.5, you need to follow these steps:
1. Launch NetBeans 5.5.
2. From the main menu, go to File New Project.
3. In the New Project window, select the General category, select Java Application project, and click Next.
4. In the New Java Application window, type FXExample in the Project Name text field.
5. In the same window, use the Browse button to select the location of the project.
6. Uncheck the Set As Main Project and Create Main Class check boxes and click Finish.
7. Right-click on the FXExample Source Packages and select New - File/Folder.
8. In the New File window, select the Other category, select the JavaFX File file type, and click Next.
9. In the New JavaFX File window, type “HelloWorld” for the File Name, type “src” for the Folder, and click Finish.
10. Copy the code from Listing 1 and paste it in HelloWorld.fx.
11. Right-click FXExample project and select Properties.
12. In the Project Properties - FXExample, select the Run node from the Categories pane.
13. In the Arguments text field, type “Hello World” and click OK.
14. Right-click FXExample project and select the Run Project option.
If everything works, you should see the Hello World application running (see Figure A).
Figure A


To read the complete article click on the link: http://blogs.techrepublic.com.com/programming-and-development/?p=539&tag=nl.e138

Sunday, November 4, 2007

What is RMI (Remote Method Invocation)?

Remote Method Invocation (RMI)
Java Remote Method Invocation (Java RMI) enables the programmer to create distributed Java technology-based to Java technology-based applications, in which the methods of remote Java objects can be invoked from other Java virtual machines*, possibly on different hosts. RMI uses object serialization to marshal and unmarshal parameters and does not truncate types, supporting true object-oriented polymorphism.
Java RMI is included with Java SE and is available as a
separate download for Java ME.


An Overview of RMI Applications
RMI applications are often comprised of two separate programs: a server and a client. A typical server application creates some remote objects, makes references to them accessible, and waits for clients to invoke methods on these remote objects. A typical client application gets a remote reference to one or more remote objects in the server and then invokes methods on them. RMI provides the mechanism by which the server and the client communicate and pass information back and forth. Such an application is sometimes referred to as a distributed object application.
Distributed object applications need to
Locate remote objects: Applications can use one of two mechanisms to obtain references to remote objects. An application can register its remote objects with RMI's simple naming facility, the rmiregistry, or the application can pass and return remote object references as part of its normal operation.
Communicate with remote objects: Details of communication between remote objects are handled by RMI; to the programmer, remote communication looks like a standard Java method invocation.
Load class bytecodes for objects that are passed around: Because RMI allows a caller to pass objects to remote objects, RMI provides the necessary mechanisms for loading an object's code, as well as for transmitting its data.


The following illustration depicts an RMI distributed application that uses the registry to obtain a reference to a remote object. The server calls the registry to associate (or bind) a name with a remote object. The client looks up the remote object by its name in the server's registry and then invokes a method on it. The illustration also shows that the RMI system uses an existing Web server to load class bytecodes, from server to client and from client to server, for objects when needed.


Saturday, November 3, 2007

J2EE Architecture

J2EE Architecture
The following figure shows the major elements of the J2EE architecture:





J2EE Server
The J2EE server of the JavaTM 2 SDK, Enterprise Edition implements the J2EE architecture. The J2EE server provides the following services:



---Naming and Directory - allows programs to locate services and components through the JavaNaming and Directory InterfaceTM (JNDI) API
---Authentication - enforces security by requiring users to log in
---HTTP - enables Web browsers to access servlets and JavaServer PagesTM (JSP) files
----EJB - allows clients to invoke methods on enterprise beans


EJB Container
Enterprise bean instances run within an EJB container. The container controls the enterprise beans, and provides them with important system-level services. Since you don't have to develop these services yourself, you are free to concentrate on the business methods in the enterprise beans. The container provides the following services to enterprise beans:


**Transaction Management
**Security
**Remote Client Connectivity
**Life Cycle Management
**Database Connection Pooling


Transaction Management


When a client invokes a method in an enterprise bean, the container intervenes in order to manage the transaction. Because the container manages the transaction, you do not have to code transaction boundaries in the enterprise bean. The code required to control distributed transactions can be quite complex. Instead of writing and debugging complex code, you simply declare the enterprise bean's transactional properties in the deployment descriptor file. The container reads the file and handles the enterprise bean's transactions for you.


Security
The container permits only authorized clients to invoke an enterprise bean's methods. Each client belongs to a particular role, and each role is permitted to invoke certain methods. You declare the roles and the methods they may invoke in the enterprise bean's deployment descriptor. Because of this this declarative approach, you don't need to code routines that enforce security.


Remote Client Connectivity
The container manages the low-level communications between clients and enterprise beans. After an enterprise bean has been created, a client invokes methods on it as if it were in the same virtual machine.


Life Cycle Management
An enterprise bean passes through several states during its lifetime. The container creates the enterprise bean, moves it between a pool of available instances and the active state, and finally, removes it. Although the client calls methods to create and remove an an enterprise bean, the container performs these tasks behind the scenes.


Database Connection Pooling
A database connection is a costly resource. Obtaining a database connection is time-consuming and the number of connnections may be limited. To alleviate these problems, the container manages a pool of database connections. An enterprise bean can quickly obtain a connection from the pool. After the bean releases the connection, it may be re-used by another bean.


Web Container
JSP files and and servlets reside in the Web container. For more information on developing Web components, see the JavaTM 2 Technologies for the Enterprise Web page.


Enterprise Beans
Enterprise beans are server components written in the Java programming language. Enterprise beans contain the business logic for your application. For example, a checkbook client might invoke the debit and credit methods of an account enterprise bean.
There are two types of enterprise beans: session beans and entity beans.

Friday, November 2, 2007

What is CORBA?

What is CORBA?
CORBA, or Common Object Request Broker Architecture, is a standard architecture for distributed object systems. It allows a distributed, heterogeneous collection of objects to interoperate.
The OMG
The Object Management Group (OMG) is responsible for defining CORBA. The OMG comprises over 700 companies and organizations, including almost all the major vendors and developers of distributed object technology, including platform, database, and application vendors as well as software tool and corporate developers.
CORBA Architecture
CORBA defines an architecture for distributed objects. The basic CORBA paradigm is that of a request for services of a distributed object. Everything else defined by the OMG is in terms of this basic paradigm.
The services that an object provides are given by its interface. Interfaces are defined in OMG's Interface Definition Language (IDL). Distributed objects are identified by object references, which are typed by IDL interfaces.
The figure below graphically depicts a request. A client holds an object reference to a distributed object. The object reference is typed by an interface. In the figure below the object reference is typed by the Rabbit interface. The Object Request Broker, or ORB, delivers the request to the object and returns any results to the client. In the figure, a jump request returns an object reference typed by the AnotherObject interface.



The ORB
The ORB is the distributed service that implements the request to the remote object. It locates the remote object on the network, communicates the request to the object, waits for the results and when available communicates those results back to the client.


The ORB implements location transparency. Exactly the same request mechanism is used by the client and the CORBA object regardless of where the object is located. It might be in the same process with the client, down the hall or across the planet. The client cannot tell the difference.


The ORB implements programming language independence for the request. The client issuing the request can be written in a different programming language from the implementation of the CORBA object. The ORB does the necessary translation between programming languages. Language bindings are defined for all popular programming languages.


CORBA as a Standard for Distributed Objects
One of the goals of the CORBA specification is that clients and object implementations are portable. The CORBA specification defines an application programmer's interface (API) for clients of a distributed object as well as an API for the implementation of a CORBA object. This means that code written for one vendor's CORBA product could, with a minimum of effort, be rewritten to work with a different vendor's product. However, the reality of CORBA products on the market today is that CORBA clients are portable but object implementations need some rework to port from one CORBA product to another.
CORBA 2.0 added interoperability as a goal in the specification. In particular, CORBA 2.0 defines a network protocol, called IIOP (Internet Inter-ORB Protocol), that allows clients using a CORBA product from any vendor to communicate with objects using a CORBA product from any other vendor. IIOP works across the Internet, or more precisely, across any TCP/IP implementation.


Interoperability is more important in a distributed system than portability. IIOP is used in other systems that do not even attempt to provide the CORBA API. In particular, IIOP is used as the transport protocol for a version of Java RMI (so called "RMI over IIOP"). Since EJB is defined in terms of RMI, it too can use IIOP. Various application servers available on the market use IIOP but do not expose the entire CORBA API. Because they all use IIOP, programs written to these different API's can interoperate with each other and with programs written to the CORBA API.


CORBA Services
Another important part of the CORBA standard is the definition of a set of distributed services to support the integration and interoperation of distributed objects. As depicted in the graphic below, the services, known as CORBA Services or COS, are defined on top of the ORB. That is, they are defined as standard CORBA objects with IDL interfaces, sometimes referred to as "Object Services."



There are several CORBA services. The popular ones are described in detail in another module of this course. Below is a brief description of each:


Service Description
Object life cycle Defines how CORBA objects are created, removed, moved, and copied
Naming Defines how CORBA objects can have friendly symbolic names
Events Decouples the communication between distributed objects
Relationships Provides arbitrary typed n-ary relationships between CORBA objects
Externalization Coordinates the transformation of CORBA objects to and from external media.

Transactions Coordinates atomic access to CORBA objects
Concurrency Control Provides a locking service for CORBA objects in order to ensure serializable access

Property Supports the association of name-value pairs with CORBA objects
Trader Supports the finding of CORBA objects based on properties describing the service offered by the object
Query Supports queries on objects

CORBA Products
CORBA is a specification; it is a guide for implementing products. Several vendors provide CORBA products for various programming languages. The CORBA products that support the Java programming language include:

ORB and its Description
The Java 2 ORB : The Java 2 ORB comes with Sun's Java 2 SDK. It is missing several features.
VisiBroker for Java A popular Java ORB from Inprise Corporation. VisiBroker is also embedded in other products. For example, it is the ORB that is embedded in the Netscape Communicator browser.
OrbixWeb:A popular Java ORB from Iona Technologies.
WebSphere: A popular application server with an ORB from IBM.
Netscape Communicator: Netscape browsers have a version of VisiBroker embedded in them. Applets can issue request on CORBA objects without downloading ORB classes into the browser. They are already there.
Various free or shareware ORBs: CORBA implementations for various languages are available for download on the web from various sources.

Developers will get access to OpenSocial tonight

November 1st, 2007
Developers will get access to OpenSocial tonight
Posted by Garett Rogers


Google posted a
press release confirming that they have partnered with several large social networks including MySpace. As you have likely read already, these sites are adopting the “OpenSocial” platform — it will be a shocker if developers don’t flock to it. Having had the pleasure to working with the API while it was being created, I can say that it has turned out great, and my hats go off to the engineers at Google who made it possible.
If you are a developer, keep your eyes on
http://code.google.com/apis/opensocial. Currently, this page only gives an error, but soon it will have lots of good documentation about how you can go about creating your own social gadgets for the new platform. If you already have a Facebook application, in most cases porting it over to the OpenSocial platform will be fairly painless — but it will still take a some effort.
OpenSocial was due to be released on November 5th, so I guess we will get it four days earlier than expected. It will be very interesting to see if Facebook joins the OpenSocial alliance or decides to remain a proprietary social network that is determined to make it on it’s own. What do you think? Should Facebook give in to the pressure or not?

Thursday, November 1, 2007

XML and its use.

What is XML?

  • XML stands for EXtensible Markup Language
  • XML is a markup language much like HTML
  • XML was designed to describe data
  • XML tags are not predefined. You must define your own tags
  • XML uses a Document Type Definition (DTD) or an XML Schema to describe the data
  • XML with a DTD or XML Schema is designed to be self-descriptive
  • XML is a W3C Recommendation
  • The Main Difference Between XML and HTML
  • XML was designed to carry data.
  • XML is not a replacement for HTML.XML and HTML were designed with different goals:
  • XML was designed to describe data and to focus on what data is.
  • HTML was designed to display data and to focus on how data looks.
  • HTML is about displaying information, while XML is about describing information.

XML Does not DO Anything
XML was not designed to DO anything.

Maybe it is a little hard to understand, but XML does not DO anything. XML was created to structure, store and to send information.


XML is Free and Extensible
XML tags are not predefined. You must "invent" your own tags.
The tags used to mark up HTML documents and the structure of HTML documents are predefined. The author of HTML documents can only use tags that are defined in the HTML standard (XML allows the author to define his own tags and his own document structure.
The tags in the example above (like and ) are not defined in any XML standard. These tags are "invented" by the author of the XML document.

XML is a Complement to HTML
XML is not a replacement for HTML.
It is important to understand that XML is not a replacement for HTML. In future Web development it is most likely that XML will be used to describe the data, while HTML will be used to format and display the same data.
My best description of XML is this: XML is a cross-platform, software and hardware independent tool for transmitting information.

XML in Future Web Development
XML is going to be everywhere.
We have been participating in XML development since its creation. It has been amazing to see how quickly the XML standard has been developed and how quickly a large number of software vendors have adopted the standard.
We strongly believe that XML will be as important to the future of the Web as HTML has been to the foundation of the Web and that XML will be the most common tool for all data manipulation and data transmission.
It is important to understand that XML was designed to store, carry, and exchange data. XML was not designed to display data.

XML can Separate Data from HTML
With XML, your data is stored outside your HTML.
When HTML is used to display data, the data is stored inside your HTML. With XML, data can be stored in separate XML files. This way you can concentrate on using HTML for data layout and display, and be sure that changes in the underlying data will not require any changes to your HTML.
XML data can also be stored inside HTML pages as "Data Islands". You can still concentrate on using HTML only for formatting and displaying the data.

XML is Used to Exchange Data
With XML, data can be exchanged between incompatible systems.
In the real world, computer systems and databases contain data in incompatible formats. One of the most time-consuming challenges for developers has been to exchange data between such systems over the Internet.
Converting the data to XML can greatly reduce this complexity and create data that can be read by many different types of applications.

XML and B2B
With XML, financial information can be exchanged over the Internet.
Expect to see a lot about XML and B2B (Business To Business) in the near future.
XML is going to be the main language for exchanging financial information between businesses over the Internet. A lot of interesting B2B applications are under development.

XML Can be Used to Share Data
With XML, plain text files can be used to share data.
Since XML data is stored in plain text format, XML provides a software- and hardware-independent way of sharing data.
This makes it much easier to create data that different applications can work with. It also makes it easier to expand or upgrade a system to new operating systems, servers, applications, and new browsers.

XML Can be Used to Store Data
With XML, plain text files can be used to store data.
XML can also be used to store data in files or in databases. Applications can be written to store and retrieve information from the store, and generic applications can be used to display the data.

XML Can Make your Data More Useful
With XML, your data is available to more users.
Since XML is independent of hardware, software and application, you can make your data available to other than only standard HTML browsers.
Other clients and applications can access your XML files as data sources, like they are accessing databases. Your data can be made available to all kinds of "reading machines" (agents), and it is easier to make your data available for blind people, or people with other disabilities.

XML Can be Used to Create New Languages
XML is the mother of WAP and WML.
The Wireless Markup Language (WML), used to markup Internet applications for handheld devices like mobile phones, is written in XML.

You can read more about WML in our

WML tutorial.

Source: www.w3schools.com


What is diffrence between java and java script?

What is diffrence between java and java script?

Java and javascript both based on objects and their is a tight relation ship between these two.
The major difference between these two are:

1.Java is compiled language but javascript is an interpreted language.
2.Java is strongly typed language i.e,it is necessary to declare variables before use but it is not the case with javascript.
3.Java is used independently while javascript is used with in html tags and require web browser to run.
4.java files have the file extension of '.java' while javascript files have extension of '.js'
5.Java can be used for designing standalone applications as well as web pages also while javascript can only be used for designing wed pages.