File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes 1 schema file or multiple schema files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "1 schema file or multiple schema files" Watch "1 schema file or multiple schema files" New topic

1 schema file or multiple schema files

Pankaj Kumarkk
Ranch Hand

Joined: Apr 17, 2011
Posts: 110
I am setting up a web services project. One questions which I have to take decision on is "should I maintain 1 schema file or multiple schema file"

Advantages of 1 schema file:
1. Easier to control: Schema definitions should be managed in a controlled manner as a small change can impact multiple services. Having 1 schema file helps manage schema file easily
2. Promotes reuse

Advantages of multiple schema file:
1. Can componentize schemas based on functional components. Thus easier to present smaller schema to client apps based on services they use.
2. Can present specific schema to the customers
3. Promotes reuse

I am tending towards below:
Start with a small number of schema (say a commonschema.xsd and applicationschema.xsd) and then divide applicationschema.xsd into multiple based on if there are clients which uses partial functionality.

I am looking at suggestions/opinions regarding this approach. Also if there are any other advantages each of approach(1 schema vs multiple schema) have
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
I suspect there is not much to add - you have a good grasp of the problem and have proposed a very reasonable strategy!
Remember that not only XML schemas, but also WSDL files can be split into multiple files. For instance, one WSDL file may specify the abstract interface of the web service while another specifies the more concrete aspects, such as the endpoint address etc.
Best wishes!

My free books and tutorials:
I agree. Here's the link:
subject: 1 schema file or multiple schema files
It's not a secret anymore!