Reuse schema definitions!

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.

Like this post? Subscribe to RSS feed or get blog updates via email.

add to del.icio.us: Digg it : post to facebook: Stumble It! : :

Advertisements

One Response to Reuse schema definitions!

  1. […] Encapsulate data object so they can use a separate schema: You don’t want to mix web method or service interface level elements with data object related elements. If you keep these separate, it will facilitate reuse of data objects across services (e.g. getCustomer and updateCustomer could both use a Customer data schema definition). […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: