YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub

YUI 2.x

Ticket #2528127 (closed defect)

Reporter


Christopher Armstrong
Opened: 07/28/09
Last modified: 08/7/09
Status: closed
Type: defect
Resolution: wontfix

Owner


Jenny Han Donnelly
Target Release: 3.0.0 GA
Priority: P3 (normal)
Summary: datasource.io returns an XmlHTTPRequest as the result, but that's a backend-specific object
Description:

I think this is a leaky abstraction, since I'm using DataSource so that my code that needs data doesn't need to care about the backend, but I have to end up using an XHR-specific API (resultText) to
get at the data. This forces me to write my datasource.function implementation to match the shape of an XHR (return {resultText: blahblah}).

Type: defect Observed in Version: 3.0.0 Beta1
Component: DataSource Severity: S3 (normal)
Assigned To: Jenny Han Donnelly Target Release: 3.0.0 GA
Location: Library Code Priority: P3 (normal)
Tags: Relates To:
Browsers: N/A
URL:
Test Information:

Change History

Jenny Han Donnelly

YUI Developer

Posted: 08/6/09
  • location changed to Library Code
  • milestone changed to 3.0.0 GA
  • priority changed to P3 (normal)
  • status changed from new to accepted

Jenny Han Donnelly

YUI Developer

Posted: 08/7/09
  • resolution changed to wontfix
  • status changed from accepted to closed

The DataSource itself is agnostic to the retrieval protocol. This enables DataSource.IO to support XML, JSON, or CSV responses because it simply passes along the response object without having to care about responseText vs responseXML. The normalization happens in the dataschema layer, which does care if it needs responseText or responseXML. Can you use DataSource.Function with a dataschema plugin (http://developer.yahoo.com/yui/3/examples/datasource/datasource_function.html) so that your code is always receiving normalized data?