`

Data Access, Manipulation, and Binding (openlaszlo)

阅读更多

5. Data Access, Manipulation, and Binding

LZX is designed to make it easy to write data-driven applications in which the values of data sources define the appearance and actions of the program. It does this through tags and APIs that allow you to get access to data over http, manipulate XML data in memory, and, significantly, bind the data hierarchy to the view hierarchy.

The following paragraphs summarize these key features of the LZX data-handling architecture. Chapter 36, Data, XML, and XPath discusses this subject in depth.

 

5.1. Data Access

LZX programs manipulate XML-formatted data, which may be

  • embedded in the program text,

  • read in from a source when the program is compiled, or

  • read in from a source when the program is running.

XML sources are stored as objects called datasets. The <dataset> tag has attributes that allow you to, for example, control caching on the client and server, include or exclude http headers, queue requests, and so forth. Objects created by <dataset> are called lz.datasets. Methods on lz.datasets allow you to, for example, get and set query strings, parameters and so forth.

 

5.2.  Data Manipulation

LZX employs datapointers, which are objects that represent pointers to nodes in datasets, to locate and manipulate content. Datapointers support a subset of XPath, which is a W3C standard specification for identifying paths of an XML document, or in the case of LZX, datasets. XPath uses a notation similar to the UNIX file-system to refer to nodes within a dataset. Datapointers can be repositioned using both procedural calls such as selectNext() and by running an XPath request using setXPath().

Because it incorporates 精密的pattern matching, XPath notation is extremely 简明的and powerful. A single XPath expression can represent an 任意的large number of XML elements. Using methods such as addNode(), setNodeName(), setXpath(), and selectParent(), you can build and manipulate XML structures.

 

5.3. Data Binding

LZX provides a unique way of merging any arbitrarily shaped data hierarchy with any display hierarchy; this capability is called data binding. It is implemented in such a way that the data context of a child in the display hierarchy is implicitly the data context of its parent. Moreover, it is possible to 告知the system to create an arbitrary bit of view hierarchy to represent each element in a set of selected data.

The way this is done is by binding views to datapointers. A datapath is a special case of datapointer that 明确的marries the data hierarchy to the view hierarchy, as in, for example:

<view name="bob" datapath="testdata:/*">

where testdata refers to a dataset defined earlier in the program.

If this sounds a little abstract, well, it is. Therefore we'll keep the discussion short here and defer longer explanations to Chapter 37, Data Access and Binding; you may also want to examine some of the examples on http://www.laszlosystems.com/demos to get a feel for what can be done when applications are truly data-driven.

The key thing to understand is that while other languages and technologies have implemented merge algorithms that may appear similar on the surface, LZX's data binding is novel in the creation of program objects that retain a live connection with the entities of the data source.

 

分享到:
评论

相关推荐

    PyPI 官网下载 | data_manipulation-0.17.tar.gz

    本资源提供的"PyPI 官网下载 | data_manipulation-0.17.tar.gz"是Python的一个库,名为"data_manipulation",版本号为0.17,可以从Python的官方包索引(Python Package Index, PyPI)获取。 PyPI是Python开发者发布...

    Data_Manipulation_with_R

    5. **Bayesian Computation with R, Interactive and Dynamic Graphics for Data Analysis: With R and GGobi, Bioconductor Case Studies** 等列举的书籍标题 - 这些书籍代表了R语言在不同应用领域的深入研究和实践...

    Learning pandas - Second Edition

    How to access data from external sources such as files, databases, and web services Represent and manipulate time-series data and the many of the intricacies involved with this type of data How to ...

    Data Manipulation with R 2nd 原版PDF by Abedin & Das

    This book, Data Manipulation with R, is aimed at giving intermediate-to-advanced level users of R (who have knowledge about datasets) an opportunity to use state-of-the-art approaches in data ...

    r语言-data-manipulation.rar

    r语言-data_manipulation.rar

    Data-Manipulation-in-Python---Master-Python-NumPy-and-Pandas

    Data-Manipulation-in-Python---Master-Python-NumPy-and-Pandas-main

    Data Manipulation with R(PACKT,2ed,2015)

    By the end of this book, you will have learned about text manipulation using stringr, how to extract data from twitter using twitteR library, how to clean raw data, and how to structure your raw data ...

    Data Manipulation with R [eBook]_r_data_

    《Data Manipulation with R》是一本专注于使用R语言进行数据操作的电子书,它深入探讨了如何有效地在R环境中处理和分析数据。R语言作为一款强大的统计计算和图形生成工具,已经成为数据科学家和统计学家的首选语言...

    A_Toolbox_for_Non-Tabular_Data_Manipulation_rlist.zip

    A_Toolbox_for_Non-Tabular_Data_Manipulation_rlist

    Beginning Data Science in R

    This book teaches you techniques for both data manipulation and visualization and shows you the best way for developing new software packages for R. Beginning Data Science in R details how data ...

    Data Manipulation With R

    5. **外部库**:考虑使用专门针对性能优化的第三方包,如data.table。 #### 四、案例研究与实践指南 本书通过一系列实例和练习帮助读者深入理解各种数据操作技巧。这些案例涵盖了不同领域的实际问题,比如生物医学...

    SAS Programming 2_ Data Manipulation Techniques

    《SAS Programming 2: Data Manipulation Techniques》是SAS编程的一门进阶课程,主要讲述数据处理和操作的技巧和方法。在本课程中,学员将学习如何使用SAS软件进行更高级的数据操作,包括但不限于对数据集的控制、...

    data manipulation with R

    "data manipulation with R"这个主题涵盖了如何有效地使用R语言对数据进行清洗、转换和探索,这对于任何需要处理数据的项目都是至关重要的。在这个基础且实用的教程中,我们将深入探讨R中的几个关键库和函数,它们是...

    Python Data Analytics Data Analysis and Science Using Pandas, matplotlib, and

    pandas: Reading and Writing Data....Pages 103-130 pandas in Depth: Data Manipulation....Pages 131-165 Data Visualization with matplotlib....Pages 167-235 Machine Learning with scikit-learn....Pages ...

    Spring Data: Modern Data Access for Enterprise Java

    This book is intended to give you a hands-on introduction to the Spring Data project, whose core mission is to ...and manipulation tools but also use traditional databases in a state-of-the-art manner.

Global site tag (gtag.js) - Google Analytics