Home arrow SOAP & Web Services arrow Page 4 - Dynamic Data Analysis on the Web-a Design Approach

Filtering and ordering - Web Services

Learn about an adaptable approach which separates programming tasks from Web page design tasks. This strong conceptual model encourages good design, enables re-use of data definitions, and is well-suited to the construction of dynamic user interfaces. The authors also illustrate the particular challenges you might encounter when you dynamically change the analysis performed by Web pages. (This intermediate-level article was first published by IBM developerWorks, August 5, 2004, at http://www.ibm.com/developerWorks).

TABLE OF CONTENTS:
  1. Dynamic Data Analysis on the Web-a Design Approach
  2. Data analysis concepts
  3. Dimensions and measures
  4. Filtering and ordering
  5. Dimension, measure, and slice dimension tags
  6. Presenting data
  7. Value formatting tags
  8. Use of JavaBeans to provide dynamic values
  9. Reporting common errors
  10. Tag containment
  11. Custom tags: lightweight, cheap, replaceable
  12. Benefits of this design approach
  13. In conclusion
By: developerWorks
Rating: starstarstarstarstar / 15
December 29, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

When focusing on a subset of data, such as one particular sales region, filtering is required. You might achieve filtering by specifying data to be included or less commonly, data to be excluded. You need to identify the dimensions to be tested for the values.

It is often useful to present data in a certain sequence so the ability to specify the order in which slices and rows within each slice are returned is required. Alphabetic ordering uses the lexicographic sequence of values, while numeric ordering works by numeric comparison. Other custom orderings are also possible. Ordering might be in ascending or descending sequence.

The conceptual model for data

To enable the page author to express data requirements in the terms described above, a set of custom JSP tags can be provided. The programmer will need to implement a tag handler for each of the custom tags and create a tag library descriptor file, which defines the custom tags and associates each custom tag with its tag handler. When you contruct a Web page, you can embed the custom JSP tags, and identify the appropriate tag library descriptor along with a prefix used to distinguish this set of custom tags.

A well designed custom tag library closely reflects the conceptual model to the page author. Listing 1 shows a set of custom tags that present the OLAP-like data model described above. In this example, a data source is identified along with the dimensions and measures which are required for a particular analysis, and the slice dimensions, filters, and orderings which are to be applied.

Listing 1. A representative set of data definition tags


<%@ taglib uri="/WEB-INF/tlds/dd.tld" prefix="dd" %>

<dd:data id="sales">
  <dd:dataSource>Sales Figures</dd:dataSource>

  <dd:dimensions>
    <dd:dimension>Year</dd:dimension>
    <dd:dimension>Product</dd:dimension>
  </dd:dimensions>

  <dd:measures>
    <dd:measure>Unit Sales</dd:measure>
    <dd:measure>Revenue</dd:measure>
  </dd:measures>

  <dd:sliceDimensions>
    <dd:dimension>Product</dd:dimension>
  </dd:sliceDimensions>

  <dd:filters>
    <dd:includeFilter>
      <dd:dimension>Sales Region</dd:dimension>
      <dd:value>North</dd:value>
    </dd:includeFilter>
  </dd:filters>

  <dd:orderings>
    <dd:numericOrdering>
      <dd:dimension>Year</dd:dimension>
    </dd:numericOrdering>
    <dd:numericOrdering direction="descending">
      <dd:measure>Unit Sales</dd:measure>
    </dd:numericOrdering>
  </dd:orderings>
</dd:data>

Taglib directive, data, and data source tags

In Listing 1, the taglib directive establishes the scope of the data definition tags within the JSP with a prefix here of dd.

The data tag acts as a container for all the other data definition tags, which together define the required data and how the results are to be arranged. The id attribute provides a means of referencing the results, and we shall see how this is used in the Data presentation tags section.

The dataSource tag identifies the name of the data source of interest. The data source must contain all of the dimensions and measures referenced within this data tag.



 
 
>>> More SOAP & Web Services Articles          >>> More By developerWorks
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SOAP & WEB SERVICES ARTICLES

- Google Play Launched to Revive Brand
- Google Releases Preview of its Cloud SQL Ser...
- Microsoft and Amazon Team Up for the Cloud
- GoDaddy Joining the Cloud
- Amazon EBS Outage Challenges Cloud Supporters
- Dynamic Data Analysis on the Web-a Design Ap...
- Use collection types with SOAP and JAX-RPC
- Blogging Away To Glory (A bBlog Primer)
- Introduction to Service Oriented Architectur...
- Connecting Smart Devices on the Internet
- An Embeddable Standards Compliant Web Servic...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: