XML(Extensible Markup Language)
XML is an extensible markup language used for the description and delivery of marked-up electronic text over the Web. Two important characteristics of XML distinguish it from other markup languages: its document type concept and its portability. An important aspect of XML is its notion of a document type. XML documents are regarded as having types. XML’s constituent parts and their structure formally define the type of a document. Another basic design feature of XML is to ensure that documents are portable between different computing environments. All XML documents, whatever language or writing system they employ, use the same underlying character encoding scheme. This encoding is defined by the international standard Unicode, which is a standard encoding system that supports characters of diverse natural languages. An XML document is composed of named containers and their contained data values. Typically, these containers are represented as declarations, elements, and attributes. A declaration declares the version of XML used to define the document. The technical term used in XML for a textual unit, viewed as a structural component, is element. Element containers may be defined to hold data, other elements, both data and other elements, or nothing at all. An XML document is also known as an instance or XML document instance. This signifies the fact that an XML document instance represents one possible set of data for a particular markup language. The example in Listing 3.1 typifies an XML document instance. This example shows billing information associated with a purchase order issued by plastics manufacturer. We assume that this company has built a business based on providing “specialty” and custom-fabricated plastics components on a spot and contract basis.
Example of an XML document instance
<?xml version="1.0" encoding="UTF-8"?>
<BillingInformation>
<Name> Right Plastic Products </Name>
<BillingDate> 2002-09-15 </BillingDate>
<Address>
<Street> 158 Edward st. </Street>
<City> Brisbane </City>
<State> QLD </State>
<PostalCode> 4000 </PostalCode>
</Address>
</BillingInformation>
XML Schema Document
Schemas are more powerful when validating an XML document because of their ability to clarify data types stored within the XML document. Because schemas can more clearly define the types of data that are to be contained in an XML document, they allow for a closer check on the accuracy of XML documents. Following example illustrates an XML schema for a sample purchase order.
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:PO="http://www.plastics_supply.com/PurchaseOrder" targetNamespace="http://www.plastics_supply.com/PurchaseOrder">
<!-- Purchase Order schema -->
<xsd:element name="PurchaseOrder" type="PO:PurchaseOrderType"/>
<xsd:complexType name="PurchaseOrderType">
<xsd:all> <xsd:element name="ShippingInformation" type="PO:Customer" minOccurs="1" maxOccurs="1"/>
<xsd:element name="BillingInformation" type="PO:Customer" minOccurs="1" maxOccurs="1"/> <xsd:element name="Order" type="PO:OrderType" minOccurs="1" maxOccurs="1"/> </xsd:all> </xsd:complexType>
<xsd:complexType name="Customer">
<xsd:sequence> <xsd:element name="Name" minOccurs="1" maxOccurs="1"> <xsd:simpleType> <xsd:restriction base="xsd:string"/> </xsd:simpleType> </xsd:element> <xsd:element name="Address" type="PO:AddressType" minOccurs= "1" maxOccurs="1"/> <xsd:choice> <xsd:element name="BillingDate" type="xsd:date"/>
<xsd:element name="ShippingDate" type="xsd:date"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="AddressType">
<xsd:sequence>
<xsd:element name="Street" type="xsd:string"/>
<xsd:element name="City" type="xsd:string"/>
<xsd:element name="State" type="xsd:string"/>
<xsd:element name="PostalCode" type="xsd:decimal"/> <xsd:sequence> </xsd:complexType>
<xsd:complexType name="OrderType">
<xsd:sequence> <xsd:element name="Product" type="PO:ProductType" minOccurs= "1" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="Total"> <xsd:simpleType> <xsd:restriction base="xsd:decimal"> <xsd:fractionDigits value="2"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="ItemsSold" type="xsd:positiveInteger"/> </xsd:complexType>
<xsd:complexType name="ProductType">
<xsd:attribute name="Name" type="xsd:string"/>
<xsd:attribute name="Price"> <xsd:simpleType>
<xsd:restriction base="xsd:decimal">
<xsd:fractionDigits value="2"/> </xsd:restriction>
</xsd:simpleType> </xsd:attribute>
<xsd:attribute name="Quantity" type="xsd:positiveInteger"/>
</xsd:complexType>
It depicts a purchase order for various items. This document allows a customer to receive the shipment of the goods at the customer’s manufacturing plant and billing information to be sent to the customer’s headquarters. This document also contains specific information about the products ordered, such as how much each product cost, how many were ordered, and so on. The root element of an XML schema document, such as the purchase order schema, is always the schema element. Nested within the schema element are element and type declarations. For instance, the purchase order schema consists of a schema element and a variety of sub-elements, most notably element complexType and simpleType that determine the appearance of elements and their content in instance documents. These components are explained in the following sections. The schema element assigns the XML schema namespace ("http://www.w3.org/ 2001/XMLSchema") as the default namespace. This schema is the standard schema namespace defined by the XML schema specification and all XML schema elements must belong to this namespace. The schema element also defines the targetNamespace attribute, which declares the XML namespace of all new types explicitly created within this schema. The schema element is shown to assign the prefix PO to the targetNamespace attribute. By assigning a target namespace for a schema, we indicate that an XML document whose elements are declared as belonging to the schema’s namespace should be validated against the XML schema. Therefore, the PO targetNamespace can be used within document instances so that they can conform to the purchase order schema. As the purpose of a schema is to define a class of XML documents, the term instance document is often used to describe an XML document that conforms to a particular schema.
Multiplexing and Demultiplexing Applications
In this topic we discuss the multiplexing/demultiplexing of messages by the transport layer from/to the application layer. In order to keep the discussion concrete, we'll discuss this basic service in the context of the Internet's transport layer. We emphasize, however, that multiplexing and demultiplexing services are provided in almost every protocol architecture ever designed. Moreover, multiplexing/demultiplexing are generic services, often found in several layers within a given protocol stack. Although the multiplexing/demultiplexing service is not among the most exciting services that can be provided by a transport layer protocol, it is an absolutely critical one. To understand why it so critical, consider the fact that IP delivers data between two end systems, with each end system identified with a unique IP address. IP does not deliver data between the application processes that run on these end systems. Extending host-to-host delivery to a process-to-process delivery is the job of the transport layer's application multiplexing and demultiplexing service.
At the destination host, the transport layer receives segments (i.e., transport-layer PDUs) from the network layer just below. The transport layer has the responsibility of delivering the data in these segments to the appropriate application process running in the host. Let's take a look at an example. Suppose you are sitting in front of your computer, and you are downloading Web pages while running one FTP session and two Telnet sessions. You therefore have four network application processes running -- two Telnet processes, one FTP process, and one HTTP process. When the transport layer in your computer receives data from the network layer below, it needs to
direct the received data to one of these four processes. Let's now examine how this is done.
Each transport-layer segment has a field that contains information that is used to determine the process to which the segment's data is to be delivered. At the receiving end, the transport layer can then examine this field to determine the receiving process, and then direct the segment to that process. This job of delivering the data in a transport-layer segment to the correct application process is called demultiplexing. The job of gathering data at the source host from different application processes, enveloping the data with header information (which will later be used in demultiplexing) to create segments, and passing the segments to the network layer is called multiplexing.
To illustrate the demultiplexing job, let us return to the household saga in the previous section. Each of the kids is distinguished by his or her name. When Bob receives a batch of mail from the mail person, he performs a demultiplexing operation by observing to whom the letters are addressed and then hand delivering the mail to his brothers and sisters. Alice performs a multiplexing operation when she collects letters from her brothers and sisters and gives the collected mail to the mail person.
UDP and TCP perform the demultiplexing and multiplexing jobs by including two special fields in the segment headers: the source port number field and the destination port number field.
Software Development Concept, Introduction to Java
XML(Extensible Markup Language)
XML is an extensible markup language used for the description and delivery of marked-up electronic text over the Web. Two important characteristics of XML distinguish it from other markup languages: its document type concept and its portability. An important aspect of XML is its notion of a document type. XML documents are regarded as having types. XML’s constituent parts and their structure formally define the type of a document. Another basic design feature of XML is to ensure that documents are portable between different computing environments. All XML documents, whatever language or writing system they employ, use the same underlying character encoding scheme. This encoding is defined by the international standard Unicode, which is a standard encoding system that supports characters of diverse natural languages. An XML document is composed of named containers and their contained data values. Typically, these containers are represented as declarations, elements, and attributes. A declaration declares the version of XML used to define the document. The technical term used in XML for a textual unit, viewed as a structural component, is element. Element containers may be defined to hold data, other elements, both data and other elements, or nothing at all. An XML document is also known as an instance or XML document instance. This signifies the fact that an XML document instance represents one possible set of data for a particular markup language. The example in Listing 3.1 typifies an XML document instance. This example shows billing information associated with a purchase order issued by plastics manufacturer. We assume that this company has built a business based on providing “specialty” and custom-fabricated plastics components on a spot and contract basis.
Example of an XML document instance
<?xml version="1.0" encoding="UTF-8"?>
<BillingInformation>
<Name> Right Plastic Products </Name>
<BillingDate> 2002-09-15 </BillingDate>
<Address>
<Street> 158 Edward st. </Street>
<City> Brisbane </City>
<State> QLD </State>
<PostalCode> 4000 </PostalCode>
</Address>
</BillingInformation>
Schemas are more powerful when validating an XML document because of their ability to clarify data types stored within the XML document. Because schemas can more clearly define the types of data that are to be contained in an XML document, they allow for a closer check on the accuracy of XML documents. Following example illustrates an XML schema for a sample purchase order.
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:PO="http://www.plastics_supply.com/PurchaseOrder" targetNamespace="http://www.plastics_supply.com/PurchaseOrder">
<!-- Purchase Order schema -->
<xsd:element name="PurchaseOrder" type="PO:PurchaseOrderType"/>
<xsd:complexType name="PurchaseOrderType">
<xsd:all> <xsd:element name="ShippingInformation" type="PO:Customer" minOccurs="1" maxOccurs="1"/>
<xsd:element name="BillingInformation" type="PO:Customer" minOccurs="1" maxOccurs="1"/> <xsd:element name="Order" type="PO:OrderType" minOccurs="1" maxOccurs="1"/> </xsd:all> </xsd:complexType>
<xsd:complexType name="Customer">
<xsd:sequence> <xsd:element name="Name" minOccurs="1" maxOccurs="1"> <xsd:simpleType> <xsd:restriction base="xsd:string"/> </xsd:simpleType> </xsd:element> <xsd:element name="Address" type="PO:AddressType" minOccurs= "1" maxOccurs="1"/> <xsd:choice> <xsd:element name="BillingDate" type="xsd:date"/>
<xsd:element name="ShippingDate" type="xsd:date"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="AddressType">
<xsd:sequence>
<xsd:element name="Street" type="xsd:string"/>
<xsd:element name="City" type="xsd:string"/>
<xsd:element name="State" type="xsd:string"/>
<xsd:element name="PostalCode" type="xsd:decimal"/> <xsd:sequence> </xsd:complexType>
<xsd:complexType name="OrderType">
<xsd:sequence> <xsd:element name="Product" type="PO:ProductType" minOccurs= "1" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="Total"> <xsd:simpleType> <xsd:restriction base="xsd:decimal"> <xsd:fractionDigits value="2"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="ItemsSold" type="xsd:positiveInteger"/> </xsd:complexType>
<xsd:complexType name="ProductType">
<xsd:attribute name="Name" type="xsd:string"/>
<xsd:attribute name="Price"> <xsd:simpleType>
<xsd:restriction base="xsd:decimal">
<xsd:fractionDigits value="2"/> </xsd:restriction>
</xsd:simpleType> </xsd:attribute>
<xsd:attribute name="Quantity" type="xsd:positiveInteger"/>
</xsd:complexType>
It depicts a purchase order for various items. This document allows a customer to receive the shipment of the goods at the customer’s manufacturing plant and billing information to be sent to the customer’s headquarters. This document also contains specific information about the products ordered, such as how much each product cost, how many were ordered, and so on. The root element of an XML schema document, such as the purchase order schema, is always the schema element. Nested within the schema element are element and type declarations. For instance, the purchase order schema consists of a schema element and a variety of sub-elements, most notably element complexType and simpleType that determine the appearance of elements and their content in instance documents. These components are explained in the following sections. The schema element assigns the XML schema namespace ("http://www.w3.org/ 2001/XMLSchema") as the default namespace. This schema is the standard schema namespace defined by the XML schema specification and all XML schema elements must belong to this namespace. The schema element also defines the targetNamespace attribute, which declares the XML namespace of all new types explicitly created within this schema. The schema element is shown to assign the prefix PO to the targetNamespace attribute. By assigning a target namespace for a schema, we indicate that an XML document whose elements are declared as belonging to the schema’s namespace should be validated against the XML schema. Therefore, the PO targetNamespace can be used within document instances so that they can conform to the purchase order schema. As the purpose of a schema is to define a class of XML documents, the term instance document is often used to describe an XML document that conforms to a particular schema.
Multiplexing and Demultiplexing Applications
A program is written in a particular programming language that uses specific words and symbols to express the problem solution. A programming language defines a set of rules that determine exactly how a programmer can combine the words and symbols of the language into programming statements, which are the instructions that are carried out when the program is executed.
Since the inception of computers, many programming languages have been created.We use the Java language in this and coming articles to demonstrate various programming concepts and techniques. Although our main goal is to learn these underlying software development concepts, an important side-effect will be to become proficient in the development of Java programs.
Java is a relatively new programming language compared to others. It was developed in the early 1990s by James Gosling at Sun Microsystems. Java was introduced to the public in 1995 and has gained tremendous popularity since. One reason Java got some initial attention was because it was the first programming language to deliberately embrace the concept of writing programs that can be executed using the Web. The original hype about Java’s Web capabilities initially obscured the far more important features that make it a useful generalpurpose programming language.
Java is an object-oriented programming language. Objects are the fundamental pieces that make up a program. Other programming languages, such as C++, allow a programmer to use objects but don’t reinforce that approach, which can lead to confusing program designs. Most importantly, Java is a good language to use to learn programming concepts. It is fairly elegant in that it doesn’t get bogged down in unnecessary issues as some other languages do. Using Java, we are able to focus on important issues and not on superfluous details.
The Java language is accompanied by a library of extra software that we can use when developing programs. This library provides the ability to create graphics, communicate over networks, and interact with databases, among many other features. Although we won’t be able to cover all aspects of the libraries, we will explore many of them. The set of supporting libraries is huge, and quite versatile.
Java is used in commercial environments all over the world. It is one of the fastest growing programming technologies of all time. So not only is it a good language in which to learn programming concepts, it is also a practical language that will serve you well in the future.
Introduction to Object Oriented Programming Language
With the improvement in technology, the trends of programming languages have shifted towards the Object Oriented Programming(OOP). Here I tried to explain classes and Objects in java.
Object oriented programming means any kind of programming language which uses some object oriented concepts. In OOP, programmer not only define the data types of data structure but also the functions to be performed. In this way, data structure becomes an object which includes data and function. Examples of Object oriented languages are C++, Java etc.
Main concepts of OOP
Some of the main concepts of Object Oriented Programming are:
1. Classes
2. Data Abstraction
3. Information Hiding
4. Inheritance
5. Polymorphism
6. Encapsulation
Java classes
I will explain the concept of classes in java here. A class is a blueprint or prototype from which objects are created. This section defines a class that models the state and behavior of a real-world object. It intentionally focuses on the basics, showing how even a simple class can cleanly model state and behavior. A class contain data members and functions. A class defines all the common properties of object that belong to it.
Example of class in java
For example you want to write a class of car in java. As I stated earlier class is simply a prototype of real world object. So first think about the car for which you have to write a class.
A car has some properties, like car is of red color, car has some price and other in the same way. These properties are data members for which you have to write functions or operations or some action of real world. Like if you want to know car color, you have to write a function which will return color of the cars. That's it. Here a sample of class is given below:
public class car{
String color;
double price;
String model;
String getCarColor(){
}
double getCarPrice(){
}
}
Defining a class
Variable types in a class
A class can contain any of the following variable types.
- Local variables: Variables defined inside methods, constructors or blocks are called local variables. The variable will be declared and initialized within the method and the variable will be destroyed when the method has completed.
- Instance variables: Instance variables are variables within a class but outside any method. These variables are initialized when the class is instantiated. Instance variables can be accessed from inside any method, constructor or blocks of that particular class.
- Class variables: Class variables are variables declared with in a class, outside any method, with the static keyword.
A class can have any number of methods to access the value of various kinds of methods. In the above example, barking(), hungry() and sleeping() are methods.
Input/ Output devices
Let’s examine some I/O devices in more detail. The most common input devices are the keyboard and the mouse. Others include:
- bar code readers, such as the ones used at a grocery store checkout
- joysticks, often used for games and advanced graphical applications
- microphones, used by voice recognition systems that interpret simple voice commands
- virtual reality devices, such as gloves that interpret the movement of the user’s hand
- scanners, which convert text, photographs, and graphics into machinereadable form
Monitors and printers are the most common output devices. Others include:
- plotters, which move pens across large sheets of paper (or vice versa)
- speakers, for audio output
- goggles, for virtual reality display
Some devices can provide both input and output capabilities. A touch screen system can detect the user touching the screen at a particular place. Software can then use the screen to display text and graphics in response to the user’s touch. Touch screens are particularly useful in situations where the interface to the machine must be simple, such as at an information booth.
Why Java Programming Language has been named as Java?
What is Java?
Everyone who has a brief knowledge of computer is familiar with Java. Java, the most widely used object oriented programming language nowadays.
Here is a brief introduction to java.
Java is an Object Oriented Programming language released by Sun Microsystems in 1995. Now java has reached to its peak time. A team of engineers initiated it, known as Green team. Java is fast,secure and reliable language.
Why it is java?
Originally java was called Oak, after the tree that stood outside of Gosling’s office, the name was changed because of a copyright already owned by Oak technologies. Other names that were considered were Green, DNA, Silk, Neon, Pepper, Lyric, NetProse, WRL (WebRunner Language), WebDancer, and WebSpinner. The team was looking for something fresh and wanted to avoid so called “nerdy names” with Net or Web in them. It is highly contested who actually suggested the name Java, which reflected the teams’ love for coffee.
No comments:
Post a Comment