amolenaar / roles

Library for Role based development
BSD 3-Clause "New" or "Revised" License
57 stars 7 forks source link

Can be DCI implemented with Zope Component Architecture #1

Closed drnow4u closed 4 years ago

drnow4u commented 9 years ago

Dear Arjan,

I recently watch some video presentation about DCI (Data, Context, Interaction) a paradigm used in software development. Obvious next step was to find some DCI implementation in Python. After googling I found Roles project on Github.

My observation is that this DCI paradigm was in Python community since ZOPE and ZCA (Zope Component Architecture). ZCA with adapters and component.queryAdapter() concept is very close to change role idea in DCI. Example from ZCA documentation (http://docs.zope.org/zope.component/narr.html#adapters):

component.queryAdapter(Person("Sally"), IGreeter, 'bob').greet()
component.queryMultiAdapter((Person("Sally"), Person("Bob")), IGreeter).greet()

I'm very interested in your opinion about DCI and ZCA relationship?

Best regards, Marcin

amolenaar commented 9 years ago

Hi Marcin,

I've been using the Zope3 components for my project Gaphor and indeed they work out pretty similar.

The big difference is that in DCI one expects to change the object's behaviour in place whereas Zope adapters do it via wrapping.

The Zope guys definitely have the right mindset, and took a practical way to implement it.