PyCon 2012 - Data Driven Design
-
Upload
maksym-klymyshyn -
Category
Documents
-
view
254 -
download
1
description
Transcript of PyCon 2012 - Data Driven Design
Data Driven DesignBuild app design around dataflow rather than program flow
Max KlymyshynCTO at GVMachines
tweet tweet @maxmaxmaxmax
What's the problem?
Handling many of different data sources and keep context
Typical task for this approach
Random picture from Google
Yup, honestly it's depend on the task.
There's a lot of examples of data-driven programming around.
The most known example isDjango Middleware
Really?
So, let's go deeper
Data Drivenprogramming
definition
Data driven programming is a programming model where
the data itself controls the flow of the program and not the program logic
What is Data Driven programming
Data Driven definition is quite strict.
Typically it's mixed with other approaches
Not so strict
Real world tasksample usage
I want to grab weather from different sources and display only sunny days of the month
Show only sunny days in the month
To grab data we should define pipeline - the way our data going to go
Pipeline
Pipeline
Grab Parse Validate Display
In detailsGrab
Parse
Fetch data from weather.com
Fetch data from pogoda.yandex.ua
Fetch data from weather.yahooapis.com
Parse weather.com
Parse pogoda.yandex.ua
Parase api.aerisapi.com
Validate Pass sunny days only
At this moment we have only sunny days to display
Pipeline
Approacheswhen this may be be effective?
ifttt.comifttt is a web service platform that connects various web services together to automate common tasks on the web
If this then that
When you have a lot of mostly similar data from different sources
You need to keep only data which matters for you
Various sources
In case you need to generate a lot of similar data sets filtered by many of params
Data slices generation
In general, approach is the same as usage of UNIX pipes:
cat file.dat | grep something | sed 's/xxx/yyy/g'
Pipes
Summary
Grab Parse Validate Display
https://github.com/joymax/data-driven-design
Example
That's all, thank you.
Questions?
tweet tweet @maxmaxmaxmax
Github: joymax