Re: How to edit dexterity types without needing to know about their behaviors
ajung <[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.devel |
|---|---|
| Message-ID | <[email protected]> |
Asko Soukka wrote > Wichert Akkerman wrote: >> On 13 Mar 2014, at 14:22, Johannes Raggam < > raggam-nl@ > > wrote: >>> On Thu, 2014-03-13 at 14:13 +0100, Wichert Akkerman wrote: >>>> On 13 Mar 2014, at 14:08, Martin Aspeli < > optilude@ > > wrote: >>>>> I don't understand the problem. How would magic attribute resolution >>>>> be better than something described in an interface using the adapter >>>>> patten? >>>> Why is an adapter necessary for standard attributes like the start time >>>> for an event? I don’t understand that part. >>> look here: >>> https://github.com/plone/plone.app.event/blob/master/plone/app/event/dx/behaviors.py#L341 >> >> Why not just use an event base class or mixin instead of a behaviour? >> That way you get the property normally and don’t force people to play >> adapter-games. > > As I interpreted the issue from Andreas' post, we have now different > "classes" of attributes. > > Some can be accessed and set directly without adaptation. Other cannot. This is the whole key issue. Direct set/get access is one of the key Dexterity paradigms. Being more pythonic was one of the design goals of Dexterity. Direct access is what we prayed, what we learned and what we thought to other people. There is no way out of this paradigm - no exceptions - no excuses - never ever. There can not be a difference between first-class and second-class attributes (introduced through a behavior). And there is no need for a developer to lookup specific behaviors or interfaces for getting and setting values of a content-type instance. Consistency is king, ease-of-use is king - no exceptions. Philipp fired "RTFM" last night at me. I just answer "why"? We learned that direct attribute is the way to go modify content-type instance....why should I, why should Plone non-core developers be obliged to check the implementation of every possible content-type for exceptions? So there are just two options: we stick with the direct atttribute access pattern as proclaimed for year or we say "sorry", our approach is flawed and we need a consistent API. I can only emphasize once more that this is such an important key issue - especially when you want to marked Plone to other developers. The team I am coaching right know would only their eyes. Consistency-is-king Andreas -- View this message in context: http://plone.293351.n2.nabble.com/How-to-edit-dexterity-types-without-needing-to-know-about-their-behaviors-tp7570571p7570622.html Sent from the Core Developers mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ Plone-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plone-developers