惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
量子位
月光博客
月光博客
人人都是产品经理
人人都是产品经理
U
Unit 42
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
H
Help Net Security
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
MyScale Blog
MyScale Blog
美团技术团队
P
Proofpoint News Feed
Apple Machine Learning Research
Apple Machine Learning Research
D
Docker
B
Blog
大猫的无限游戏
大猫的无限游戏
V
Visual Studio Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog

Secret Weblog

Becoming More Xee: A Modern XPath and XSLT Engine in Rust Looking for new challenges! Repeat Yourself, A Bit The Curious Case of Quentell The Humble For Loop in Rust The Humble For Loop in JavaScript Don Question Best Practices I Was a 1980s Teenage Programmer Part 5: Achieving Assembly I Was a 1980s Teenage Programmer Part 4: The Call of Assembly The Tooling Shift I Was a 1980s Teenage Programmer Part 3: MSX-2 JavaScript: when you need two ways to do it! Empowering Programming Languages Bloat and Retrofuturism Refreshing my Blog Again Random Rust Impressions Apilar: An Alife System I Was a 1980s Teenage Programmer Part 2: Olivetti M24 I Was a 1980s Teenage Programmer: the Alphatronic SolidJS fits my brain Is premature optimization the root of all evil? Framework Patterns: JavaScript edition Roll Your Own Frameworks Framework Patterns Secret Weblog Highlights Refactoring to Multiple Exit Points mstform: a form library for mobx-state-tree Seven Years: A Very Personal History of the Web
Allowing Zope 2 applications to contain Zope 3 content
Martijn Faassen · 2008-01-30 · via Secret Weblog

Five, the system to use Zope 3 within Zope 2, is a pain sometimes. Five is full of hacks to ensure backwards compatibility with Zope 2. This stops developers from using full-fledged Zope 3 strategies in places.

How could we make this pain go away?

The main reason these hacks in Five are necessary is acquisition. Acquisition in turn is necessary to support the construction of URLs, and most importantly, to look up security information. There has been long-standing work on a branch of Zope 2 to make acquisition also inspect the __parent__ attribute. This should help make some of the hacks go away.

Five so far is about everything Zope 3 except content objects. You can do just about anything Zope 3 can with Zope 2, except store plain, simple, Zope 3 content objects. I think if we added the ability to store Zope 3 content objects to Zope 2, we could take a leap forward in merging the two platforms. Suddenly just about any Zope 3 application could be hosted in Zope 2. Existing Zope 2 applications (such as Plone) could be extended with pure Zope 3 code. You'd be able to use things like Grok more or less out of the box, say. You can start thinking about gradual content migrations over multiple releases of your applications towards a pure Zope 3 platform.

I'll sketch out what I think would need to be done to make this possible. It's likely I'm missing some complexities, and perhaps I overestimate some other complexities. My hope is that some of the readers of this post will be stimulated into doing some experiments...

What would be required to let Zope 2 host Zope 3 content objects? Let's first catalog what we already have (so no work is needed):

  • code: we're shipping the Zope 3 codebase with Zope 2, so that's all already there.
  • zodb: Zope 3 and Zope 2 content objects can share the same ZODB.

Now let's look at what's almost there:

  • no more acquisition: we can look up Zope 2's security infrastructure using __parent__ references, without acquisition (the branch I mentioned).

What needs to be done?

  • storage: we need to extend Zope's folder so you can store a Zope 3 content object in it without any harm. Mixing it with Zope 2 objects would be nicest, but if that isn't available, two separate pools of objects would do for now.
  • publishing: we need to make sure that as soon as someone traverses to a Zope 3 object, the Zope 3 publisher kicks in. We'd leave the Zope 2 publisher completely behind. Initializing the Zope 3 publisher into the right state is going to be tricky. It's likely we need to amend Zope 2's request object so the Zope 3 publisher has everything it needs.
  • security: we likely need a custom Zope 3 publisher so it can do view-level security checks, much like Grok does. We probably need some mix of Zope 2 security information and Zope 3 security information to determine whether someone has access. That's going to require some thought. Trying to make the whole Zope 3 security proxy machinery work would be more trouble, so I'd recommend skipping that step for now. I expect the combining of security systems would be the trickiest parts. Perhaps there are good ways to sidestep this issue.
  • directives: Five works in part by reimplementing some of Zope 3's directives to make them work for Zope 2. Unfortunately the original version of the directives would need to be used to support pure Zope 3 content. Possibly both sets of directives can be supported by migrating Five's registrations to a new namespace. It's going to break all existing Five-based ZCML. That ZCML should however be easily fixable by using the Five-specific namespace (http://namespaces.zope.org/browser_five, say) where needed. This namespace would have all registrations for http://namespaces.zope.org/browser, with special Five versions for those directives that need it.

Again, I hope these thoughts will set some people thinking...