March 13, 2014

Bad Dexterity application design - what the fuck?

I apologize for another Plone rant but the following issue costed my some nerves and customer money.

We are currently leading a large Plone 2 -> Plone 4.3 + Dexterity project and we are using

According to every documentation and knowledge about Dexterity we created our events in our migration script using

event = invokeFactory('Event', ..)
event.start = datetime(....)
event.end = datetime(...)

We all learned that you can set/get the value of a content-type directly through attribute access. Unfortunately those events resulted in a broken view.

It turned out that you can not modify the start and end properties of an Event instance directly but instead you have modify then through a behavior:

from plone.event.interfaces import IEventAccessor
acc = IEventAccessor(event)
acc.start = DateTime()
acc.end = DateTime()

But how bad is this? First, no documentation but much more worse: do I have for every single content-type and for every property the way how to modify it? Do I need to figure out if access attribute is the way to go or some other way (like through the behavior interface)? This approach is completely absurd. It is completely absurd for 1.X release. It is completely absurd having to teach this people developing with Plone without in-depth background. Wasn't Dexterity invented with the goal for making programming content-types in Plone much easier? Now this!? You guys are serious?