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. )
(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. ...)
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 .....
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....
✔Crimson
✔Xerscer
✔Oracle v2 Parser etc....
Jax-p api designed completely based on abstract factory design pattern. ....
Comments
Post a Comment