When to Use View Models

There are two ways to set up a Data Federation data service: by creating a view model in WorkSpace or by writing your own data service plug-in.

Because of its graphical nature and rich user interface, WorkSpace Data Federation is the preferred way to create many data services. However, there are circumstances in which you need to write a custom data service plug-in rather than creating a view model in WorkSpace:


The view-model-based data services that are created in WorkSpace are fundamentally relational in nature; while they can take in nonrelational data, the first step in doing so in WorkSpace is to specify a transformation on that data that yields a relational result. If you want your data service to work or produce results outside the relational paradigm, do one of the following:


For example, you might use Data Federation’s built-in no-operation plug-in to provision a web service’s data as XML, or the XSLT plug-in to use XSLT to process one or more XML inputs. For another format—a data service that does image processing, perhaps—you’d write your own plug-in.

You’ll also need to write your own data service plug-in if you want your data service to return multiple result sets or to perform distributed transactions, in which a group of SQL operations are executed on back-end databases as one transaction. (In Sybase Data Federation, you set up a distributed transaction by configuring a database operation for each SQL operation, then writing a data service plug-in using the transaction API. The resulting data service executes all the database operations as a single transaction.)

For information on distributed transactions, on Data Federation’s built-in data service plug-ins, on data services that return multiple result sets, and on writing your own plug-ins in Java, JavaScript, or XSLT, see the Data Federation Provisioning and Advanced Data Integration Guide, part of the DI Suite documentation set, which is available on the Sybase Product Manuals Web site at http://sybooks.sybase.com.

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.