deme presentation at stanford open source (un)conference '08

50
Motivation Architecture Implementation Demo Deme Architecture Todd Davies Mike Mintz Stanford University Stanford Open Source (un)conference ’08 Davies, Mintz Deme Architecture

Upload: mikemintz

Post on 15-Jan-2015

587 views

Category:

Education


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Deme Architecture

Todd Davies Mike Mintz

Stanford University

Stanford Open Source (un)conference ’08

Davies, Mintz Deme Architecture

Page 2: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Outline

1 Motivation

2 ArchitectureItem StructureItem OntologyViewers

3 Implementation

4 Demo

Davies, Mintz Deme Architecture

Page 3: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Outline

1 Motivation

2 ArchitectureItem StructureItem OntologyViewers

3 Implementation

4 Demo

Davies, Mintz Deme Architecture

Page 4: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Outline

1 Motivation

2 ArchitectureItem StructureItem OntologyViewers

3 Implementation

4 Demo

Davies, Mintz Deme Architecture

Page 5: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Outline

1 Motivation

2 ArchitectureItem StructureItem OntologyViewers

3 Implementation

4 Demo

Davies, Mintz Deme Architecture

Page 6: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Objectives

Hierarchy of item types with shared functionalityVersioning for every item type

Not just documentsHighly collaborative

Every item type supports discussion

Very granular permissionsEasily ExtensibleEmbedded views

Davies, Mintz Deme Architecture

Page 7: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Objectives

Hierarchy of item types with shared functionalityVersioning for every item type

Not just documentsHighly collaborative

Every item type supports discussion

Very granular permissionsEasily ExtensibleEmbedded views

Davies, Mintz Deme Architecture

Page 8: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Objectives

Hierarchy of item types with shared functionalityVersioning for every item type

Not just documentsHighly collaborative

Every item type supports discussion

Very granular permissionsEasily ExtensibleEmbedded views

Davies, Mintz Deme Architecture

Page 9: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Objectives

Hierarchy of item types with shared functionalityVersioning for every item type

Not just documentsHighly collaborative

Every item type supports discussion

Very granular permissionsEasily ExtensibleEmbedded views

Davies, Mintz Deme Architecture

Page 10: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Objectives

Hierarchy of item types with shared functionalityVersioning for every item type

Not just documentsHighly collaborative

Every item type supports discussion

Very granular permissionsEasily ExtensibleEmbedded views

Davies, Mintz Deme Architecture

Page 11: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Objectives

Hierarchy of item types with shared functionalityVersioning for every item type

Not just documentsHighly collaborative

Every item type supports discussion

Very granular permissionsEasily ExtensibleEmbedded views

Davies, Mintz Deme Architecture

Page 12: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Outline

1 Motivation

2 ArchitectureItem StructureItem OntologyViewers

3 Implementation

4 Demo

Davies, Mintz Deme Architecture

Page 13: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

What is an item?

All persistent data abstracted as itemsE.g., documents, users, settings, etc.

Items are instances of “item types”Item types specify structure of fieldsItems provide values for fields

E.g. “Person” is item type, “Mike” and “Todd” are items ofthat typeFirst Name Last Name

Mike MintzTodd Davies

Davies, Mintz Deme Architecture

Page 14: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

What is an item?

All persistent data abstracted as itemsE.g., documents, users, settings, etc.

Items are instances of “item types”Item types specify structure of fieldsItems provide values for fields

E.g. “Person” is item type, “Mike” and “Todd” are items ofthat typeFirst Name Last Name

Mike MintzTodd Davies

Davies, Mintz Deme Architecture

Page 15: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

What is an item?

All persistent data abstracted as itemsE.g., documents, users, settings, etc.

Items are instances of “item types”Item types specify structure of fieldsItems provide values for fields

E.g. “Person” is item type, “Mike” and “Todd” are items ofthat typeFirst Name Last Name

Mike MintzTodd Davies

Davies, Mintz Deme Architecture

Page 16: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Item inheritance

Item types can inherit from other item types“Item” is at top of the hierarchyE.g., Item -> Document -> Comment

Item types inherit existing fields, add additional fieldsItem: name, descriptionDocument: name, description, bodyComment: name, description, body, commented_item

Davies, Mintz Deme Architecture

Page 17: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Item inheritance

Item types can inherit from other item types“Item” is at top of the hierarchyE.g., Item -> Document -> Comment

Item types inherit existing fields, add additional fieldsItem: name, descriptionDocument: name, description, bodyComment: name, description, body, commented_item

Davies, Mintz Deme Architecture

Page 18: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Outline

1 Motivation

2 ArchitectureItem StructureItem OntologyViewers

3 Implementation

4 Demo

Davies, Mintz Deme Architecture

Page 19: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Overview

AgentsCollectionsDocumentsRelationshipsPermissionsURLs

Davies, Mintz Deme Architecture

Page 20: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

All Items

All items share metadata structure:Unique IDNameDescriptionCreator / Create TimeUpdater / Update TimeVersionsTrashed?

Davies, Mintz Deme Architecture

Page 21: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Agents

AgentsItem that can “do” things

(Given permissions, can appear as creator/updater)

Application user is always a specific AgentSubclasses: Person, AnonymousAgent, Group

GroupsCollection of AgentsMembers can share common permissions

AccountsChannel of authenticationSubclasses: PasswordAccount, OpenId

Davies, Mintz Deme Architecture

Page 22: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Agents

AgentsItem that can “do” things

(Given permissions, can appear as creator/updater)

Application user is always a specific AgentSubclasses: Person, AnonymousAgent, Group

GroupsCollection of AgentsMembers can share common permissions

AccountsChannel of authenticationSubclasses: PasswordAccount, OpenId

Davies, Mintz Deme Architecture

Page 23: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Agents

AgentsItem that can “do” things

(Given permissions, can appear as creator/updater)

Application user is always a specific AgentSubclasses: Person, AnonymousAgent, Group

GroupsCollection of AgentsMembers can share common permissions

AccountsChannel of authenticationSubclasses: PasswordAccount, OpenId

Davies, Mintz Deme Architecture

Page 24: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Collections

ItemSetsArbitrary collection of itemsSubclasses: Folio

FolioEvery group has one folioContains items shared among all members

Davies, Mintz Deme Architecture

Page 25: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Collections

ItemSetsArbitrary collection of itemsSubclasses: Folio

FolioEvery group has one folioContains items shared among all members

Davies, Mintz Deme Architecture

Page 26: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Documents

Main unit of collaborative workDifferent item types for different formatsSubclasses

TextDocumentHtmlDocumentDjangoTemplateDocumentComment

FileDocumentImageDocument

Comments refer to other ItemsSometimes specific versions and locations

Davies, Mintz Deme Architecture

Page 27: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Documents

Main unit of collaborative workDifferent item types for different formatsSubclasses

TextDocumentHtmlDocumentDjangoTemplateDocumentComment

FileDocumentImageDocument

Comments refer to other ItemsSometimes specific versions and locations

Davies, Mintz Deme Architecture

Page 28: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Documents

Main unit of collaborative workDifferent item types for different formatsSubclasses

TextDocumentHtmlDocumentDjangoTemplateDocumentComment

FileDocumentImageDocument

Comments refer to other ItemsSometimes specific versions and locations

Davies, Mintz Deme Architecture

Page 29: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Relationships

Explicit items for relationships between itemsSubclasses: GroupMembership, ItemsetMembership

Davies, Mintz Deme Architecture

Page 30: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Permissions

Specifies who can do what to which itemsAgentAbilityItem

Three levelsDirectGroupwideDefault

RolesCustomizable sets of abilities

Davies, Mintz Deme Architecture

Page 31: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Permissions

Specifies who can do what to which itemsAgentAbilityItem

Three levelsDirectGroupwideDefault

RolesCustomizable sets of abilities

Davies, Mintz Deme Architecture

Page 32: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Permissions

Specifies who can do what to which itemsAgentAbilityItem

Three levelsDirectGroupwideDefault

RolesCustomizable sets of abilities

Davies, Mintz Deme Architecture

Page 33: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Custom URLs

Users can create custom URLs to point to itemsEach domain can have separate namespace of URLs

Davies, Mintz Deme Architecture

Page 34: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Custom URLs

Users can create custom URLs to point to itemsEach domain can have separate namespace of URLs

Davies, Mintz Deme Architecture

Page 35: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Outline

1 Motivation

2 ArchitectureItem StructureItem OntologyViewers

3 Implementation

4 Demo

Davies, Mintz Deme Architecture

Page 36: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

What is a viewer?

A Django class that processes browser or API requestsURLs that begin with /resource/ are routed to viewersViewers handle items of specific typeViewers inherit from other viewers

Everything ultimately inherits from ItemViewerItemViewer is about 80% of view code

Davies, Mintz Deme Architecture

Page 37: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

What is a viewer?

A Django class that processes browser or API requestsURLs that begin with /resource/ are routed to viewersViewers handle items of specific typeViewers inherit from other viewers

Everything ultimately inherits from ItemViewerItemViewer is about 80% of view code

Davies, Mintz Deme Architecture

Page 38: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

What is a viewer?

A Django class that processes browser or API requestsURLs that begin with /resource/ are routed to viewersViewers handle items of specific typeViewers inherit from other viewers

Everything ultimately inherits from ItemViewerItemViewer is about 80% of view code

Davies, Mintz Deme Architecture

Page 39: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

What is a viewer?

A Django class that processes browser or API requestsURLs that begin with /resource/ are routed to viewersViewers handle items of specific typeViewers inherit from other viewers

Everything ultimately inherits from ItemViewerItemViewer is about 80% of view code

Davies, Mintz Deme Architecture

Page 40: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

RESTful URLs

Entry actions/resource/<viewer>/<id>/<action>E.g., /resource/person/5/editE.g., /resource/person/5

Collection actions/resource/<viewer>/<action>E.g., /resource/person/newE.g., /resource/personE.g., /resource/person.json

Davies, Mintz Deme Architecture

Page 41: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

RESTful URLs

Entry actions/resource/<viewer>/<id>/<action>E.g., /resource/person/5/editE.g., /resource/person/5

Collection actions/resource/<viewer>/<action>E.g., /resource/person/newE.g., /resource/personE.g., /resource/person.json

Davies, Mintz Deme Architecture

Page 42: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Authentication

There is always an authenticated agent in a viewer(If user does not log in, it is AnonymousAgent.)

Viewer takes care of checking permissions forauthenticated agent

Davies, Mintz Deme Architecture

Page 43: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Item StructureItem OntologyViewers

Authentication

There is always an authenticated agent in a viewer(If user does not log in, it is AnonymousAgent.)

Viewer takes care of checking permissions forauthenticated agent

Davies, Mintz Deme Architecture

Page 44: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Deme is written in Django

Deme is:A collection of Django modelsA system of hierarchical viewers that use Django templatesAdditional components that handle Deme-specific features

VersioningPermissionsCommenting

Davies, Mintz Deme Architecture

Page 45: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Why Django?

Big developer communityNow supports multi-table inheritance

Davies, Mintz Deme Architecture

Page 46: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Models –> Item types

A Django model corresponds to an item typeAn item is:

A Django model instanceA row in a table

Davies, Mintz Deme Architecture

Page 47: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Models –> Item types

A Django model corresponds to an item typeAn item is:

A Django model instanceA row in a table

Davies, Mintz Deme Architecture

Page 48: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Database Visual

Davies, Mintz Deme Architecture

Page 49: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Versioning

Every table has a dual version-table

PersonID First Name Last Name1 Mike Mintz

PersonVersionID Version First Name Last Name1 1 Michael Mintz1 2 Mike Mintz

Davies, Mintz Deme Architecture

Page 50: Deme Presentation at Stanford Open Source (un)conference '08

MotivationArchitecture

ImplementationDemo

Demo time!

Davies, Mintz Deme Architecture