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

Extension should trigger core delegates #48

Open
michael-e opened this issue Jan 28, 2016 · 9 comments
Open

Extension should trigger core delegates #48

michael-e opened this issue Jan 28, 2016 · 9 comments

Comments

@michael-e
Copy link
Member

As discussed in #47, the extension should trigger the core pre/post save delegates.

@michael-e
Copy link
Member Author

When importing entries, the extension provides five delegates:

  • XMLImporterEntryPreEdit
  • XMLImporterEntryPostEdit
  • XMLImporterEntryPostSkip
  • XMLImporterEntryPreCreate
  • XMLImporterEntryPostCreate

The core has four delegates:

  • EntryPreEdit
  • EntryPostEdit
  • EntryPreCreate
  • EntryPostCreate

One might think about either adding or replacing existing delegates with the core delegates.

There may be extensions which already subscribe to both types of delegates, so if we simply add the core types, methods in these extensions would be triggered twice. Maybe we should leave it as it is…

Is there a convention for extensions? Should they have own delegates or use core delegates if available?

@nitriques
Copy link
Member

Should they have own delegates or use core delegates if available?

This is a tough one. As mention before, one could want to only run code when the xmlimporter runs and not when the core one fires.

But since we are dealing with "core" operation (creating empty) both should be supported IMHO.

There may be extensions which already subscribe to both types of delegates

I am not aware of any. And they should only listen for the core one so it's an easy fix...

@michael-e
Copy link
Member Author

I am not aware of any.

Oh, the Reflection Field… :-) It listens on both types of delegates!

@nitriques
Copy link
Member

Hahah ;) Then it should not :P

@michael-e
Copy link
Member Author

So which one? Which brings us back to question number 1, the tough one…

@michael-e
Copy link
Member Author

So you mean that the XML Importer should trigger both types of delegates (core/own), and the Reflection Field should only subscribe to one of them?

@nitriques
Copy link
Member

That's what I think yes. I see the registering of both as a failure to be able to do it "always". An extension that acts like the core should do as the core.

Publish/Subscribe architecture takes discipline ;)

@michael-e
Copy link
Member Author

I start to see the big picture. :-)

Nevertheless, offline for today—it's late here in Germany.

@nitriques
Copy link
Member

Nite nite Micheal

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

No branches or pull requests

2 participants