Java Virtual Machine 
Tuesday, March 25, 2008, 09:28 PM
Posted by Aravind Sankaran
What is JVM(Java Virtual Machine) and how it works??

At the heart of the Java platform lies the Java Virtual Machine, or JVM. Most programming languages compile source code directly into machine code, suitable for execution on a particular microprocessor architecture. The difference with Java is that it uses bytecode - a special type of machine code.

java bytecode executes on a special type of microprocessor. Strangely enough, there wasn’t a hardware implementation of this microprocessor available when Java was first released. Instead, the processor architecture is emulated by what is known as a “virtual machine”. This virtual machine is an emulation of a real Java processor - a machine within a machine. The only difference is that the virtual machine isn’t running on a CPU - it is being emulated on the CPU of the host machine.

The Java Virtual Machine is responsible for interpreting Java bytecode, and translating this into actions or operating system calls.

For example, a request to establish a socket connection to a remote machine will involve an operating system call. Different operating systems handle sockets in different ways - but the programmer doesn’t need to worry about such details. It is the responsibility of the JVM to handle these translations, so that the operating system and CPU architecture on which Java software is running is completely irrelevant to the developer.

The Java Virtual Machine forms part of a large system, the Java Runtime Environment (JRE). Each operating system and CPU architecture requires a different JRE. The JRE comprises a set of base classes, which are an implementation of the base Java API, as well as a JVM. The portability of Java comes from implementations on a variety of CPUs and architectures. Without an available JRE for a given environment, it is impossible to run Java software.

Differences between JVM implementations

Though implementations of Java Virtual Machines are designed to be compatible, no two JVMs are exactly alike.

For example, garbage collection algorithms vary between one JVM and another, so it becomes impossible to know exactly when memory will be reclaimed. The thread scheduling algorithms are different between one JVM and another (based in part on the underlying operating system), so that it is impossible to accurately predict when one thread will be executed over another.

Initially, this is a cause for concern from programmers new to the Java language. However, it actually has very little practical bearing on Java development. Such predictions are often dangerous to make, as thread scheduling and memory usage will vary between different hardware environments anyway. The power of Java comes from not being specific about the operating system and CPU architecture - to do so reduces the portability of software.

add comment ( 1 view )   |  permalink   |   ( 3.5 / 37 )

XML 
Monday, March 17, 2008, 05:10 PM
Posted by Aravind Sankaran
XML

Short for Extensible Markup Language, a specification developed by the World Wide Web Consortium (W3C). XML is a pared-down version of SGML, designed especially for Web documents. It allows designers to create their own customized tags, enabling the definition, transmission, validation, and interpretation of data between applications and between organizations

What is a Markup language?

Markup languages are designed for the processing, definition and presentation of text. The language specifies code for formatting, both the layout and style, within a text file. The code used to specify the formatting are called tags. HTML is a an example of a widely known and used markup language.

What is SGML?

Short for Standard Generalized Markup Language, a system for organizing and tagging elements of a document. SGML was developed and standardized by the International Organization for Standards (ISO) in 1986. SGML itself does not specify any particular formatting; rather, it specifies the rules for tagging elements. These tags can then be interpreted to format elements in different ways.
SGML is used widely to manage large documents that are subject to frequent revisions and need to be printed in different formats. Because it is a large and complex system, it is not yet widely used on personal computers. However, the growth of Internet, and especially the World Wide Web, is creating renewed interest in SGML because the World Wide Web uses HTML, which is one way of defining and interpreting tags according to SGML rules.

What is HTML?

Short for Hyper Text Markup Language, the authoring language used to create documents on the World Wide Web. HTML is similar to SGML, although it is not a strict subset. HTML defines the structure and layout of a Web document by using a variety of tags and attributes. The correct structure for an HTML document starts with <HTML> <HEAD> (enter here what document is about)<BODY> and ends with </BODY></HTML>. All the information you'd like to include in your Web page fits in between the <BODY> and </BODY> tags. Tags are also used to specify hypertext links. These allow Web developers to direct users to other Web pages with only a click of the mouse on either an image or word(s).

Aren't XML, SGML, and HTML all the same thing?

Not quite; SGML is the mother tongue, and has been used for describing thousands of different document types in many fields of human activity, from transcriptions of ancient Irish manuscripts to the technical documentation for stealth bombers, and from patients' clinical records to musical notation. SGML is very large and complex, however, and probably overkill for most common office desktop applications.
XML is an abbreviated version of SGML, to make it easier to use over the Web, to make it easier for you to define your own document types, and to make it easier for programmers to write programs to handle them. It omits all the complex and less-used options of SGML in return for the benefits of being easier to write applications for, easier to understand, and more suited to delivery and interoperability over the Web. But it is still SGML, and XML files may still be processed in the same way as any other SGML file.
HTML is just one of many SGML or XML applications—the one most frequently used on the Web.

Why is XML such an important development?

It removes two constraints which were holding back Web developments:
1.Dependence on a single, inflexible document type (HTML) which was being much abused for tasks it was never designed for.
2.The complexity of full SGML, whose syntax allows many powerful but hard-to-program options.

XML allows the flexible development of user-defined document types. It provides a robust, non-proprietary, persistent, and verifiable file format for the storage and transmission of text and data both on and off the Web; and it removes the more complex options of SGML, making it easier to program for.

Why not just carry on extending HTML?

HTML was already overburdened with dozens of interesting but incompatible inventions from different manufacturers, because it provides only one way of describing your information.

XML allows groups of people or organizations to create their own customized markup applications for exchanging information in their domain (music, chemistry, electronics, hill-walking, finance, surfing, petroleum geology, linguistics, cooking, knitting, stellar cartography, history, engineering, rabbit-keeping, mathematics, genealogy, etc).

HTML is now well beyond the limit of its usefulness as a way of describing information, and while it will continue to play an important role for the content it currently represents, many new applications require a more robust and flexible infrastructure.









.

add comment ( 1 view )   |  permalink   |  related link   |   ( 0 / 0 )

Enterprise Java Beans (EJB) 
Friday, March 7, 2008, 10:49 AM
Posted by Simmya
Enterprise Java Beans (EJB)

What is EJB?
Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform, Enterprise Edition (Java EE). EJB technology enables rapid and simplified development of distributed, transactional, secure and portable applications based on Java technology.When compared with other distributed component technologies such as Java RMI and CORBA, the EJB architecture hides most the underlying system-level semantics that are typical of distributed component applications, such as instance management, object pooling, multiple threading, and connection pooling.

Why to use EJB?

If an application is small in scope and is not required to be highly scalable, you can use J2EE components, such as servlets, together with direct JDBC connectivity to build it. However, as the application complexity grows or the number of concurrent users increases, the use of EJBs makes it much easier to partition and scale the application. In this case, using EJBs gives you some significant advantages.

When to use EJB?
EJBs are required in the following scenarios.

i. When the application is distributed: When the resources and data are distributed across multiple sites, then it is ideal to go for an application that is based on EJBs. Choose EJB when you know your application will need to scale beyond initial low usage levels and support multiple, concurrent users.

ii. When the application is performance-centric, use of EJBs and the application server provide high performance and very good scalability.

iii. Declaratively manage transactions. When transaction management is required to ensure data integrity, EJBs may be used. In EJB, you merely specify whether a bean's methods require, disallow, or can be used in the context of a transaction. The EJB container will manage your transaction boundaries appropriately.

iv. Declaratively manage security. The EJB model allows you to indicate a security role that the user must be assigned to in order to invoke a method on a bean.

v. Separation of Business Logic. The most significant difference between a web application using only servlets and one using servlets with EJBs is that the EJB model mandates a separation between display and business logic. This can be achieved using Servlets and DAO also

add comment ( 2 views )   |  permalink   |  related link   |   ( 0 / 0 )

Abstract class vs Interface 
Wednesday, March 5, 2008, 05:00 PM
Posted by Aravind Sankaran
Abstract class vs Interface

An abstract class can have shared state or functionality. An interface is only a promise to provide the state or functionality. A good abstract class will reduce the amount of code that has to be rewritten because it's functionality or state can be shared. The interface has no defined information to be shared
In java you can inherit from one (abstract) class to "provide" functionality and you can implement many interfaces to "ensure" functionality

A simple three line concept

Use an abstract class when you want to inherit only from the parent
Use an interface when you want to inherit from multiple sources
Use both when you want a basic behavior from the parent and extra features from other sources.

Is there a performance overhead in using either an abstract class or an interface?

Abstract class is faster than interface
we write a program using abstract class in that abstract class. we declare abstract methods and variables. If we want that methods and variable for another class we extends that abstract class which method and variable we want to declare.

eg: //take an example class shape
abstract class shape
{
int a,b,c;
String s1;
abstract area(int);
abstract area(int a, string s);
}

Here area is used every class ie square, rectangle, triangle etc.. so which shape we want we extends this abstract. so it is simple to compare of interface
In interface we declare all methods if not needed that method that time also we must defined so it will take lot of time and memory usage

Why we are? and when we are using Interfaces ?

Interfaces are useful when you do not want classes to inherit from unrelated classes just to get the required functionality. For example, let bird be a class with a method fly(). It will be ridiculous for an aeroplane to inherit from bird class just because it has the fly() method. Rather the fly() method should be defined as an interface and both bird and aeroplane should implement that interface.

When should I use an interface instead of an abstract class

Abstract class is an incomplete implementation of some concept. This incomplete implementation may be different in different context. Derived class implements the abstract class in its context.
Interface defines contract or standard. Implementation of the interface has to follow the contract or standard. Interfaces are more used to set these types of standards or contracts.

For example, In an application there are different editors. There are different toolbars, which can be used on these editors like navigation tool bar. In order to use this tool bar editor should implement that functionality.

So there can be interfaces like - navigation - search – save and modify.

If an editor implements all three, all toolbars will be enabled. If one, then only one will be enabled and implementation of these interface differs from context to context.

In the same example myAbstractEditor can be a class, which implements basic functionality of the editor. Where setting different controls, getting values from them can be abstract, which will depend on editor to editor.
add comment ( 2 views )   |  permalink   |  related link   |   ( 0 / 0 )

SOA 
Sunday, January 6, 2008, 10:36 PM
Posted by Administrator
Service Oriented Architecture

A Service Oriented Architecture is a collection of self-contained services that can communicate with each other. A Service Oriented Architecture is a collection of self-contained services that can communicate with each other.

Key characteristics of services:
loosely coupled
coarse grained
typically published & available for invocation

Defining services at a “business level” enables quick composition of end-to-end business processes, delivering on the promise of greater IT flexibility and agility

add comment   |  permalink   |   ( 3.1 / 21 )

Welcome To Knowledge Rack 
Tuesday, January 1, 2008, 09:22 PM
Posted by Administrator
Technical Posts Welcome :)
add comment   |  permalink   |   ( 3.2 / 43 )


<<First <Back | 1 | 2 |