Skip to main content Accessibility help
×
Hostname: page-component-78c5997874-4rdpn Total loading time: 0 Render date: 2024-11-02T22:34:48.776Z Has data issue: false hasContentIssue false

8 - Object data modelling

Published online by Cambridge University Press:  05 February 2015

Tim J. Stevens
Affiliation:
MRC Laboratory of Molecular Biology, Cambridge
Wayne Boucher
Affiliation:
University of Cambridge
Get access

Summary

Data models

This chapter delves more deeply into the topic of creating custom Python objects using class definitions. Given that we have discussed the basics of object-oriented programming in Chapter 7, we now move on to illustrate how such mechanisms can be used in a practical, scientific sense. If you are interested in only a light introduction to Python, you might consider skipping this chapter on a first reading. However, the objects we discuss here will underpin many of the examples given later on in this book, in Chapters 15 and 20, so you may like to look back to see how such things are constructed.

In the previous chapter we saw how to introduce our own types of data object into Python, using classes. Here we move on to look at how to use a number of different, but connected, classes to construct what is often known as a data model. A data model is an abstract description of concepts that can be used to build a computational version of some topic or real-world situation that you are interested in. Essentially, you examine the kind of information you wish to describe and divide it up into conceptual parcels. Each of these will become one kind of computer object (a class with attributes, functions and links to other classes), which then allows you to create a synthetic analogue of the thing you are interested in. Virtually all programs, irrespective of size, rely on some kind of underlying model to organise data, although this may not use object-oriented programming and is often not formalised in any way. No data model can be expected to be a perfect computer representation of what it describes, but the idea is to make it good enough to serve a useful purpose, by having some of the properties of the things being modelled.

Type
Chapter
Information
Python Programming for Biology
Bioinformatics and Beyond
, pp. 117 - 136
Publisher: Cambridge University Press
Print publication year: 2015

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Object data modelling
  • Tim J. Stevens, MRC Laboratory of Molecular Biology, Cambridge, Wayne Boucher, University of Cambridge
  • Book: Python Programming for Biology
  • Online publication: 05 February 2015
  • Chapter DOI: https://doi.org/10.1017/CBO9780511843556.009
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Object data modelling
  • Tim J. Stevens, MRC Laboratory of Molecular Biology, Cambridge, Wayne Boucher, University of Cambridge
  • Book: Python Programming for Biology
  • Online publication: 05 February 2015
  • Chapter DOI: https://doi.org/10.1017/CBO9780511843556.009
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Object data modelling
  • Tim J. Stevens, MRC Laboratory of Molecular Biology, Cambridge, Wayne Boucher, University of Cambridge
  • Book: Python Programming for Biology
  • Online publication: 05 February 2015
  • Chapter DOI: https://doi.org/10.1017/CBO9780511843556.009
Available formats
×