Skip to main content

Why jax-p api is given by sun people ?

Why jax-p api is given by sun people ?
👉in simple way jax-p is an Api which is basically used for to read the content of Xml. ......but now we have to know why jax-p is came even though there is any other way is available to read the content of Xml. ..
🌎Think how many way we can read the content of Xml ?
1 . By using FileInputStream...
(But here problem is as a programmer we have to write the complicated logic to read Xml by FileInputStream..For multiple times and code will be duplicate also. ..so which is not a good approach. )
2 . By using 3rd party libreries
Means
Xml4j
DOM4j etc...
(But here is again we face problem. Here we can avoid code duplication but problem is code is not reusablity means Suppose I developed my project based on Xml4j .but Xml4j have certain limitation I.e it can't read Xml if that Xml contain more than 1lkh element. .so to avoid this I want to use DOM4j insted of Xml4j. ...so in that case we have to rewrite the code again. .....
Which affects more in case of mentainance,and testing which increases the cost of projects. ...)
So to overcome this problem sun people develop an interesting api called as jax-p. Which support 2 api to read content of Xml in easy way and less time. .I.e
SAXParser and DOMParser .....
And we can get direct support of jax-p in 1.5....but this features is available onwords jdk 1.4....
And for this Api several 3rd party vender provide implementation to get access to jax-p api like 
✔Crimson
✔Xerscer
✔Oracle v2 Parser etc....
Jax-p api designed completely based on abstract factory design pattern. ....

Comments

Popular posts from this blog

Mockito interview Questions

1.       Question 1. What Is Mockito? Answer : Mockito allows creation of mock object for the purpose of Test Driven Development and Behavior Driven development. Unlike creating actual object, Mockito allows creation of fake object (external dependencies) which allows it to give consistent results to a given invocation. 2.       Question 2. Why Do We Need Mockito? What Are The Advantages? Answer : Mockito differentiates itself from the other testing framework by removing the expectation beforehand. So, by doing this, it reduces the coupling. Most of the testing framework works on the "expect-run-verify". Mockito allows it to make it "run-verify" framework. Mockito also provides annotation which allows to reduce the boilerplate code. 3.       Question 3. Can You Explain A Mockito Framework? Answer : In Mockito, you always check a particular class. The dependency in that class is injected using m...

JAVA Expert Interview Questions Answers 2017

Java Basics ::  Interview Questions and Answers Home  »  Interview Questions  »  Technical Interview  »  Java Basics  » Interview Questions 1.     What is the difference between a constructor and a method? A constructor is a member function of a class that is used to create objects of that class. It has the same name as the class itself, has no return type, and is invoked using the new operator. A method is an ordinary member function of a class. It has its own name, a return type (which may be void), and is invoked using the dot operator. 2.     What is the purpose of garbage collection in Java, and when is it used? The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used. 3.  ...

Java Example Program to Convert List to Set

import java.util.ArrayList; import java.util.HashSet; import java.util.Set; public class ListToSet {  /**   * @author Amarjit Kumar   * @category interview questions   *   * Description: Convert List to set in java with example program   *   */  public static void main(String[] args) {   ArrayList<String> arrList= new ArrayList<>();   arrList.add("Java");   arrList.add("Java");   arrList.add("List to String");   arrList.add("Example Program");   Set<String> strSet = new HashSet<String>(arrList);   System.out.println(strSet);   System.out.println(arrList);  } } /*  * Java program to convert list to set. Convert ArrayList of string to HashSet  * in java example program How to convert List to Set in java Set<String> strSet  * = new HashSet<String>(arrList); HashSet having a constructor which will take  * list as an ar...