When building resuable services for your SOA strive to reuse XML schema definitions of business entities. Now, it is next to impossible to get your entire organization to adhere to a single definition of a business entity like say a Customer or Product. However, it is reasonable to aspire to have a single definition of entities within the boundaries of a department. As always, start small – reuse your schema definitions within your application or product line before scaling the practice. If you start reusing schema definitions you will get several benefits:
– align your SOA services with your logical data model
– reuse parsing logic and/or XML-to-Java (or .net) bindings across services
– reduce clutter in WSDL definitions and import schema definitions to reuse data structures
– reuse schema annotations and documentation
When you are designing a service consisting of related capabilities or a family of services within a domain there is definitely an opportunity to reuse schema definitions across operations. E.g. if there is a service for managing products. You could have operations on the service such as getProduct, createProduct, updateProduct, findProduct etc.All these operations could reuse the Product_v1_0.xsd schema definition.
getProduct – could return the Product schema instance
findProduct – could return one to many Product schema instances
createProduct and updateProduct- could take the Product schema instance as input
Similarly if there is a service that links a customer to a product (e.g. placing an order) the product definition can be reused there as well. Strive for reusing your schema definitions based on the needs in your particular domain.