{"id":2882,"date":"2020-06-17T09:30:19","date_gmt":"2020-06-17T04:00:19","guid":{"rendered":"https:\/\/www.planetecomsolutions.com\/blog\/"},"modified":"2022-12-22T16:22:38","modified_gmt":"2022-12-22T10:52:38","slug":"what-is-clean-architecture-and-why-you-should-use-it","status":"publish","type":"post","link":"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/","title":{"rendered":"What is clean architecture and why you should use it?"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"2882\" class=\"elementor elementor-2882\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-0510c52 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"0510c52\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8b73260\" data-id=\"8b73260\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-02ca631 elementor-widget elementor-widget-image\" data-id=\"02ca631\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"1195\" height=\"501\" src=\"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy.jpg\" class=\"attachment-full size-full wp-image-2897\" alt=\"Clean Arch\" srcset=\"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy.jpg 1195w, https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy-300x126.jpg 300w, https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy-768x322.jpg 768w, https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy-1024x429.jpg 1024w, https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy-980x411.jpg 980w\" sizes=\"(max-width: 1195px) 100vw, 1195px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ab1d182 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ab1d182\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-41b1152\" data-id=\"41b1152\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8d13cec elementor-widget elementor-widget-heading\" data-id=\"8d13cec\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Introduction<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-8a7b203 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"8a7b203\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-bff14e2\" data-id=\"bff14e2\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-223cb42 elementor-widget elementor-widget-text-editor\" data-id=\"223cb42\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Being a developer, have you ever written code that<\/p><ul><li>Is hard to understand because its intent or purpose was not clear?<\/li><li>Has logics mixed?<\/li><li>Is hard to debug?<\/li><li>Is compiling fine but full of logical bugs?<\/li><li>Painful to test?<\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-7c49556 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7c49556\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-e117078\" data-id=\"e117078\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-38c8d34 elementor-widget elementor-widget-text-editor\" data-id=\"38c8d34\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>If the answer is \u201cYes I have\u201d, you are reading the right blog.<\/p><p>Being progressive developers, we learn various software design patterns and beyond that from the <a href=\"https:\/\/springframework.guru\/gang-of-four-design-patterns\/\" target=\"_blank\" rel=\"noopener\"><strong>GoF<\/strong><\/a> Book and a variety of sources. We make deliberate efforts to implement solid principles as we code. All this has always helped us confront the above issues but only to a certain extent. We still see data access and business logic put in controllers, domain models being used everywhere and not being able to test the code without a database and we always feel the scope of improvement in the code.<\/p><p>The solution to all these common development issues is implementing \u201cClean Architecture\u201d in our code.<\/p><p>Clean architecture is a concept proposed by Uncle Bob in his book\u00a0<a href=\"https:\/\/www.amazon.co.uk\/Clean-Architecture-Craftsmans-Software-Structure\/dp\/0134494164\" target=\"_blank\" rel=\"noopener\"><b>Clean Architecture<\/b><\/a>\u00a0as a way of building highly flexible and maintainable software solutions<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-5e08cc3 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5e08cc3\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3b2dd02\" data-id=\"3b2dd02\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a4cacd8 elementor-widget elementor-widget-heading\" data-id=\"a4cacd8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">What is Clean Architecture?<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-e7cc7c2 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"e7cc7c2\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7afa83a\" data-id=\"7afa83a\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-36bf095 elementor-widget elementor-widget-text-editor\" data-id=\"36bf095\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>\u201cDependency Rule\u201d is the heart of \u201cClean Architecture\u201d stating that source code dependency can only point inwards towards the application core.<\/p><p>This architecture has been called many names over the years, first name was <strong>Hexagonal Architecture<\/strong>, followed by Ports-and-Adapters. Until recently, it&#8217;s been cited as the\u00a0<strong>Onion Architecture<\/strong>\u00a0or\u00a0Clean Architecture.<\/p><p>Applications that follow the Dependency Inversion Principle as well as the Domain-Driven Design (DDD) principles tend to arrive at a similar architecture and normally contain the following layers:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-d559cb0 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"d559cb0\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4cace8e\" data-id=\"4cace8e\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-5f255d8 elementor-widget elementor-widget-text-editor\" data-id=\"5f255d8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul><li>Domain Layer<\/li><li>Application Layer<\/li><li>Data Layer<\/li><li>IoC Layer<\/li><li>Presentation Layer<\/li><li>Test Layer<\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-45dfb1f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"45dfb1f\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b76c757\" data-id=\"b76c757\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2769a5a elementor-widget elementor-widget-heading\" data-id=\"2769a5a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">How it works?<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-217165c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"217165c\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-9614eea\" data-id=\"9614eea\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8b85b87 elementor-widget elementor-widget-text-editor\" data-id=\"8b85b87\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Clean architecture puts the business logic (Application) and application model (Domain) at the centre of the application together called as Core.<\/p><p>The Core<strong>\u00a0<\/strong>has to be completely independent of data access and other infrastructure concerns, so we invert the dependencies. This is achieved by adding interfaces or abstractions in\u00a0Core\u00a0that are implemented by layers outside of\u00a0Core. For example, we need to implement the\u00a0Repository\u00a0Pattern we would add an interface within\u00a0Core<strong>\u00a0<\/strong>and add the implementation within\u00a0Infrastructure.Data.<\/p><p>All dependencies flow inwards and\u00a0Core<strong>\u00a0<\/strong>has no dependency on any other layer.\u00a0<\/p><p>Infrastructure.Data<strong>\u00a0<\/strong>and\u00a0Presentation<strong>\u00a0<\/strong>depend on\u00a0Core, but not on one another.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-68f4710 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"68f4710\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-c40574c\" data-id=\"c40574c\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-ffc14ca elementor-widget elementor-widget-heading\" data-id=\"ffc14ca\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">How to implement this?<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-6e2356d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"6e2356d\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2718014\" data-id=\"2718014\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-cc78bb0 elementor-widget elementor-widget-text-editor\" data-id=\"cc78bb0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul>\n<li><strong>Domain: <\/strong>Contains Entities (Business Models) and Repository Interfaces.<\/li>\n<li><strong>Application: <\/strong>Contains Service Interfaces and their Services, DTOs (Data Transfer Objects) and View Models.<\/li>\n<li><strong>Data<\/strong>: Contains EF Core types (DbContext, Migration), Data access implementation types (Repositories),Infrastructure-specific services (for example, FileLogger or SmtpNotifier).<\/li>\n<li><strong>Infrastructure<\/strong>.<strong>IoC<\/strong>:&nbsp; Contains Dependency Container class to help implement Dependency Inversion.<\/li>\n<li><strong>User Interface Types<\/strong>: Includes Controllers, Filters, Views, Startup.<\/li>\n<li><strong>Tests Types: <\/strong>Includes Unit Tests, Integration Tests.<\/li>\n<\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-83217dd elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"83217dd\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-679c6ba\" data-id=\"679c6ba\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8c2128d elementor-widget elementor-widget-heading\" data-id=\"8c2128d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">What are the Benefits of Clean Architecture?<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-14705df elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"14705df\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6f8e15e\" data-id=\"6f8e15e\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8ba9cde elementor-widget elementor-widget-text-editor\" data-id=\"8ba9cde\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul>\n<li><strong>Framework Independent<\/strong> &#8211; You can use clean architecture with ASP.NET (Core), Java, Python, etc. It doesn\u2019t rely on any software library or proprietary codebase.<\/li>\n<li><strong>Database Independent<\/strong>-Majority of your code has no knowledge of what database, if any, is being used by the application. Often, this info will exist in a single class, in a single project that no other project references.<\/li>\n<li><strong>UI Independent<\/strong>-The UI project cares about the UI only. It has nothing to do with the implementation of business or data logic.<\/li>\n<li><strong>Highly Testable<\/strong>&#8211; Apps built using this approach, and especially the core domain model and its business rules, are extremely testable.<\/li>\n<\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-710363f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"710363f\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-06b8216\" data-id=\"06b8216\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-857a95e elementor-widget elementor-widget-text-editor\" data-id=\"857a95e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>At <a href=\"https:\/\/www.planetecomsolutions.com\/\"><strong>PECS<\/strong><\/a>, we promote Clean Architecture across our architecture and delivery teams. Architecture focus has allowed us to deliver high performing scalable <a href=\"https:\/\/www.planetecomsolutions.com\/enterprise-web\/\"><strong>software development<\/strong><\/a> for more than 20 years. If your application is suffering from performance issues, the reason could be sub-optimal architecture. Feel free to give PECS a call to discuss your challenges and requirements and we\u2019ll be more than happy to share our experiences and assist.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Introduction Being a developer, have you ever written code that Is hard to understand because its intent or purpose was not clear? Has logics mixed? Is hard to debug? Is compiling fine but full of logical bugs? Painful to test? If the answer is \u201cYes I have\u201d, you are reading the right blog. Being progressive [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":2897,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,25],"tags":[],"class_list":["post-2882","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical","category-services"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\r\n<title>What is Clean Architecture and why you should use it?<\/title>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"What is Clean Architecture and why you should use it?\" \/>\r\n<meta property=\"og:description\" content=\"Introduction Being a developer, have you ever written code that Is hard to understand because its intent or purpose was not clear? Has logics mixed? Is hard to debug? Is compiling fine but full of logical bugs? Painful to test? If the answer is \u201cYes I have\u201d, you are reading the right blog. Being progressive [&hellip;]\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/\" \/>\r\n<meta property=\"og:site_name\" content=\"PECS\" \/>\r\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/planetecom\" \/>\r\n<meta property=\"article:published_time\" content=\"2020-06-17T04:00:19+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2022-12-22T10:52:38+00:00\" \/>\r\n<meta property=\"og:image\" content=\"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy.jpg\" \/>\r\n\t<meta property=\"og:image:width\" content=\"1195\" \/>\r\n\t<meta property=\"og:image:height\" content=\"501\" \/>\r\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\r\n<meta name=\"author\" content=\"Gopal Gaur\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:creator\" content=\"@planetecoms\" \/>\r\n<meta name=\"twitter:site\" content=\"@planetecoms\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gopal Gaur\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/\"},\"author\":{\"name\":\"Gopal Gaur\",\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/#\/schema\/person\/f9b045eaa7f23cef855cbabe6a5de47c\"},\"headline\":\"What is clean architecture and why you should use it?\",\"datePublished\":\"2020-06-17T04:00:19+00:00\",\"dateModified\":\"2022-12-22T10:52:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/\"},\"wordCount\":667,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy.jpg\",\"articleSection\":[\"Technical\",\"Services\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/\",\"url\":\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/\",\"name\":\"What is Clean Architecture and why you should use it?\",\"isPartOf\":{\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy.jpg\",\"datePublished\":\"2020-06-17T04:00:19+00:00\",\"dateModified\":\"2022-12-22T10:52:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#primaryimage\",\"url\":\"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy.jpg\",\"contentUrl\":\"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy.jpg\",\"width\":1195,\"height\":501,\"caption\":\"Clean Arch\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.planetecomsolutions.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is clean architecture and why you should use it?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/#website\",\"url\":\"https:\/\/www.planetecomsolutions.com\/blog\/\",\"name\":\"PECS\",\"description\":\"Blog\",\"publisher\":{\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.planetecomsolutions.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/#organization\",\"name\":\"Planet E-Com Solutions(PECS)\",\"url\":\"https:\/\/www.planetecomsolutions.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/01\/p-logo.png\",\"contentUrl\":\"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/01\/p-logo.png\",\"width\":32,\"height\":32,\"caption\":\"Planet E-Com Solutions(PECS)\"},\"image\":{\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/planetecom\",\"https:\/\/x.com\/planetecoms\",\"https:\/\/www.linkedin.com\/company\/planetecom\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/#\/schema\/person\/f9b045eaa7f23cef855cbabe6a5de47c\",\"name\":\"Gopal Gaur\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.planetecomsolutions.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9bb8fb1e38583e741817ef608fb1dcf60944853cff3a8af7f79873e77c9a5162?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9bb8fb1e38583e741817ef608fb1dcf60944853cff3a8af7f79873e77c9a5162?s=96&d=mm&r=g\",\"caption\":\"Gopal Gaur\"},\"sameAs\":[\"https:\/\/www.planetecomsolutions.com\"],\"url\":\"https:\/\/www.planetecomsolutions.com\/blog\/author\/chitral-gupta\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Clean Architecture and why you should use it?","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:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/","og_locale":"en_US","og_type":"article","og_title":"What is Clean Architecture and why you should use it?","og_description":"Introduction Being a developer, have you ever written code that Is hard to understand because its intent or purpose was not clear? Has logics mixed? Is hard to debug? Is compiling fine but full of logical bugs? Painful to test? If the answer is \u201cYes I have\u201d, you are reading the right blog. Being progressive [&hellip;]","og_url":"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/","og_site_name":"PECS","article_publisher":"https:\/\/www.facebook.com\/planetecom","article_published_time":"2020-06-17T04:00:19+00:00","article_modified_time":"2022-12-22T10:52:38+00:00","og_image":[{"width":1195,"height":501,"url":"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy.jpg","type":"image\/jpeg"}],"author":"Gopal Gaur","twitter_card":"summary_large_image","twitter_creator":"@planetecoms","twitter_site":"@planetecoms","twitter_misc":{"Written by":"Gopal Gaur","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#article","isPartOf":{"@id":"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/"},"author":{"name":"Gopal Gaur","@id":"https:\/\/www.planetecomsolutions.com\/blog\/#\/schema\/person\/f9b045eaa7f23cef855cbabe6a5de47c"},"headline":"What is clean architecture and why you should use it?","datePublished":"2020-06-17T04:00:19+00:00","dateModified":"2022-12-22T10:52:38+00:00","mainEntityOfPage":{"@id":"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/"},"wordCount":667,"commentCount":0,"publisher":{"@id":"https:\/\/www.planetecomsolutions.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#primaryimage"},"thumbnailUrl":"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy.jpg","articleSection":["Technical","Services"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/","url":"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/","name":"What is Clean Architecture and why you should use it?","isPartOf":{"@id":"https:\/\/www.planetecomsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#primaryimage"},"image":{"@id":"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#primaryimage"},"thumbnailUrl":"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy.jpg","datePublished":"2020-06-17T04:00:19+00:00","dateModified":"2022-12-22T10:52:38+00:00","breadcrumb":{"@id":"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#primaryimage","url":"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy.jpg","contentUrl":"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/blog-arch-copy-Copy.jpg","width":1195,"height":501,"caption":"Clean Arch"},{"@type":"BreadcrumbList","@id":"https:\/\/www.planetecomsolutions.com\/blog\/what-is-clean-architecture-and-why-you-should-use-it\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.planetecomsolutions.com\/blog\/"},{"@type":"ListItem","position":2,"name":"What is clean architecture and why you should use it?"}]},{"@type":"WebSite","@id":"https:\/\/www.planetecomsolutions.com\/blog\/#website","url":"https:\/\/www.planetecomsolutions.com\/blog\/","name":"PECS","description":"Blog","publisher":{"@id":"https:\/\/www.planetecomsolutions.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.planetecomsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.planetecomsolutions.com\/blog\/#organization","name":"Planet E-Com Solutions(PECS)","url":"https:\/\/www.planetecomsolutions.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.planetecomsolutions.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/01\/p-logo.png","contentUrl":"https:\/\/www.planetecomsolutions.com\/blog\/wp-content\/uploads\/2020\/01\/p-logo.png","width":32,"height":32,"caption":"Planet E-Com Solutions(PECS)"},"image":{"@id":"https:\/\/www.planetecomsolutions.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/planetecom","https:\/\/x.com\/planetecoms","https:\/\/www.linkedin.com\/company\/planetecom"]},{"@type":"Person","@id":"https:\/\/www.planetecomsolutions.com\/blog\/#\/schema\/person\/f9b045eaa7f23cef855cbabe6a5de47c","name":"Gopal Gaur","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.planetecomsolutions.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9bb8fb1e38583e741817ef608fb1dcf60944853cff3a8af7f79873e77c9a5162?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9bb8fb1e38583e741817ef608fb1dcf60944853cff3a8af7f79873e77c9a5162?s=96&d=mm&r=g","caption":"Gopal Gaur"},"sameAs":["https:\/\/www.planetecomsolutions.com"],"url":"https:\/\/www.planetecomsolutions.com\/blog\/author\/chitral-gupta\/"}]}},"_links":{"self":[{"href":"https:\/\/www.planetecomsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2882","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.planetecomsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.planetecomsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.planetecomsolutions.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.planetecomsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=2882"}],"version-history":[{"count":22,"href":"https:\/\/www.planetecomsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2882\/revisions"}],"predecessor-version":[{"id":2909,"href":"https:\/\/www.planetecomsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2882\/revisions\/2909"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.planetecomsolutions.com\/blog\/wp-json\/wp\/v2\/media\/2897"}],"wp:attachment":[{"href":"https:\/\/www.planetecomsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.planetecomsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.planetecomsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}