Pipelines vs Event Handlers

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












What is the difference between Sitecore Pipelines and a Sitecore Event Handlers for a specific event? When should we customise a pipeline and when should we add a new handler?










share|improve this question







New contributor




Shubham Bassi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    2
    down vote

    favorite












    What is the difference between Sitecore Pipelines and a Sitecore Event Handlers for a specific event? When should we customise a pipeline and when should we add a new handler?










    share|improve this question







    New contributor




    Shubham Bassi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      What is the difference between Sitecore Pipelines and a Sitecore Event Handlers for a specific event? When should we customise a pipeline and when should we add a new handler?










      share|improve this question







      New contributor




      Shubham Bassi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      What is the difference between Sitecore Pipelines and a Sitecore Event Handlers for a specific event? When should we customise a pipeline and when should we add a new handler?







      pipelines events






      share|improve this question







      New contributor




      Shubham Bassi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Shubham Bassi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Shubham Bassi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 57 mins ago









      Shubham Bassi

      132




      132




      New contributor




      Shubham Bassi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Shubham Bassi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Shubham Bassi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Pipeline



          To me pipelines are about process. Do this, then this. Allowing you to insert and remove processes simply with patch configs. A great example of this is login user pipeline. Your pipeline would be:



          1. Log user in

          2. Identify user in xDB

          3. Add logging info for user

          4. Add user to marketing automation for returning customer

          5. etc....

          It is a process flow that you can reorder and add to/subtract from.



          Event



          Events are one off, very focused actions. Like item:saved vs item:saving. item:renamed vs item:duplicated. They are extremely focused. Although you could tie many events together in the config, they are not very process oriented. It is more about data manipulation than process.






          share|improve this answer
















          • 1




            Remember that you could also run a pipeline in your event handler :)
            – Richard Seal♦
            28 mins ago










          • Thank you. This helped clarify my understanding of pipelines and event handlers :)
            – Shubham Bassi
            19 mins ago

















          up vote
          1
          down vote













          To add to @Chris answer. Think of it this way



          What is the difference



          An event is a reaction to something happening in the system. This could be a user interaction, like item:saved, item:created etc... or it could be raised by another process in the system like publish:end or publish:end:remote. And there can be many handlers for a single event, just look at some of the item: events and how many handlers SXA adds to them - the key point here is that an event reacts to something else being done in the platform



          A pipeline requires something to start that process, but as Chris mentioned, the pipeline is a pattern that starts with some data and then sends that data through various processors to consume, manipulate or add to that data. So you might think of mvc.getPageItem pipeline - that pipeline takes the initial data about the page context and each processor does something with that data, from setting the language, trying different methods to resolve the page item to hooking into the Content Testing module.



          The key for pipelines is - its processing data.



          When Should I Use Event Handlers/Pipelines



          Now we have the distinction, it should be fairly easy to know what you want to use. If you want to react to an existing event that occurs in the system, you probably want to create an event handler. Is is important to remember here tho, hooking into some of the item event handlers can seriously affect your editor performance. You should make sure the code is as performant as you can get it. Don't take shortcuts just because it wont affect the delivery of the site.



          As for pipelines, its unusual to create a completely custom pipeline, although it does happen. More often you are hooking into an existing pipeline and adding a processor there. So if you find that you need to change the way something in Sitecore functions, say for example you want to extend the source property on a TreeList - then you would be creating a pipeline processor to do that.






          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "664"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );






            Shubham Bassi is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsitecore.stackexchange.com%2fquestions%2f14660%2fpipelines-vs-event-handlers%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            Pipeline



            To me pipelines are about process. Do this, then this. Allowing you to insert and remove processes simply with patch configs. A great example of this is login user pipeline. Your pipeline would be:



            1. Log user in

            2. Identify user in xDB

            3. Add logging info for user

            4. Add user to marketing automation for returning customer

            5. etc....

            It is a process flow that you can reorder and add to/subtract from.



            Event



            Events are one off, very focused actions. Like item:saved vs item:saving. item:renamed vs item:duplicated. They are extremely focused. Although you could tie many events together in the config, they are not very process oriented. It is more about data manipulation than process.






            share|improve this answer
















            • 1




              Remember that you could also run a pipeline in your event handler :)
              – Richard Seal♦
              28 mins ago










            • Thank you. This helped clarify my understanding of pipelines and event handlers :)
              – Shubham Bassi
              19 mins ago














            up vote
            2
            down vote



            accepted










            Pipeline



            To me pipelines are about process. Do this, then this. Allowing you to insert and remove processes simply with patch configs. A great example of this is login user pipeline. Your pipeline would be:



            1. Log user in

            2. Identify user in xDB

            3. Add logging info for user

            4. Add user to marketing automation for returning customer

            5. etc....

            It is a process flow that you can reorder and add to/subtract from.



            Event



            Events are one off, very focused actions. Like item:saved vs item:saving. item:renamed vs item:duplicated. They are extremely focused. Although you could tie many events together in the config, they are not very process oriented. It is more about data manipulation than process.






            share|improve this answer
















            • 1




              Remember that you could also run a pipeline in your event handler :)
              – Richard Seal♦
              28 mins ago










            • Thank you. This helped clarify my understanding of pipelines and event handlers :)
              – Shubham Bassi
              19 mins ago












            up vote
            2
            down vote



            accepted







            up vote
            2
            down vote



            accepted






            Pipeline



            To me pipelines are about process. Do this, then this. Allowing you to insert and remove processes simply with patch configs. A great example of this is login user pipeline. Your pipeline would be:



            1. Log user in

            2. Identify user in xDB

            3. Add logging info for user

            4. Add user to marketing automation for returning customer

            5. etc....

            It is a process flow that you can reorder and add to/subtract from.



            Event



            Events are one off, very focused actions. Like item:saved vs item:saving. item:renamed vs item:duplicated. They are extremely focused. Although you could tie many events together in the config, they are not very process oriented. It is more about data manipulation than process.






            share|improve this answer












            Pipeline



            To me pipelines are about process. Do this, then this. Allowing you to insert and remove processes simply with patch configs. A great example of this is login user pipeline. Your pipeline would be:



            1. Log user in

            2. Identify user in xDB

            3. Add logging info for user

            4. Add user to marketing automation for returning customer

            5. etc....

            It is a process flow that you can reorder and add to/subtract from.



            Event



            Events are one off, very focused actions. Like item:saved vs item:saving. item:renamed vs item:duplicated. They are extremely focused. Although you could tie many events together in the config, they are not very process oriented. It is more about data manipulation than process.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 36 mins ago









            Chris Auer

            6,5031939




            6,5031939







            • 1




              Remember that you could also run a pipeline in your event handler :)
              – Richard Seal♦
              28 mins ago










            • Thank you. This helped clarify my understanding of pipelines and event handlers :)
              – Shubham Bassi
              19 mins ago












            • 1




              Remember that you could also run a pipeline in your event handler :)
              – Richard Seal♦
              28 mins ago










            • Thank you. This helped clarify my understanding of pipelines and event handlers :)
              – Shubham Bassi
              19 mins ago







            1




            1




            Remember that you could also run a pipeline in your event handler :)
            – Richard Seal♦
            28 mins ago




            Remember that you could also run a pipeline in your event handler :)
            – Richard Seal♦
            28 mins ago












            Thank you. This helped clarify my understanding of pipelines and event handlers :)
            – Shubham Bassi
            19 mins ago




            Thank you. This helped clarify my understanding of pipelines and event handlers :)
            – Shubham Bassi
            19 mins ago










            up vote
            1
            down vote













            To add to @Chris answer. Think of it this way



            What is the difference



            An event is a reaction to something happening in the system. This could be a user interaction, like item:saved, item:created etc... or it could be raised by another process in the system like publish:end or publish:end:remote. And there can be many handlers for a single event, just look at some of the item: events and how many handlers SXA adds to them - the key point here is that an event reacts to something else being done in the platform



            A pipeline requires something to start that process, but as Chris mentioned, the pipeline is a pattern that starts with some data and then sends that data through various processors to consume, manipulate or add to that data. So you might think of mvc.getPageItem pipeline - that pipeline takes the initial data about the page context and each processor does something with that data, from setting the language, trying different methods to resolve the page item to hooking into the Content Testing module.



            The key for pipelines is - its processing data.



            When Should I Use Event Handlers/Pipelines



            Now we have the distinction, it should be fairly easy to know what you want to use. If you want to react to an existing event that occurs in the system, you probably want to create an event handler. Is is important to remember here tho, hooking into some of the item event handlers can seriously affect your editor performance. You should make sure the code is as performant as you can get it. Don't take shortcuts just because it wont affect the delivery of the site.



            As for pipelines, its unusual to create a completely custom pipeline, although it does happen. More often you are hooking into an existing pipeline and adding a processor there. So if you find that you need to change the way something in Sitecore functions, say for example you want to extend the source property on a TreeList - then you would be creating a pipeline processor to do that.






            share|improve this answer
























              up vote
              1
              down vote













              To add to @Chris answer. Think of it this way



              What is the difference



              An event is a reaction to something happening in the system. This could be a user interaction, like item:saved, item:created etc... or it could be raised by another process in the system like publish:end or publish:end:remote. And there can be many handlers for a single event, just look at some of the item: events and how many handlers SXA adds to them - the key point here is that an event reacts to something else being done in the platform



              A pipeline requires something to start that process, but as Chris mentioned, the pipeline is a pattern that starts with some data and then sends that data through various processors to consume, manipulate or add to that data. So you might think of mvc.getPageItem pipeline - that pipeline takes the initial data about the page context and each processor does something with that data, from setting the language, trying different methods to resolve the page item to hooking into the Content Testing module.



              The key for pipelines is - its processing data.



              When Should I Use Event Handlers/Pipelines



              Now we have the distinction, it should be fairly easy to know what you want to use. If you want to react to an existing event that occurs in the system, you probably want to create an event handler. Is is important to remember here tho, hooking into some of the item event handlers can seriously affect your editor performance. You should make sure the code is as performant as you can get it. Don't take shortcuts just because it wont affect the delivery of the site.



              As for pipelines, its unusual to create a completely custom pipeline, although it does happen. More often you are hooking into an existing pipeline and adding a processor there. So if you find that you need to change the way something in Sitecore functions, say for example you want to extend the source property on a TreeList - then you would be creating a pipeline processor to do that.






              share|improve this answer






















                up vote
                1
                down vote










                up vote
                1
                down vote









                To add to @Chris answer. Think of it this way



                What is the difference



                An event is a reaction to something happening in the system. This could be a user interaction, like item:saved, item:created etc... or it could be raised by another process in the system like publish:end or publish:end:remote. And there can be many handlers for a single event, just look at some of the item: events and how many handlers SXA adds to them - the key point here is that an event reacts to something else being done in the platform



                A pipeline requires something to start that process, but as Chris mentioned, the pipeline is a pattern that starts with some data and then sends that data through various processors to consume, manipulate or add to that data. So you might think of mvc.getPageItem pipeline - that pipeline takes the initial data about the page context and each processor does something with that data, from setting the language, trying different methods to resolve the page item to hooking into the Content Testing module.



                The key for pipelines is - its processing data.



                When Should I Use Event Handlers/Pipelines



                Now we have the distinction, it should be fairly easy to know what you want to use. If you want to react to an existing event that occurs in the system, you probably want to create an event handler. Is is important to remember here tho, hooking into some of the item event handlers can seriously affect your editor performance. You should make sure the code is as performant as you can get it. Don't take shortcuts just because it wont affect the delivery of the site.



                As for pipelines, its unusual to create a completely custom pipeline, although it does happen. More often you are hooking into an existing pipeline and adding a processor there. So if you find that you need to change the way something in Sitecore functions, say for example you want to extend the source property on a TreeList - then you would be creating a pipeline processor to do that.






                share|improve this answer












                To add to @Chris answer. Think of it this way



                What is the difference



                An event is a reaction to something happening in the system. This could be a user interaction, like item:saved, item:created etc... or it could be raised by another process in the system like publish:end or publish:end:remote. And there can be many handlers for a single event, just look at some of the item: events and how many handlers SXA adds to them - the key point here is that an event reacts to something else being done in the platform



                A pipeline requires something to start that process, but as Chris mentioned, the pipeline is a pattern that starts with some data and then sends that data through various processors to consume, manipulate or add to that data. So you might think of mvc.getPageItem pipeline - that pipeline takes the initial data about the page context and each processor does something with that data, from setting the language, trying different methods to resolve the page item to hooking into the Content Testing module.



                The key for pipelines is - its processing data.



                When Should I Use Event Handlers/Pipelines



                Now we have the distinction, it should be fairly easy to know what you want to use. If you want to react to an existing event that occurs in the system, you probably want to create an event handler. Is is important to remember here tho, hooking into some of the item event handlers can seriously affect your editor performance. You should make sure the code is as performant as you can get it. Don't take shortcuts just because it wont affect the delivery of the site.



                As for pipelines, its unusual to create a completely custom pipeline, although it does happen. More often you are hooking into an existing pipeline and adding a processor there. So if you find that you need to change the way something in Sitecore functions, say for example you want to extend the source property on a TreeList - then you would be creating a pipeline processor to do that.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 10 mins ago









                Richard Seal♦

                12.8k32255




                12.8k32255




















                    Shubham Bassi is a new contributor. Be nice, and check out our Code of Conduct.









                     

                    draft saved


                    draft discarded


















                    Shubham Bassi is a new contributor. Be nice, and check out our Code of Conduct.












                    Shubham Bassi is a new contributor. Be nice, and check out our Code of Conduct.











                    Shubham Bassi is a new contributor. Be nice, and check out our Code of Conduct.













                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsitecore.stackexchange.com%2fquestions%2f14660%2fpipelines-vs-event-handlers%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    Long meetings (6-7 hours a day): Being “babysat” by supervisor

                    Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                    Confectionery