Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Writing an application and de... > Data modeling and duck typing

4.1. Data modeling and duck typing

Computer science has many difficult problems, but one problem central to many applications is data modeling. Data modeling means structuring and organizing data, both for a computer to be able to work with the data and to make it possible to coherently present the data to humans. This means finding the right way of representing the data. The structures you choose must be a good fit, and you must provide the right API for accessing and modifying the data.

The built-in datatypes, such as the list and the dictionary, provide straightforward ways of accessing data. They even have syntax built into the language for doing so. Data modeling in Python is often done by creating structures that reuse the same way of accessing the underlying information. In .NET languages, you might provide data access by implementing interfaces; Python achieves the same thing using protocols.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint