Skip to main content

Between Types and Tables

Using Generic Programming for Automated Mapping between Data Types and Relational Databases

  • Conference paper
Implementation and Application of Functional Languages (IFL 2008)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5836))

Included in the following conference series:

Abstract

In today’s digital society, information systems play an important role in many organizations. While their construction is a well understood software engineering process, it still requires much engineering effort. The de facto storage mechanism in information systems is the relational database. Although the representation of data in these databases is optimized for efficient storage, it is less suitable for use in the software components that manipulate the data. Therefore, much of the construction of an information system consists of programming translations between the database and a more convenient representation in the software.

In this paper we present an approach which automates this work for data entry applications, by providing generic versions of the elementary CRUD (Create, Read, Update, Delete) operations. In the spirit of model based development we use Object Role Models, which are normally used to design databases, to derive not only a database, but also a set of data types in Clean to hold data during manipulation. These types represent all information related to a conceptual entity as a single value, and contain enough information about the database to enable automatic mapping. For data entry applications this means that all database operations can be handled by a single generic function.

To illustrate the viability of our approach, a prototype library, which performs this mapping, and an example information system have been implemented.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Alimarine, A., Smetsers, S.: Optimizing Generic Functions. In: Kozen, D. (ed.) MPC 2004. LNCS, vol. 3125, pp. 16–31. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  2. Bingert, B., Höckersten, A.: Student paper: Haskelldb improved. In: Proceedings of 2004 ACM SIGPLAN Workshop on Haskell, pp. 108–115. ACM Press, New York (2004)

    Google Scholar 

  3. Chen, P.P.-S.: The entity-relationship model—toward a unified view of data. ACM Trans. Database Syst. 1(1), 9–36 (1976)

    Article  Google Scholar 

  4. Fussel, M.: Foundations of object-relational mapping, Whitepaper (1997), http://www.chimu.com/publications/objectRelational/index.html

  5. Halpin, T.: Information modeling and relational database: from conceptual analysis to logical design. Morgan Kaufmann Publishers Inc., San Francisco (2001)

    Google Scholar 

  6. Janssen, C., Weisbecker, A., Ziegler, J.: Generating user interfaces from data models and dialogue net specifications. In: CHI 1993: Proceedings of the INTERACT 1993 and CHI 1993 Conference on Human Factors in Computing Systems, pp. 418–423. ACM, New York (1993)

    Google Scholar 

  7. Leijen, D., Meijer, E.: Domain specific embedded compilers. In: 2nd USENIX Conference on Domain Specific Languages (DSL 1999), Austin, Texas (October 1999); Also appeared in ACM SIGPLAN Notices 35(1), 109–122 (2000)

    Google Scholar 

  8. Lijnse, B.: Between types and tables: Generic mapping between relational databases and data structures in clean, Master’s thesis, University of Nijmegen, Number 590 (July 2008)

    Google Scholar 

  9. Manoku, E., Zwart, J.P., Bakema, G.: A fact approach to automatic application development. Journal of Conceptual Modeling (2006)

    Google Scholar 

  10. McCormack, J., Halpin, T., Ritson, P.: Automated mapping of conceptual schemas to relational schemas. In: Rolland, C., Cauvet, C., Bodart, F. (eds.) CAiSE 1993. LNCS, vol. 685, pp. 432–448. Springer, Heidelberg (1993)

    Chapter  Google Scholar 

  11. Meijer, E., Beckman, B., Bierman, G.: LINQ: reconciling object, relations and XML in the .NET framework. In: SIGMOD 2006: Proceedings of the 2006 ACM SIGMOD International Conference on Management of Data, pp. 706–706. ACM, New York (2006)

    Google Scholar 

  12. Norell, U.: Dependently typed programming in agda, Tech. Report ICIS-R08008, Radboud University Nijmegen (2008)

    Google Scholar 

  13. Smetsers, S., van Weelden, A., Plasmeijer, R.: Efficient and type-safe generic data storage. In: Proceedings of the 1st Workshop on Generative Technologies, WGT 2008, Budapest, Hungary. Electronic Notes in Theoretical Computer Science (April 2008)

    Google Scholar 

  14. UML version 2.2 specification (February 2009), http://www.omg.org/spec/UML/2.2/

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Lijnse, B., Plasmeijer, R. (2011). Between Types and Tables. In: Scholz, SB., Chitil, O. (eds) Implementation and Application of Functional Languages. IFL 2008. Lecture Notes in Computer Science, vol 5836. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-24452-0_15

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-24452-0_15

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-24451-3

  • Online ISBN: 978-3-642-24452-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics