Howdah - An Application using Pylons, PostgreSQL, Simpycity and Exceptable
1,748 views
54 slides
Oct 08, 2010
Slide 1 of 54
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
About This Presentation
Aurynn Shaw
This mini-tutorial covers building a small application on Howdah, an open source, Python based web development framework by Commandprompt, Inc. We will cover the full process of designing a vertically coherent application on Howdah, integrating DB-level stored procedures, DB exception p...
Aurynn Shaw
This mini-tutorial covers building a small application on Howdah, an open source, Python based web development framework by Commandprompt, Inc. We will cover the full process of designing a vertically coherent application on Howdah, integrating DB-level stored procedures, DB exception propagation through Exceptable, DB access through Simpycity, authentication through repoze.who, permissions through VerticallyChallenged, and application views through Pylons. By the end of the talk, we will have covered a full application built on The Stack, and how to cover common pitfalls in using Howdah components.
Size: 3.65 MB
Language: en
Added: Oct 08, 2010
Slides: 54 pages
Slide Content
HOWDAH
A tutorial
Tuesday, October 20, 2009
Why?
Howdah is for people who really “get” databases
Howdah treats your database as code. Procedures,
and hand-written SQL.
Would you automate python generation? Then why
SQL?
Just because it’s not code you’re comfortable with,
doesn’t make it any less code.
2
Tuesday, October 20, 2009
What shall we build?
Today, we’ll be talking about designing and
implementing a Wiki.
3
Tuesday, October 20, 2009
Why a Wiki?
Canonical example
Simple enough to define in an afternoon
Complex enough to require in-depth exploration
4
Tuesday, October 20, 2009
Why a Wiki?
Public and Private permissions/users
Read/write collaborative model
5
Tuesday, October 20, 2009
Design vs. Code
Speaking more on Design than on Code
Why is more important than How.
How is still important
6
Tuesday, October 20, 2009
STEP 1:
DESIGN
7
Tuesday, October 20, 2009
Database
What do we need?
8
Tuesday, October 20, 2009
Application
What do we need?
9
Tuesday, October 20, 2009
Application
What do we need?
Anything else? Did we miss anything?
10
Tuesday, October 20, 2009
STEP 2:
REVISIT
11
Tuesday, October 20, 2009
Database
Based on our Application design, what expansions do
we need?
12
Tuesday, October 20, 2009
Database
Based on our Application design, what expansions do
we need?
Why do we need them?
13
Tuesday, October 20, 2009
Application
With the new DB features, what changes?
14
Tuesday, October 20, 2009
Application
With the new DB features, what changes?
What new ideas are evident?
15
Tuesday, October 20, 2009
Application
With the new DB features, what changes?
What new ideas are evident?
Do the changes make things easier?
16
Tuesday, October 20, 2009
STEP 3:
API CONTRACTS
17
Tuesday, October 20, 2009
Database
Defining our API
What stored procedures do we need?
18
Tuesday, October 20, 2009
Database
Defining our API
What stored procedures do we need?
What should they do?
19
Tuesday, October 20, 2009
Database
Defining our API
What exceptions do we need?
20
Tuesday, October 20, 2009
Database
Defining our API
What exceptions do we need?
Null data
Bad data
No such record
21
Tuesday, October 20, 2009
Application
Defining our API
What models do we need?
22
Tuesday, October 20, 2009
Application
Defining our API
What exceptions do we need?
23
Tuesday, October 20, 2009
Application
Defining our API
What exceptions do we need?
What do DB exceptions become?
What HTTP responses should the exceptions
raise?
24
Tuesday, October 20, 2009
Application
Defining our API
What views do we need?
25
Tuesday, October 20, 2009
Application
Defining our API
What views do we need?
What views are read-only? Read-write? Write-only?
26
Tuesday, October 20, 2009
STEP 4:
FIRST EXPANSION
USERS
27
Tuesday, October 20, 2009
Database
Users
User system!
28
Tuesday, October 20, 2009
Database
Users
User system!
VerticallyChallenged for users
29
Tuesday, October 20, 2009
Database
Users
User system!
VerticallyChallenged for users
How to set up VC
30
Tuesday, October 20, 2009
Database
Users
Stored Procedures - How do we adapt them?
How does this affect our API contract?
31
Tuesday, October 20, 2009
Application
Users
Using @needs to define permissions
How should views be protected?
32
Tuesday, October 20, 2009
Application
Users
Using @needs to define permissions
How should views be protected?
Should anonymous users have write permission?
33
Tuesday, October 20, 2009
Application
Users
Permissions violations
What should no user return?
What should a bad user return?
What should insufficient permissions return?
34
Tuesday, October 20, 2009
Application
Users
Why - Are there better mechanisms?
35
Tuesday, October 20, 2009
STEP 5:
ADMINISTRATIVE
USERS
36
Tuesday, October 20, 2009
Database
Administrators
What delineates an admin?
What special things can an admin do?
Should admins be otherwise normal users?
37
Tuesday, October 20, 2009
Database
Administrators
Root-level permissions:
Should the database superuser ever be allowed to log
in from the web app?
38
Tuesday, October 20, 2009
Database
Administrators
Root-level permissions:
Should the database superuser ever be allowed to log
in from the web app?
Why?
39
Tuesday, October 20, 2009
Application
Administrators
What delineates an Admin?
40
Tuesday, October 20, 2009
Application
Administrators
Design
Are there special admin-only views?
How do we protect admin privileges?
Are there user-specific views? Do admins have
permission to access those?
Is anything changed by the DB layer?
41
Tuesday, October 20, 2009
Application
Administrators
Should administrators be able to view everything?
42
Tuesday, October 20, 2009
Application
Administrators
Should administrators be able to view everything?
What about privileged information?
HIPAA, lawyer confidentiality
43
Tuesday, October 20, 2009
Application
Administrators
Should administrators be able to view everything?
What about privileged information?
HIPAA, lawyer confidentiality
How can we protect privileged information like this?
Can we ever guarantee protection? How?
44
Tuesday, October 20, 2009
STEP 6:
A NEW FEATURE
45
Tuesday, October 20, 2009
A New Feature
Let’s add a user profile page
Specifically list the pages that a user has edited
46
Tuesday, October 20, 2009
Database
A New Feature
Design first!
47
Tuesday, October 20, 2009
Database
A New Feature
Design first!
Do we need new stored procedures?
What are they?
Who has access to them?
Does this require write access?
48
Tuesday, October 20, 2009
Application
A New Feature
What does the app need to support this?
49
Tuesday, October 20, 2009
Application
A New Feature
What does the app need to support this?
What views do we need?
50
Tuesday, October 20, 2009
Application
A New Feature
What does the app need to support this?
What views do we need?
Who has access to the views?
Logged-in users only?
51
Tuesday, October 20, 2009
Application
A New Feature
What about security and data confidentiality?
What security issues could be present?
52
Tuesday, October 20, 2009
Application
A New Feature
What about security and data confidentiality?
What security issues could be present?
Do we list entries that a user may not have read
access to?
53
Tuesday, October 20, 2009
Application
A New Feature
What about security and data confidentiality?
What security issues could be present?
Do we list entries that a user may not have read
access to?
Should we list nothing, instead?
Why do it like this? Are there better solutions?
54
Tuesday, October 20, 2009