Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop subclassing PersistentPropertyHolder #43

Closed
jamadden opened this issue Sep 28, 2017 · 3 comments
Closed

Stop subclassing PersistentPropertyHolder #43

jamadden opened this issue Sep 28, 2017 · 3 comments

Comments

@jamadden
Copy link
Member

The datastructures in nti.externalization.persistent subclass nti.zodb.persistentproperty.PersistentPropertyHolder.

I don't see a very good reason for them to do that: they are containers, and as such really shouldn't typically have their own properties, just contained objects.

I didn't find anything in our internal code (what I have checked out anyway) that actually uses them, except for nti.dublincore.datastructures, which subclasses one of them: but it subclasses PersistentPropertyHolder in another indirect way anyway! (Not that I could find where that new datastructure was being used).

Can we make them stop doing this? Not only would that let us drop our dependency on nti.zodb, it would also potentially make these objects faster (the shorter the mro, the faster it is to find---or fail to find---attributes). (Of course, nti.dublincore is monkey-patching them again, so that really is a theoretical benefit.)

@papachoco
Copy link
Contributor

papachoco commented Sep 28, 2017

nti.dublincore is the only place we use the nti.externalization.persistent classes. Let me know when want to drop them and I can add modify lines like the one below. ( I guess I I just need to add the PersistentPropertyHolder bases to it)

# For BWC, we apply these properties to the base class too,
# but the implementation is not correct as they do not get updated...
_PersistentExternalizableList.__bases__ = (PersistentCreatedModDateTrackingObject,) + \
                                                                      _PersistentExternalizableList.__bases__

@jamadden
Copy link
Member Author

PersistentCreatedModDateTrackingObject is already a PersistentPropertyHolder, so no changes should be necessary.

@papachoco
Copy link
Contributor

Cool .. let's drop it 📄

jamadden added a commit that referenced this issue Sep 29, 2017
This lets us drop nti.zodb.

Also drop unused dependencies on zope.annotation and
zope.cachedescriptors (though the latter might end up coming back).

Fixes #43
jamadden added a commit that referenced this issue Sep 29, 2017
This lets us drop nti.zodb.

Also drop unused dependencies on zope.annotation and
zope.cachedescriptors (though the latter might end up coming back).

Fixes #43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants