{"id":373863,"date":"2023-03-30T04:30:45","date_gmt":"2023-03-30T04:30:45","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=373863"},"modified":"2023-04-01T05:59:08","modified_gmt":"2023-04-01T05:59:08","slug":"how-to-use-strategy-pattern-in-magento2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/","title":{"rendered":"How to use a strategy design pattern in Magento2?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">What is a strategy design pattern?<\/h2>\n\n\n\n<p>Strategy pattern is known as&nbsp;<strong>Policy Pattern<\/strong> also. <\/p>\n\n\n\n<p>The Strategy design pattern allows you to take a class that does something specific in a lot of different ways and extracts all of these algorithms into separate classes called&nbsp;strategies.<\/p>\n\n\n\n<p>Use a strategy design pattern to avoid writing multiple if else statements or switch cases to perform some event.<\/p>\n\n\n\n<p>Example:- If you want to trigger a custom notification after placing an order according to order status so to perform this event you have to use multiple if else statements or switch cases and you have to write extra lines of code to do your task to call the method for each state. use the strategy design pattern to perform this task by writing a few lines of code in place of multiple if-else statements or switch cases. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to use the strategy pattern<\/h2>\n\n\n\n<p>1) Create file <strong>etc\/frontend\/di.xml<\/strong> in your module to define the order status and methods. Those you want to call according to order status.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-preformatted\">&lt;?xml version=\"1.0\"?&gt;\n\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:ObjectManager\/etc\/config.xsd\"&gt;\n    &lt;type name=\"Webkul\\Custom\\Helper\\Data\"&gt;\n        &lt;arguments&gt;\n            &lt;argument name=\"orderStatus\" xsi:type=\"array\"&gt;\n                &lt;item name=\"order_status\" xsi:type=\"array\"&gt;\n                    &lt;item name=\"new\" xsi:type=\"string\"&gt;newState&lt;\/item&gt;\n                    &lt;item name=\"processing\" xsi:type=\"string\"&gt;processingState&lt;\/item&gt;\n                    &lt;item name=\"holded\" xsi:type=\"string\"&gt;holdedState&lt;\/item&gt;\n                    &lt;item name=\"canceled\" xsi:type=\"string\"&gt;canceledState&lt;\/item&gt;\n                    &lt;item name=\"complete\" xsi:type=\"string\"&gt;completeState&lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n        &lt;\/arguments&gt;\n    &lt;\/type&gt;\n&lt;\/config&gt;\n<\/pre>\n<cite>Use the type declaration to add the arguments in your class constructor parameters.<\/cite><\/blockquote>\n\n\n\n<p><\/p>\n\n\n\n<p>2) Create \\Helper\\Data.php in your module as we have defined the type <strong>&#8220;Webkul\\Custom\\Helper\\Data&#8221;<\/strong> in <strong>di.xml<\/strong>. We are using the helper to load the arguments. So we can use it all over the class as per requirements.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-preformatted\">&lt;?php\n\nnamespace Webkul\\Custom\\Helper;\n\n\/**\n * MpNotifications data helper\n *\/\nclass Data extends \\Magento\\Framework\\App\\Helper\\AbstractHelper\n{\n\n    \/**\n     * Construct\n     *\n     * @param \\Magento\\Framework\\App\\Helper\\Context $context\n     * @param array $orderStatus\n     *\/\n    public function __construct(\n        \\Magento\\Framework\\App\\Helper\\Context $context,\n        $orderStatus = []\n    ) {\n        parent::__construct($context);\n        $this-&gt;orderStatus = $orderStatus;\n    }\n\n\n    \/**\n     * Return method array\n     *\n     * @param string $type\n     * @return array\n     *\/\n    public function getMethodArray($type)\n    {\n        return $this-&gt;orderStatus[$type];\n    }\n\n}\n<\/pre>\n<\/blockquote>\n\n\n\n<p>3) Create file <strong>W<code>ebkul\\<strong>Custom<\/strong>\\Observer<\/code>\\SalesOrderChangeStateAfterObserver.php<\/strong> for the event <code><strong>sales_order_save_after<\/strong><\/code> <\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-preformatted\">&lt;?php\n\nnamespace Webkul\\Custom\\Observer;\n\nuse Magento\\Framework\\Event\\ObserverInterface;\n\nclass SalesOrderChangeStateAfterObserver implements ObserverInterface\n{\n    public const ORDER_STATUS = 'order_status';\n\n    \/**\n     * @var $_ordersFactory\n     *\/\n    protected $_ordersFactory;\n\n    \/**\n     * Constructor\n     *\n     * @param \\Magento\\Sales\\Model\\OrdersFactory $ordersFactory\n     * @param \\Webkul\\Custom\\Helper\\Data $dataHelper\n     *\/\n    public function __construct(               \\Magento\\Sales\\Model\\OrdersFactory $ordersFactory,\n        \\Webkul\\Custom\\Helper\\Data $dataHelper\n    ) {\n        $this-&gt;_ordersFactory = $ordersFactory;\n        $this-&gt;_dataHelper = $dataHelper;\n    }\n\n    \/**\n     * Sales Order Change State After\n     *\n     * @param \\Magento\\Framework\\Event\\Observer $observer\n     *\/\n    public function execute(\\Magento\\Framework\\Event\\Observer $observer)\n    {        \n          try {\n                        $order = $observer-&gt;getEvent()-&gt;getOrder();\n                    \n                        $orderId = $order-&gt;getId();\n                        $orderFactory = $this-&gt;_ordersFactory-&gt;create();\n                        $methodArray = $this-&gt;_dataHelper-&gt;getMethodArray(self::ORDER_STATUS);\n                        if (!empty($order-&gt;getState())) {\n                            $method = $methodArray[$order-&gt;getState()];\n                            $this-&gt;$method($orderId, $order, $orderFactory);\n                        }\n            }\n    }\n\n    \/**\n     * New state\n     *\n     * @param int $orderId\n     * @param object $order\n     * @param object $orderFactory\n     *\/\n    private function newState($orderId, $order, $orderFactory)\n    {\n      \/\/ Wrrite your code here\n    }\n\n}\n<\/pre>\n<\/blockquote>\n\n\n\n<div class=\"wp-block-cover is-light has-small-font-size\"><span aria-hidden=\"true\" class=\"wp-block-cover__background has-background-dim-0 has-background-dim\"><\/span><img decoding=\"async\" width=\"763\" height=\"316\" class=\"wp-block-cover__image-background wp-image-374772\" alt=\"How to use a strategy design pattern\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/SS.png\" data-object-fit=\"cover\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/SS.png 763w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/SS-300x124.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/SS-250x104.png 250w\" sizes=\"(max-width: 763px) 100vw, 763px\" loading=\"lazy\" \/><div class=\"wp-block-cover__inner-container is-layout-flow wp-block-cover-is-layout-flow\">\n<p class=\"has-text-align-center has-large-font-size\"><\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>What is a strategy design pattern? Strategy pattern is known as&nbsp;Policy Pattern also. The Strategy design pattern allows you to take a class that does something specific in a lot of different ways and extracts all of these algorithms into separate classes called&nbsp;strategies. Use a strategy design pattern to avoid writing multiple if else statements <a href=\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":497,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13701,302,13,1],"tags":[2056,2460,2070,106,590],"class_list":["post-373863","post","type-post","status-publish","format-standard","hentry","category-design-pattern","category-magento2","category-php","category-uncategorized","tag-magento","tag-magento-2","tag-magento2","tag-marketplace","tag-webkul"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to use a strategy design pattern in Magento2? - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Webkul Blog - design patterns in Magento 2 - how to use strategy design patterns in Magento 2 - what is a strategy design patterns in the PHP\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use a strategy design pattern in Magento2? - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Webkul Blog - design patterns in Magento 2 - how to use strategy design patterns in Magento 2 - what is a strategy design patterns in the PHP\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:author\" content=\"pammu23\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-30T04:30:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-01T05:59:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/SS.png\" \/>\n<meta name=\"author\" content=\"Pramod Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pramod Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/\"},\"author\":{\"name\":\"Pramod Kumar\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/285932e5fa620be1f718b1f68c6af590\"},\"headline\":\"How to use a strategy design pattern in Magento2?\",\"datePublished\":\"2023-03-30T04:30:45+00:00\",\"dateModified\":\"2023-04-01T05:59:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/\"},\"wordCount\":247,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/SS.png\",\"keywords\":[\"magento\",\"Magento 2\",\"Magento2\",\"marketplace\",\"webkul\"],\"articleSection\":[\"design pattern\",\"Magento2\",\"php\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/\",\"name\":\"How to use a strategy design pattern in Magento2? - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/SS.png\",\"datePublished\":\"2023-03-30T04:30:45+00:00\",\"dateModified\":\"2023-04-01T05:59:08+00:00\",\"description\":\"Webkul Blog - design patterns in Magento 2 - how to use strategy design patterns in Magento 2 - what is a strategy design patterns in the PHP\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/SS.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/SS.png\",\"width\":763,\"height\":316,\"caption\":\"SS\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use a strategy design pattern in Magento2?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/285932e5fa620be1f718b1f68c6af590\",\"name\":\"Pramod Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/35653d7d513cf4c67589b5296b21e3eeac45915b287bac2c509616f2849984a6?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/35653d7d513cf4c67589b5296b21e3eeac45915b287bac2c509616f2849984a6?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Pramod Kumar\"},\"description\":\"Software Engineer\",\"sameAs\":[\"pammu23\"],\"url\":\"https:\/\/webkul.com\/blog\/author\/pramodkumar-mg592\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to use a strategy design pattern in Magento2? - Webkul Blog","description":"Webkul Blog - design patterns in Magento 2 - how to use strategy design patterns in Magento 2 - what is a strategy design patterns in the PHP","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/","og_locale":"en_US","og_type":"article","og_title":"How to use a strategy design pattern in Magento2? - Webkul Blog","og_description":"Webkul Blog - design patterns in Magento 2 - how to use strategy design patterns in Magento 2 - what is a strategy design patterns in the PHP","og_url":"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_author":"pammu23","article_published_time":"2023-03-30T04:30:45+00:00","article_modified_time":"2023-04-01T05:59:08+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/SS.png","type":"","width":"","height":""}],"author":"Pramod Kumar","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Pramod Kumar","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/"},"author":{"name":"Pramod Kumar","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/285932e5fa620be1f718b1f68c6af590"},"headline":"How to use a strategy design pattern in Magento2?","datePublished":"2023-03-30T04:30:45+00:00","dateModified":"2023-04-01T05:59:08+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/"},"wordCount":247,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/SS.png","keywords":["magento","Magento 2","Magento2","marketplace","webkul"],"articleSection":["design pattern","Magento2","php"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/","url":"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/","name":"How to use a strategy design pattern in Magento2? - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/SS.png","datePublished":"2023-03-30T04:30:45+00:00","dateModified":"2023-04-01T05:59:08+00:00","description":"Webkul Blog - design patterns in Magento 2 - how to use strategy design patterns in Magento 2 - what is a strategy design patterns in the PHP","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/SS.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/SS.png","width":763,"height":316,"caption":"SS"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-use-strategy-pattern-in-magento2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to use a strategy design pattern in Magento2?"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/285932e5fa620be1f718b1f68c6af590","name":"Pramod Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/35653d7d513cf4c67589b5296b21e3eeac45915b287bac2c509616f2849984a6?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/35653d7d513cf4c67589b5296b21e3eeac45915b287bac2c509616f2849984a6?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Pramod Kumar"},"description":"Software Engineer","sameAs":["pammu23"],"url":"https:\/\/webkul.com\/blog\/author\/pramodkumar-mg592\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/373863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/497"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=373863"}],"version-history":[{"count":35,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/373863\/revisions"}],"predecessor-version":[{"id":375092,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/373863\/revisions\/375092"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=373863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=373863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=373863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}