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

consider splitting callbacks and passengers in WACallbackRegistry #614

Open
GoogleCodeExporter opened this issue Mar 25, 2015 · 7 comments

Comments

@GoogleCodeExporter
Copy link

Right now callbacks in WACallbackRegistry is a Dictionary although we have only 
Integer keys which start at 1. Replacing this with an OrderedCollection would 
give us faster access and insert times and reduce the memory usage.

The only way we can get String keys is through #passengerAt:ifAbsent: and 
registerPassenger:named: in which case the key is 'id', callback.


Original issue reported on code.google.com by philippe...@gmail.com on 1 Dec 2010 at 6:46

@GoogleCodeExporter
Copy link
Author

Such a change might cause problems in certain proprietary applications. I know 
of Seaside users that use the context dictionary to store all kinds of data 
(not only passengers).

Original comment by renggli on 1 Dec 2010 at 10:50

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Maybe it would be cleaner to separate callbacks and passengers. The 'callbacks' 
are an OrderedCollection of WACallback instances; and 'passengers' is 
everything else, e.g a dictionary mapping ids to objects.

Original comment by renggli on 1 Dec 2010 at 10:52

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

I did always find it odd that passengers were stored in the callback 
dictionary... but I don't have a strong opinion on this overall. We now also 
have the context property dict, which we didn't before... not sure if that 
helps for the passengers in some way.

Original comment by jfitz...@gmail.com on 1 Dec 2010 at 11:01

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Yes, splitting callbacks and passengers might be a good idea. This way we can 
avoid mixed type (String and Integer) keys.

Original comment by philippe...@gmail.com on 1 Dec 2010 at 11:10

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by philippe...@gmail.com on 1 Dec 2010 at 9:30

  • Changed title: consider splitting callbacks and passengers in WACallbackRegistry
  • Added labels: Type-CleanUp
  • Removed labels: BiteSize, Type-Performance

@GoogleCodeExporter
Copy link
Author

There is at least one valuable Seaside package, BowWave ReCaptcha, that 
installs string keys in its WACallbackRegistry instance.

It does this because the reCaptcha rendering is done by Javascript acquired 
on-the-fly from the reCaptcha server and thus the form field names are not 
under the control of Seaside. 

Supporting "foreign keys" like this seems like an important capability that 
Seaside should not lose. So I would vote against changing the dictionary into 
an OrderedCollection unless there is some other means of retaining this 
flexibility.

Original comment by tony.fl...@gmail.com on 2 Jan 2011 at 5:30

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Do you do that through the #registerPassenger: and #passengerAt: methods?

Original comment by philippe...@gmail.com on 2 Jan 2011 at 6:46

  • Added labels: ****
  • Removed labels: ****

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

1 participant