<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Anmar Hani</title>
    <description>The latest articles on Forem by Anmar Hani (@anmarhaniv1).</description>
    <link>https://forem.com/anmarhaniv1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F892890%2F1e1b6920-8694-49c7-8e9c-9bca0a6fdee8.png</url>
      <title>Forem: Anmar Hani</title>
      <link>https://forem.com/anmarhaniv1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/anmarhaniv1"/>
    <language>en</language>
    <item>
      <title>Software Evolution and Maintenance In The Process</title>
      <dc:creator>Anmar Hani</dc:creator>
      <pubDate>Fri, 08 Sep 2023 07:50:58 +0000</pubDate>
      <link>https://forem.com/anmarhaniv1/software-evolution-and-maintenance-in-the-process-160p</link>
      <guid>https://forem.com/anmarhaniv1/software-evolution-and-maintenance-in-the-process-160p</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Software evolution and maintenance are crucial aspects of software development that enable organizations to continuously improve and maintain their products. In today's fast-paced digital landscape, software systems must constantly evolve to stay relevant and meet the ever-changing needs of users. This guide will cover everything you need to know about software evolution and maintenance, from the basics to advanced concepts, tools, and techniques.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Software Evolution and Maintenance?
&lt;/h2&gt;

&lt;p&gt;Software evolution refers to the process of enhancing or modifying existing software to meet changing user needs, adapt to new technologies, or fix bugs. Maintenance, on the other hand, involves ensuring that the software continues to function correctly after it has been released. Both evolution and maintenance are critical components of the software development life cycle (SDLC).&lt;/p&gt;

&lt;h2&gt;
  
  
  Recapping the Software Process
&lt;/h2&gt;

&lt;p&gt;The software process typically consists of several stages and we have walked into every activity in detail. Recapping, the following steps provide a general overview of the process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Specification:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this stage, stakeholders define the requirements for the software, including the functionalities, performance, and usability criteria.    &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Development:&lt;/strong&gt; &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Consists of design and implementation. Designers and Architects Design the Software System based on the specified requirements. Developers create the initial version of the software based on the design.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Verification and Validation:&lt;/strong&gt; &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Testers verify that the developed software meets the specified requirements and validate that it functions correctly.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Evolution and Maintenance:&lt;/strong&gt; &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This stage involves identifying opportunities for improving the software and implementing those changes. Evolution may involve adding new features, fixing bugs, optimizing performance, or upgrading to newer versions of programming languages or frameworks. Maintenace may involve fixing issues, bugs, or errors. It consists of several activites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deployment:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once the evolved software has been designed, implemented, tested, and validated, it is deployed to production environments.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Observability:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After deployment, developers monitor the software to identify potential issues and gather insights into how users interact with the application.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Evaluate and Analyse Changes&lt;/strong&gt;:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this phase you may see if you need to add a feature based on stakeholders or clients or to fix a bug based on observability, so you prepare for an evolution or a maintenance, and from here it restarts all the software process if needed, or maybe just restart from implementation activity so just add the new code, test, then deploy.&lt;/p&gt;

&lt;h2&gt;
  
  
  CI/CD
&lt;/h2&gt;

&lt;p&gt;Continuous Integration and Continuous Deployment (CI/CD) is a pipeline that includes integration and updating of the software and deploying it. The CI/CD pipeline typically contains the following phases:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Integration:&lt;/strong&gt; &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this phase, developers integrate the code changes made during the development phase. This phase also includes testing, either manual or automatic, to ensure that the integrated code works correctly.    Building: Once the code has been integrated, it is built into an executable format. This phase may also include packaging the software into a distributable format.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Version Control:&lt;/strong&gt; &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Version control systems are used to keep track of changes made to the software. Each version is assigned a unique identifier, allowing developers to revert to previous versions if necessary.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Deployment:&lt;/strong&gt; &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The final phase of the CI/CD pipeline is deployment. This phase involves deploying the updated software to production environments. There are different types of deployments, such as desktop, web, mobile, or other, and each type may have its own specific deployment methods.&lt;/p&gt;

&lt;h2&gt;
  
  
  DevOps and Automation
&lt;/h2&gt;

&lt;p&gt;DevOps is a set of practices that emphasizes communication, collaboration, and automation between development and operations teams. DevOps makes the automation of integration of code with making it easier on the development and testing phase with docker containers, also, making it easier to deploy with infrastructure as code and images and others and whatever.. DevOps tools and techniques include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Docker:&lt;/strong&gt;&lt;br&gt;
Docker allows developers to package the software and its dependencies into a single container, making it easy to deploy across different environments.    Kubernetes: Kubernetes is an open-source platform that automates the deployment, scaling, and management of containerized applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ansible:&lt;/strong&gt;&lt;br&gt;
Ansible is an open-source tool that automates the provisioning, configuration, and deployment of infrastructure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Terraform:&lt;/strong&gt; &lt;br&gt;
Terraform is an open-source tool that allows developers to define and manage infrastructure as code.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Monitoring and Observability
&lt;/h2&gt;

&lt;p&gt;Monitoring and observability are critical aspects of software evolution and maintenance. Monitoring involves tracking the performance, usage, and other characteristics of software applications. Observability, on the other hand, involves gaining insights into how users interact with the application. Here are some common monitoring and observability tools and techniques:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Log Analysis:&lt;/strong&gt; Log analysis involves collecting and analyzing logs generated by the software to identify potential issues and understand how the software behaves in different scenarios.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Health Checks:&lt;/strong&gt; Health checks involve monitoring the software's health by checking for metrics such as response time, error rates, and CPU usage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User Analytics:&lt;/strong&gt; User analytics involve tracking user behavior patterns to understand how users interact with the software and identify areas for improvement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;APM:&lt;/strong&gt; Application Performance Management (APM) involves monitoring the performance of software applications and identifying bottlenecks and issues that affect performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Software evolution and maintenance are essential parts of the SDLC that enable organizations to continuously improve and maintain their products. Understanding the process, tools, and techniques used in these activities can help developers create high-quality software that meets the needs of users and stays ahead of emerging technologies. From CI/CD and DevOps to monitoring and observability, there are many tools and techniques available to support software evolution and maintenance. By leveraging these resources, organizations can ensure that their software remains relevant, reliable, and efficient over time.&lt;/p&gt;




&lt;h1&gt;
  
  
  Real-World Skills and Diving Deeper
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://roadmap.sh/devops"&gt;DevOps Roadmap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://roadmap.sh/docker"&gt;Docker Roadmap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://roadmap.sh/kubernetes"&gt;Kubernetes Roadmap&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Jobs:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;DevOps Engineer&lt;/li&gt;
&lt;li&gt;Software Engineer&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  TODO:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Table of contents&lt;/li&gt;
&lt;li&gt;reference to other articles for deeper understanding on devops or to roadmap.sh&lt;/li&gt;
&lt;li&gt;Add more observability types like 
Log aggregation
Application metrics
Audit logging
Distributed tracing
Exception tracking
Health check API
Log deployments and changes&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devops</category>
      <category>tutorial</category>
      <category>softwareengineering</category>
      <category>software</category>
    </item>
    <item>
      <title>Software Verification and Validation in The Process</title>
      <dc:creator>Anmar Hani</dc:creator>
      <pubDate>Fri, 08 Sep 2023 07:48:18 +0000</pubDate>
      <link>https://forem.com/anmarhaniv1/software-verification-and-validation-in-the-process-27pd</link>
      <guid>https://forem.com/anmarhaniv1/software-verification-and-validation-in-the-process-27pd</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Testing Types&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Validation

&lt;ul&gt;
&lt;li&gt;Functional

&lt;ul&gt;
&lt;li&gt;Unit Testing&lt;/li&gt;
&lt;li&gt;Integration Testing&lt;/li&gt;
&lt;li&gt;System Testing&lt;/li&gt;
&lt;li&gt;Regression Testing&lt;/li&gt;
&lt;li&gt;Object-Oriented Testing&lt;/li&gt;
&lt;li&gt;Sanity Testing&lt;/li&gt;
&lt;li&gt;Smoke Testing&lt;/li&gt;
&lt;li&gt;GUI Testing&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Non-Functional

&lt;ul&gt;
&lt;li&gt;Usability Testing
&lt;/li&gt;
&lt;li&gt;Security Testing&lt;/li&gt;
&lt;li&gt;Performance Testing

&lt;ul&gt;
&lt;li&gt;Scalability&lt;/li&gt;
&lt;li&gt;Stress&lt;/li&gt;
&lt;li&gt;Load Testing&lt;/li&gt;
&lt;li&gt;Stability Testing&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Installation Testing&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Verification

&lt;ul&gt;
&lt;li&gt;Acceptance Testing&lt;/li&gt;
&lt;li&gt;Alpha Testing&lt;/li&gt;
&lt;li&gt;End-to-end Tests&lt;/li&gt;
&lt;li&gt;User Testing&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Software Testing Activities&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Requirement analysis.&lt;/li&gt;
&lt;li&gt;Test planning.&lt;/li&gt;
&lt;li&gt;Test case identification, design and development.&lt;/li&gt;
&lt;li&gt;Coverage

&lt;ul&gt;
&lt;li&gt;Human-Based&lt;/li&gt;
&lt;li&gt;Criteria-Based&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Test environment setup.&lt;/li&gt;
&lt;li&gt;Test execution.&lt;/li&gt;
&lt;li&gt;Test cycle closure.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;TODO: Complete this section&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Testing Types
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;TODO: Complete this section&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Testing can be categorized (in a very high-level) based on the knowledge of the system under test as either black, white, or grey box testing. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;White box testing&lt;/strong&gt; (also known as clear, glass box or structural testing) is a testing technique which evaluates the code and the internal structure of a program. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Black box testing&lt;/strong&gt; (also known as functional testing) is a testing technique which ignores the internal parts and focus on the output is as expected or not. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Grey box testing&lt;/strong&gt; is the combination of both White Box and Black Box Testing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kX_ttcmV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://static.javatpoint.com/tutorial/software-testing/images/types-of-software-testing.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kX_ttcmV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://static.javatpoint.com/tutorial/software-testing/images/types-of-software-testing.png" alt="Types of Software Testing" width="650" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Source from Javatpoint&lt;/p&gt;

&lt;p&gt;Verification: “Are we building the product right?” &lt;br&gt;
Validation: “Are we building the right product?” &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Validation
&lt;/h3&gt;

&lt;p&gt;Validation is intended to ensure a product, service, or system (or portion thereof, or set thereof) results in a product, service, or system (or portion thereof, or set thereof) that meets the operational needs of the user. It consists of two types, functional or non-functional testing.&lt;/p&gt;

&lt;h4&gt;
  
  
  Functional Testing
&lt;/h4&gt;

&lt;p&gt;Functional testing is a type of testing which verifies that each function of the software application operates in conformance with the requirement specification. This testing mainly involves black box testing and it is not concerned about the source code of the application.&lt;/p&gt;

&lt;h4&gt;
  
  
  Non-Functional Testing
&lt;/h4&gt;

&lt;h3&gt;
  
  
  Verification
&lt;/h3&gt;

&lt;p&gt;Verification is intended to check that a product, service, or system meets a set of design specifications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Software Testing Activities
&lt;/h2&gt;

&lt;p&gt;After we knew most testing types, now we deep in &lt;strong&gt;software testing activities&lt;/strong&gt;. They are the various tasks and processes involved in ensuring that a software product meets specified requirements and works as expected. These activities include:&lt;/p&gt;

&lt;h3&gt;
  
  
  Requirement Analysis
&lt;/h3&gt;

&lt;p&gt;Requirement Analysis is a crucial activity that involves understanding and analyzing the requirements of the software system to be tested. It helps in identifying the scope of testing, defining test objectives, and ensuring that the testing process aligns with the project's goals. Here are some details about the Requirement Analysis activity and best practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understanding Requirements: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first step in Requirement Analysis is to thoroughly understand the software requirements. This involves reviewing the functional and non-functional requirements, user stories, use cases, and any other relevant documentation.    &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clarifying Ambiguities: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;During Requirement Analysis, it is essential to identify and clarify any ambiguities or inconsistencies in the requirements. This can be done by discussing with stakeholders, developers, and business analysts to ensure a clear understanding of the expected behavior of the software.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identifying Testable Requirements: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Testable requirements are those that can be validated through testing. It is important to identify and prioritize the testable requirements to ensure comprehensive test coverage. This can be done by mapping requirements to test cases or test scenarios.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Defining Test Objectives: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Based on the requirements, the testing team should define clear and measurable test objectives. These objectives should align with the project goals and help in evaluating the quality of the software system.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identifying Risks: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Requirement Analysis should also involve identifying potential risks and their impact on the testing process. This includes understanding dependencies, constraints, and potential challenges that may affect the testing effort.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Collaboration and Communication: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Effective collaboration and communication with stakeholders, developers, and business analysts are crucial during Requirement Analysis. Regular meetings, discussions, and documentation should be used to ensure a shared understanding of the requirements.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Documentation: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is important to document the analyzed requirements, including any assumptions, constraints, or decisions made during the process. This documentation serves as a reference for the testing team and helps in maintaining traceability between requirements and test cases.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Continuous Requirement Review: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Requirement Analysis is an iterative process, and it is important to continuously review and update the requirements as the project progresses. This helps in accommodating changes, addressing new insights, and ensuring that the testing process remains aligned with the evolving requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test Planning
&lt;/h3&gt;

&lt;p&gt;The goal of this activity is to define the overall approach and strategy for testing a software system. It involves creating a comprehensive plan that outlines the scope, objectives, resources, and timelines for the testing process.&lt;/p&gt;

&lt;h4&gt;
  
  
  During the Test Planning activity, you can perform several tasks, including:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Defining the test objectives: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Clearly state what you aim to achieve through testing, such as identifying defects, ensuring system functionality, or validating specific requirements.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identifying the scope: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Determine the boundaries of the testing effort, including which features, modules, or components will be tested and which will be excluded.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating a test strategy: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Develop a high-level approach to testing, considering factors like test levels (unit, integration, system, etc.), test types (functional, performance, security, etc.), and the use of manual and automated testing techniques.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Estimating resources: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Determine the number of testers, test environments, tools, and equipment required for the testing process. This includes considering the availability of hardware, software, and personnel.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Defining test deliverables: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Specify the documents and artifacts that will be produced during testing, such as test plans, test cases, test scripts, and test reports.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Establishing test schedules: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create a timeline that outlines the sequence of testing activities, milestones, and deadlines. This helps in coordinating testing efforts with other project activities.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Risk assessment and mitigation: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Identify potential risks and challenges that may impact the testing process. Develop strategies to mitigate these risks and ensure smooth testing operations.&lt;/p&gt;

&lt;h4&gt;
  
  
  Best practices for test planning include:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Involving stakeholders: Collaborate with project managers, developers, business analysts, and other relevant stakeholders to gather input and ensure alignment with project goals.&lt;/li&gt;
&lt;li&gt;Prioritizing test objectives: Clearly define the most critical aspects of the software system to focus testing efforts on areas that are most likely to have a significant impact on the system's quality.&lt;/li&gt;
&lt;li&gt;Considering test coverage: Aim for comprehensive coverage by selecting appropriate test techniques and ensuring that all critical functionalities, use cases, and scenarios are addressed.&lt;/li&gt;
&lt;li&gt;Adapting to project constraints: Take into account project timelines, budget limitations, and resource availability while planning the testing activities.&lt;/li&gt;
&lt;li&gt;Reviewing and refining the plan: Regularly review and update the test plan as the project progresses, incorporating feedback and lessons learned from previous testing phases.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  To create a good test plan, consider the following steps:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Understand the project requirements and objectives thoroughly.&lt;/li&gt;
&lt;li&gt;Identify the key stakeholders and involve them in the planning process.&lt;/li&gt;
&lt;li&gt;Define clear and measurable test objectives.&lt;/li&gt;
&lt;li&gt;Determine the scope and boundaries of the testing effort.&lt;/li&gt;
&lt;li&gt;Select appropriate test techniques and strategies based on the project's needs.&lt;/li&gt;
&lt;li&gt;Estimate the required resources and create a realistic schedule.&lt;/li&gt;
&lt;li&gt;Identify and mitigate potential risks.&lt;/li&gt;
&lt;li&gt;Document the plan in a clear and concise manner, ensuring it is easily understandable by all team members.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Test Case Identification, Design, and Development
&lt;/h3&gt;

&lt;p&gt;Here, the testing team designs the test cases based on the software requirements. The test cases specify the conditions under which a tester will determine whether an application, software system, or one of its features is working as it was originally established for it to do. &lt;/p&gt;

&lt;p&gt;Test Case Design and Development activity involves creating detailed test cases that will be used to verify the functionality of the software being tested. &lt;/p&gt;

&lt;p&gt;The goal of this activity is to ensure that all aspects of the software are thoroughly tested and that any defects or issues are identified and addressed.&lt;/p&gt;

&lt;h4&gt;
  
  
  During this activity, you can perform the following tasks:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Test Case Identification&lt;/strong&gt;: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Identify the specific test scenarios and conditions that need to be covered by the test cases.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Test Case Design:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create and document the actual test cases, including the steps to be executed, the expected results, and any necessary test data or preconditions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Test Case Development&lt;/strong&gt;: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Start developing the test code if it is designed to be code. You can start writing unit and integration tests here.&lt;/p&gt;

&lt;h4&gt;
  
  
  To ensure a well-structured and effective test case identification, design, and documentation, consider the following best practices:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Test Coverage: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ensure that the test cases cover all the important functionalities and features of the software. This can be achieved by using techniques like equivalence partitioning, boundary value analysis, and decision table testing. Also, you can design test cases for best coverage based on the return values and exceptions that may be thrown that is in the &lt;strong&gt;docstrings of functions and classes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Types include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Human-based coverage: &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This type of test coverage focuses on the expertise and intuition of human testers. It involves the testers' ability to identify potential risks, vulnerabilities, and areas of the system that require thorough testing. Human-based coverage relies on the knowledge and experience of the testers to ensure that critical functionalities and scenarios are adequately tested. Testers may use their understanding of the system, user behavior, and potential edge cases to design test cases and execute them.    &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Criteria-based coverage: &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This type of test coverage is based on predefined criteria or specifications. It involves systematically testing the system against a set of predetermined conditions or requirements. Criteria-based coverage ensures that all specified functionalities, features, and scenarios are tested. This approach typically involves creating test cases based on requirements, specifications, or user stories. Examples of criteria-based coverage techniques include statement coverage, branch coverage, path coverage, and decision coverage.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clarity and Simplicity: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Write test cases in a clear and concise manner, using simple language and avoiding ambiguity. This helps testers understand and execute the test cases accurately.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reusability: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Design test cases that can be reused across different test cycles or for regression testing. This saves time and effort in the long run.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Traceability: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Establish traceability between test cases and requirements, ensuring that each requirement is covered by at least one test case. This helps in verifying the completeness of the testing process.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prioritization: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Prioritize test cases based on risk, importance, or criticality. This ensures that the most critical functionalities are tested first.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maintainability: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Regularly review and update test cases to keep them up-to-date with any changes in the software or requirements.&lt;/p&gt;

&lt;h4&gt;
  
  
  Model-Driven Design Testing
&lt;/h4&gt;

&lt;p&gt;Model-driven testing is a methodology that uses models to represent the functionality of the system under test. These models are used to guide the design of the test cases.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test Environment Setup
&lt;/h3&gt;

&lt;p&gt;A test environment is created according to the requirements of the software. This might include setting up of the server, client machines, operating system, hardware, software and network connectivity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test Execution
&lt;/h3&gt;

&lt;p&gt;The test cases are executed in the testing environment, whether it is functional or nonfunctional During this stage, the testers execute tests manually or developers and testers start running code that is built in the design and development phase.&lt;/p&gt;

&lt;h4&gt;
  
  
  Data-Driven Testing
&lt;/h4&gt;

&lt;p&gt;Data-driven testing is a methodology that separates the test script logic and the test data. It allows you to test how the application handles various inputs effectively.&lt;/p&gt;

&lt;h4&gt;
  
  
  Test Automation
&lt;/h4&gt;

&lt;p&gt;Making tests as code and integrating tests in CI/CD pipelines (&lt;em&gt;That we will discuss in the next article&lt;/em&gt;) will automate the testing execution activity. &lt;/p&gt;

&lt;p&gt;So, for examples when finishing the development phase and before integrating the code to the system, &lt;/p&gt;

&lt;p&gt;you can run unit and integration tests. &lt;/p&gt;

&lt;p&gt;After that, you can run other functional testing and system tests. &lt;/p&gt;

&lt;p&gt;After building the main code, you may run smoke , nonfunctional, and regression testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test Cycle Closure
&lt;/h3&gt;

&lt;p&gt;In this final stage, the validationthe testing team meets to evaluate the cycle completion criteria based on Test coverage, Quality, Cost, Time, Critical Business Objectives, and Software. They discuss what went well, which areas need to be improved and what can be learned from the project. Also, you can create test reports for developers to retest and evaluate next tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Software testing is a vast field with many different aspects. This guide provides a comprehensive overview of the various activities, models, types, and tools involved in software testing. Whether you're a seasoned tester or just starting out in the field, understanding these concepts can help you to design and execute effective tests, ensuring that the software you're testing is of the highest possible quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  References:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Javatpoint&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Verification_and_validation"&gt;Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Real-World Skills and Diving Deeper
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://roadmap.sh/qa"&gt;Quality Engineer Roadmap&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Jobs:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Software Tester&lt;/li&gt;
&lt;li&gt;Software Developer &lt;/li&gt;
&lt;li&gt;Quality Assurance Engineer&lt;/li&gt;
&lt;li&gt;Peneteration Tester&lt;/li&gt;
&lt;/ol&gt;




&lt;h1&gt;
  
  
  What's Next?
&lt;/h1&gt;

&lt;p&gt;Next activity is the Evolution and Maintainance, where we start making the the process of evolving and automating the software process.&lt;/p&gt;




&lt;h2&gt;
  
  
  TODO:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Give details in designing and how to design the flow and make test cases and better coverage with the less test cases possible&lt;/li&gt;
&lt;li&gt;Give examples with python&lt;/li&gt;
&lt;li&gt;Give details in types&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>testing</category>
      <category>devops</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Software Development (Implementation and Construction) in The Process</title>
      <dc:creator>Anmar Hani</dc:creator>
      <pubDate>Fri, 08 Sep 2023 06:55:56 +0000</pubDate>
      <link>https://forem.com/anmarhaniv1/software-development-implementation-and-construction-in-the-process-43hh</link>
      <guid>https://forem.com/anmarhaniv1/software-development-implementation-and-construction-in-the-process-43hh</guid>
      <description>&lt;h2&gt;
  
  
  Table of contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;
Software Implementation Process Activities

&lt;ul&gt;
&lt;li&gt;
Coding

&lt;ul&gt;
&lt;li&gt;Design Patterns&lt;/li&gt;
&lt;li&gt;Coding Principles&lt;/li&gt;
&lt;li&gt;Clean and Quality Code Practices and Guidelines&lt;/li&gt;
&lt;li&gt;General Rules&lt;/li&gt;
&lt;li&gt;Effective Use of Variables&lt;/li&gt;
&lt;li&gt;Commenting&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;Classes (OOP)&lt;/li&gt;
&lt;li&gt;Code Formatting&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Debugging&lt;/li&gt;
&lt;li&gt;Error Handling&lt;/li&gt;
&lt;li&gt;
Writing Tests

&lt;ul&gt;
&lt;li&gt;Unit Tests&lt;/li&gt;
&lt;li&gt;Integration Tests&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Documentation&lt;/li&gt;
&lt;li&gt;Refactoring&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Code Smells (Bad Code Practices)&lt;/li&gt;
&lt;li&gt;Good Codebase Folder Structure&lt;/li&gt;
&lt;li&gt;
Software Development Types

&lt;ul&gt;
&lt;li&gt;Desktop Applications&lt;/li&gt;
&lt;li&gt;Web Applications&lt;/li&gt;
&lt;li&gt;Mobile Applications&lt;/li&gt;
&lt;li&gt;CLI Applications&lt;/li&gt;
&lt;li&gt;Embedded Systems Softwares&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Some Useful Tools for Software Implementation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In the world of software development, writing &lt;strong&gt;clean code&lt;/strong&gt; and implementing software efficiently are two critical skills. This guide aims to provide a comprehensive overview of these topics, covering everything from programming languages to essential development tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Understanding Programming Languages' Types&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Low-Level Languages&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. &lt;strong&gt;Machine Code&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Machine code is the lowest level of programming language, consisting of binary instructions that directly manipulate a computer's hardware.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. &lt;strong&gt;Assembly&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Assembly language is a step above machine code, providing a more human-readable format while still offering direct hardware control.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;High-Level Languages&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. &lt;strong&gt;Procedural&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Procedural languages, such as C and Pascal, structure code into procedures or routines.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. &lt;strong&gt;Functional&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Functional languages, like Haskell and Lisp, treat computation as the evaluation of mathematical functions and avoid changing-state and mutable data.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. &lt;strong&gt;Object-oriented&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Object-oriented languages, such as Java and Python, organize code into objects that contain both data and methods. For example, in Python, you can create a class &lt;code&gt;Car&lt;/code&gt; with attributes like &lt;code&gt;year&lt;/code&gt; and &lt;code&gt;model&lt;/code&gt;, and methods like &lt;code&gt;drive&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Car&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;year&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;year&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;year&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;drive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Moving..!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  4. &lt;strong&gt;Scripting&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Scripting languages, like JavaScript and Ruby, are typically used for automating tasks in web and software applications. Python is also widely used as a scripting language.&lt;/p&gt;

&lt;h4&gt;
  
  
  5. &lt;strong&gt;Logic&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Logic programming languages, such as Prolog, are used primarily for AI and mathematical applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Software Implementation Process Activites&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Coding
&lt;/h3&gt;

&lt;p&gt;Coding is the process of translating software requirements into a programming language. It involves writing (quality) code that is functional, maintainable, clean, and scalable. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clean and Quality code practices envolves:&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Design Patterns
&lt;/h4&gt;

&lt;p&gt;Design patterns are reusable solutions to common problems in software design. Types are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Creational:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These patterns deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. Its types are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Singleton Pattern:&lt;/strong&gt; Ensures that a class has only one instance and provides a global point of access to it. This pattern is useful when you want to limit the number of instances of a class.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Singleton&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;_instance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__new__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cls&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;cls&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_instance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;cls&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_instance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;super&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;__new__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cls&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;cls&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_instance&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Factory Pattern:&lt;/strong&gt; Provides an interface for creating objects, but allows subclasses to decide which class to instantiate. This pattern is useful when you want to delegate the object creation logic to subclasses.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Animal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;speak&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Animal&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;speak&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"This is a Dog!"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Cat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Animal&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;speak&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"This is a Cat!"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AnimalFactory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_animal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;animal_type&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;animal_type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;"dog"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Dog&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;animal_type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;"cat"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Cat&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nb"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Invalid animal type"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;factory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;AnimalFactory&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;animal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;create_animal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"dog"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;animal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;speak&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "This is a Dog!"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Abstract Factory Pattern:&lt;/strong&gt; Provides an interface for creating families of related or dependent objects without specifying their concrete classes. This pattern is useful when you want to create objects that are related or dependent on each other.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;WindowsButton&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Windows button clicked"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MacButton&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Mac button clicked"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;GUIFactory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_button&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;WindowsGUIFactory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;GUIFactory&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_button&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;WindowsButton&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MacGUIFactory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;GUIFactory&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_button&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;MacButton&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;factory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;WindowsGUIFactory&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;create_button&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;click&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "Windows button clicked"
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Builder Pattern:&lt;/strong&gt; Separates the construction of a complex object from its representation, allowing the same construction process to create different representations. This pattern is useful when you want to create complex objects step by step.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Pizza&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cheese&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pepperoni&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mushrooms&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__str__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"Size: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, Cheese: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cheese&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, Pepperoni: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pepperoni&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, Mushrooms: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mushrooms&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PizzaBuilder&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pizza&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pizza&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pizza&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add_cheese&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pizza&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cheese&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add_pepperoni&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pizza&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pepperoni&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add_mushrooms&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pizza&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mushrooms&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pizza&lt;/span&gt;

&lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;PizzaBuilder&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;pizza&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Large"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;add_cheese&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;add_pepperoni&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pizza&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "Size: Large, Cheese: True, Pepperoni: True, Mushrooms: False"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Prototype Pattern:&lt;/strong&gt; Creates new objects by cloning existing ones and modifying them as required. This pattern is useful when you want to create new objects by copying existing ones.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;copy&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Prototype&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;clone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcretePrototype&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Prototype&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;clone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deepcopy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;prototype&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcretePrototype&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Prototype"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;clone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;prototype&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;clone&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;clone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "Prototype"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Structural Patterns:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These patterns concern class and object composition. They use inheritance to compose interfaces and define ways to compose objects to obtain new functionality. Its Types are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Adapter Pattern:&lt;/strong&gt; Converts the interface of a class into another interface that clients expect. This pattern is useful when you want to make incompatible classes work together.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Adaptee&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;specific_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Adaptee's specific request"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Adapter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Target&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;adaptee&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;adaptee&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;adaptee&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;adaptee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;specific_request&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;adaptee&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Adaptee&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;adapter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Adapter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;adaptee&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "Adaptee's specific request"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Bridge Pattern:&lt;/strong&gt; Decouples an abstraction from its implementation, allowing them to vary independently. This pattern is useful when you want to separate the abstraction and implementation hierarchies.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Abstraction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;implementation&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;implementation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;implementation&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;implementation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;operation_implementation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Implementation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation_implementation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteImplementationA&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Implementation&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation_implementation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"ConcreteImplementationA operation"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteImplementationB&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Implementation&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation_implementation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"ConcreteImplementationB operation"&lt;/span&gt;

&lt;span class="n"&gt;implementation_a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteImplementationA&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;abstraction_a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Abstraction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;implementation_a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;abstraction_a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "ConcreteImplementationA operation"
&lt;/span&gt;
&lt;span class="n"&gt;implementation_b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteImplementationB&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;abstraction_b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Abstraction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;implementation_b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;abstraction_b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "ConcreteImplementationB operation"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Composite Pattern:&lt;/strong&gt; Composes objects into tree structures to represent part-whole hierarchies. This pattern is useful when you want to treat individual objects and compositions of objects uniformly.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Leaf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Leaf operation"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Composite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;child&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt;

&lt;span class="n"&gt;leaf1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Leaf&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;leaf2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Leaf&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;composite&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Composite&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;composite&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;leaf1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;composite&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;leaf2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;composite&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: ["Leaf operation", "Leaf operation"]
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Decorator Pattern:&lt;/strong&gt; Dynamically adds responsibilities to objects by wrapping them in an object of a decorator class. This pattern is useful when you want to add behavior to objects without modifying their code.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteComponent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"ConcreteComponent operation"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Decorator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;component&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteDecorator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Decorator&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"ConcreteDecorator operation, &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;

&lt;span class="n"&gt;component&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteComponent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;decorator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteDecorator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;decorator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "ConcreteDecorator operation, ConcreteComponent operation"
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Facade Pattern:&lt;/strong&gt; Provides a unified interface to a set of interfaces in a subsystem, simplifying the subsystem's usage. This pattern is useful when you want to provide a simple interface to a complex system.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SubsystemA&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation_a&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"SubsystemA operation"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SubsystemB&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation_b&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"SubsystemB operation"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Facade&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subsystem_a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SubsystemA&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subsystem_b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SubsystemB&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
        &lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subsystem_a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;operation_a&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
        &lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subsystem_b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;operation_b&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt;

&lt;span class="n"&gt;facade&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Facade&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;facade&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: ["SubsystemA operation", "SubsystemB operation"]
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Flyweight Pattern:&lt;/strong&gt; Reduces the memory footprint of objects by sharing common data across multiple objects. This pattern is useful when you want to optimize memory usage by sharing data that is common across objects.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Flyweight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;extrinsic_state&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteFlyweight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Flyweight&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;extrinsic_state&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"ConcreteFlyweight operation, Extrinsic State: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;extrinsic_state&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FlyweightFactory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;flyweights&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_flyweight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;flyweights&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;flyweights&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteFlyweight&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;flyweights&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;factory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FlyweightFactory&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;flyweight1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_flyweight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"key1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;flyweight2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_flyweight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"key2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;flyweight1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"state1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "ConcreteFlyweight operation, Extrinsic State: state1"
&lt;/span&gt;&lt;span class="n"&gt;flyweight2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"state2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "ConcreteFlyweight operation, Extrinsic State: state2"
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Proxy Pattern:&lt;/strong&gt; Provides a surrogate or placeholder for another object to control access to it. This pattern is useful when you want to add an extra layer of indirection to control the access to an object.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Subject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;RealSubject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Subject&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"RealSubject request"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Proxy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Subject&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;real_subject&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;real_subject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;real_subject&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;real_subject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;real_subject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;RealSubject&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;proxy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Proxy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;real_subject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "RealSubject request"
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Behavioral Patterns:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These patterns are about identifying common communication patterns between objects and realize these patterns. Its Types are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Chain of Responsibility Pattern:&lt;/strong&gt; Allows an object to pass a request along a chain of potential handlers until the request is handled. This pattern is useful when you want to decouple senders and receivers of a request.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Handler&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_successor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;successor&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;handle_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteHandlerA&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Handler&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_successor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;successor&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;successor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;successor&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;handle_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;"A"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"ConcreteHandlerA handled the request"&lt;/span&gt;
        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;successor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;successor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;handle_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Request cannot be handled"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteHandlerB&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Handler&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_successor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;successor&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;successor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;successor&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;handle_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;"B"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"ConcreteHandlerB handled the request"&lt;/span&gt;
        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;successor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;successor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;handle_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Request cannot be handled"&lt;/span&gt;

&lt;span class="n"&gt;handler_a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteHandlerA&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;handler_b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteHandlerB&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;handler_a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_successor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;handler_b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;handler_a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;handle_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"A"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "ConcreteHandlerA handled the request"
&lt;/span&gt;&lt;span class="n"&gt;handler_a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;handle_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"B"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "ConcreteHandlerB handled the request"
&lt;/span&gt;&lt;span class="n"&gt;handler_a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;handle_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"C"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "Request cannot be handled"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Command Pattern:&lt;/strong&gt; Encapsulates a request as an object, allowing you to parameterize clients with different requests, queue or log requests, and support undoable operations. This pattern is useful when you want to decouple the sender and receiver of a request.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Receiver&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Receiver action"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;receiver&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;receiver&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;receiver&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteCommand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Command&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;receiver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Invoker&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;command&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;command&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;command&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;execute_command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;receiver&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Receiver&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;command&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteCommand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;receiver&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;invoker&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Invoker&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;invoker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;invoker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute_command&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "Receiver action"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Interpreter Pattern:&lt;/strong&gt; Defines a representation for a grammar along with an interpreter to interpret the grammar. This pattern is useful when you want to evaluate sentences in a language.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;variables&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_variable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;variable_name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;variables&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;variable_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_variable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;variable_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;variables&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;variable_name&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AbstractExpression&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;interpret&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TerminalExpression&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AbstractExpression&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;variable_name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;variable_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;variable_name&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;interpret&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_variable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;variable_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;NonterminalExpression&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AbstractExpression&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;expression1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;expression2&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;expression1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;expression1&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;expression2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;expression2&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;interpret&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;expression1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;interpret&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;expression2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;interpret&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_variable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"x"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Hello, "&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_variable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"world!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;expression1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;TerminalExpression&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"x"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;expression2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;TerminalExpression&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"y"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;expression&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;NonterminalExpression&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;expression1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;expression2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;expression&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;interpret&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "Hello, world!"
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Iterator Pattern:&lt;/strong&gt; Provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation. This pattern is useful when you want to traverse a collection of objects without exposing its internal structure
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Iterator&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;has_next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteIterator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Iterator&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;collection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;collection&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;has_next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;has_next&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
            &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nb"&gt;StopIteration&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Collection&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_iterator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteCollection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Collection&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add_item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_iterator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;ConcreteIterator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;collection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteCollection&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Item 1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Item 2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;iterator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;create_iterator&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;iterator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;has_next&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;iterator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;next&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "Item 1", "Item 2"
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mediator Pattern:&lt;/strong&gt; Defines an object that encapsulates how a set of objects interact, promoting loose coupling between the objects. This pattern is useful when you want to reduce direct dependencies between objects.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Mediator&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;notify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteMediator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Mediator&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;component1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Component1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;component2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Component2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;notify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;component1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;component2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;handle_event&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;component2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;component1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;handle_event&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;BaseComponent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mediator&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mediator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mediator&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Component1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseComponent&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;handle_event&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"Component1 handled event: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;do_something&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mediator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;notify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Event from Component1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Component2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseComponent&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;handle_event&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"Component2 handled event: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;do_something&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mediator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;notify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Event from Component2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;mediator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteMediator&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;component1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Component1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mediator&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;component2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Component2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mediator&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;component1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;do_something&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "Component2 handled event: Event from Component1"
&lt;/span&gt;&lt;span class="n"&gt;component2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;do_something&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "Component1 handled event: Event from Component2"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Memento Pattern:&lt;/strong&gt; Captures and externalizes an object's internal state so that the object can be restored to this state later. This pattern is useful when you want to save and restore the state of an object.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Memento&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Originator&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_memento&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Memento&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;restore_memento&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;memento&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;memento&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_state&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;originator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Originator&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;originator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"State 1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;memento&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;originator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;create_memento&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;originator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"State 2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;originator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;restore_memento&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;memento&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;originator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "State 1"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Observer Pattern:&lt;/strong&gt; Defines a one-to-many dependency between objects, so that when one object changes state, all its dependents are notified and updated automatically. This pattern is useful when you want to notify multiple objects about changes in another object.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Observer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteObserver&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Observer&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"ConcreteObserver: Reacted to the event from &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__class__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__name__&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Subject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;observers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;attach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;observer&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;observers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;observer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;detach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;observer&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;observers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;observer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;notify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;observer&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;observers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;observer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteSubject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Subject&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;do_something&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"ConcreteSubject: I'm doing something."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;notify&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;subject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteSubject&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;observer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteObserver&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;attach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;observer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;do_something&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;State Pattern:&lt;/strong&gt; Allows an object to alter its behavior when its internal state changes. The object will appear to change its class. This pattern is useful when you want to change the behavior of an object based on its state.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;State&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteStateA&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;State&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"ConcreteStateA handling."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ConcreteStateB&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteStateB&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;State&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"ConcreteStateB handling."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ConcreteStateA&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ConcreteStateA&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "ConcreteStateA handling."
&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "ConcreteStateB handling."
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Strategy Pattern:&lt;/strong&gt; Defines a family of algorithms, encapsulates each one, and makes them interchangeable. This pattern is useful when you want to select an algorithm at runtime.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Strategy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteStrategyA&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Strategy&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"ConcreteStrategyA execution"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteStrategyB&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Strategy&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"ConcreteStrategyB execution"&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;strategy&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strategy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;strategy&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_strategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;strategy&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strategy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;strategy&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;execute_strategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strategy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ConcreteStrategyA&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute_strategy&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "ConcreteStrategyA execution"
&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_strategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ConcreteStrategyB&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute_strategy&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "ConcreteStrategyB execution"
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Template Method Pattern:&lt;/strong&gt; Defines the skeleton of an algorithm in a superclass but lets subclasses override specific steps of the algorithm without changing its structure. This pattern is useful when you want to let subclasses redefine certain steps of an algorithm without changing the algorithm's structure.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AbstractClass&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;template_method&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;primitive_operation1&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;primitive_operation2&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;primitive_operation1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;primitive_operation2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteClass&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AbstractClass&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;primitive_operation1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"ConcreteClass primitive operation1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;primitive_operation2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"ConcreteClass primitive operation2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;concrete_class&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteClass&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;concrete_class&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;template_method&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "ConcreteClass primitive operation1", "ConcreteClass primitive operation2"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Visitor Pattern:&lt;/strong&gt; Represents an operation to be performed on the elements of an object structure. This pattern is useful when you want to perform operations on objects without changing their classes.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Element&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;accept&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;visitor&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteElementA&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Element&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;accept&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;visitor&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;visitor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;visit_concrete_element_a&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteElementB&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Element&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;accept&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;visitor&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;visitor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;visit_concrete_element_b&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Visitor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;visit_concrete_element_a&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;element&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;visit_concrete_element_b&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;element&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConcreteVisitor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Visitor&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;visit_concrete_element_a&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;element&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"ConcreteVisitor visited ConcreteElementA"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;visit_concrete_element_b&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;element&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"ConcreteVisitor visited ConcreteElementB"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;element_a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteElementA&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;element_b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteElementB&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;visitor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ConcreteVisitor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;element_a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;accept&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;visitor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "ConcreteVisitor visited ConcreteElementA"
&lt;/span&gt;&lt;span class="n"&gt;element_b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;accept&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;visitor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: "ConcreteVisitor visited ConcreteElementB"
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Concurrency Patterns:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These patterns deal with multi-threaded programming paradigms. Its Types Are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Active Object Pattern:&lt;/strong&gt; Encapsulates each method call as an object and introduces a scheduler for handling these method calls. This pattern is useful when you want to decouple method execution from method invocation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Balking Pattern:&lt;/strong&gt; Only executes an action on an object when the object is in a particular state. This pattern is useful when you want to avoid unnecessary actions when an object is not in a suitable state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Binding Properties Pattern:&lt;/strong&gt; Binds properties of disparate objects together, so that when one property changes, the other automatically updates. This pattern is useful when you want to keep two properties in sync.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compute Kernel Pattern:&lt;/strong&gt; Encapsulates a computation inside a kernel, which can be executed concurrently on a GPU. This pattern is useful when you want to perform computations on a GPU.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Double-checked locking Pattern:&lt;/strong&gt; Reduces the overhead of acquiring a lock by testing the locking criterion before acquiring the lock. This pattern is useful when you want to improve performance in a multithreaded application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event-based asynchronous Pattern:&lt;/strong&gt; Passes a callback method into a method call, which is invoked when the called method has completed. This pattern is useful when you want to perform asynchronous operations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guarded suspension Pattern:&lt;/strong&gt; Suspends the execution of a method until a certain condition is met. This pattern is useful when you want to prevent a method from executing when certain conditions are not met.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thread pool Pattern:&lt;/strong&gt; Creates a number of threads during startup, which are placed in a pool and used to execute tasks. This pattern is useful when you want to limit the number of threads running at the same time.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Please note that due to the complexity and the nature of these concurrency patterns, providing Python examples for them would be quite extensive and beyond the scope of this article. &lt;/p&gt;

&lt;h4&gt;
  
  
  2. Coding Principles
&lt;/h4&gt;

&lt;p&gt;Coding principles provide guidelines for writing clean, maintainable code. These are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SOLID Principles:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SOLID is an acronym for five principles that help in creating effective, scalable, and maintainable software architectures. The principles of it when combined together, make it easier to maintain and extend the software over the long term. They also help in reducing the risk of bugs when making changes in the codebase. They are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Single Responsibility Principle (SRP):&lt;/strong&gt; This principle states that a class should have only one reason to change. In other words, a class should only have one job or responsibility. If a class has more than one responsibility, it becomes coupled. A change to one responsibility results in modification of the other responsibility.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open-Closed Principle (OCP):&lt;/strong&gt; According to this principle, "software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification". This means that a class should be easily extendable without modifying the class itself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Liskov Substitution Principle (LSP):&lt;/strong&gt; This principle, named after Barbara Liskov, states that "objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program". In other words, each derived class should be substitutable for their base class without causing any issues.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interface Segregation Principle (ISP):&lt;/strong&gt; This principle states that "clients should not be forced to depend upon interfaces that they do not use". This means that a class should not have to implement methods it doesn't use. Instead of one fat interface, numerous small interfaces are preferred based on groups of methods, each one serving one submodule.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependency Inversion Principle (DIP):&lt;/strong&gt; This principle states that "high-level modules should not depend on low-level modules. Both should depend on abstractions". Additionally, "abstractions should not depend on details. Details should depend on abstractions". This principle allows for decoupling.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;KIS (Keep It Simple):&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This principle states that most systems work best if they are kept simple rather than made complicated. Simplicity should be a key goal in design, and unnecessary complexity should be avoided.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DRY (Don't Repeat Yourself):&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This principle is aimed at reducing repetition of software patterns, replacing it with abstractions or using data normalization to avoid redundancy.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;YAGNI (You Aren't Gonna Need It):&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This principle states that a programmer should not add functionality until deemed necessary. It's a principle to avoid additional complexity and over-engineering.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Clean and Quality Code Practices and Guidelines
&lt;/h4&gt;

&lt;h5&gt;
  
  
  1. General Rules
&lt;/h5&gt;

&lt;p&gt;Some rules and guidelines to follow generally in writing clean code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Consistency:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Consistency in coding style, naming conventions, and project structure can make the code easier to read and understand. It also makes the code easier to maintain.    &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Readability:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Code should be written in a way that is easy to read and understand. This includes proper indentation, use of whitespace, and clear variable and function names.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Modifiability:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Code should be written in a way that it can be easily modified. This includes writing modular code, using clear and concise comments, and following good coding practices.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Scalability:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Code should be written in a way that it can handle increased load. This includes writing efficient code, using appropriate data structures and algorithms, and considering the performance implications of your code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Extensibility&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  2. Effective Use of Variables
&lt;/h5&gt;

&lt;p&gt;Variables should be named clearly and consistently, and prefixes or postfixes should be used when appropriate. Here are some principles to follow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Post or Pre Fixes (For better search):&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using prefixes or postfixes can make it easier to search for variables in your code. For example, you might prefix all global variables with g_ to make them easy to find.    &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Naming Conventions (For better meaning and consistency):&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Consistent naming conventions can make your code easier to read and understand. For example, in Python, variable names should be lowercase with words separated by underscores (snake_case).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Magic Numbers to Constants:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Magic numbers are numbers that appear in the code without any explanation of what they represent. These should be replaced with named constants to improve readability.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Use Types:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using types can help catch errors at compile time and make the code easier to understand.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reduce Globals:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Global variables can make the code harder to understand and maintain. Where possible, use local variables instead.&lt;/p&gt;

&lt;h5&gt;
  
  
  3. Commenting
&lt;/h5&gt;

&lt;p&gt;Commenting in code is an essential part if it is used in place, else it would be redundant and worse than not writing it. Here is some principles in commenting for effective commenting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Function and Class Docstring:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each function should have a comment that explains what the &lt;strong&gt;function does&lt;/strong&gt;, &lt;strong&gt;what parameters it takes&lt;/strong&gt;, &lt;strong&gt;what it returns&lt;/strong&gt;, and &lt;strong&gt;what exceptions it might throw&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Also, each class should have a comment that explains &lt;strong&gt;what the class does&lt;/strong&gt; and &lt;strong&gt;how it should be used&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Explaining Statement Comments:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Comments should be used to explain complex or non-obvious parts of the code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Warning of consequences:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Comments should be used to warn of potential consequences of changing the code.&lt;/p&gt;

&lt;h5&gt;
  
  
  4. Functions
&lt;/h5&gt;

&lt;p&gt;Functions should be designed with a few key principles in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Single Responsibility:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each function should do one thing and do it well. This makes the function easier to understand, test, and reuse.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reusability:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Functions should be written in a way that they can be reused in different parts of the code. This often involves making the function more general, taking parameters instead of using hard-coded values.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No side effects:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Functions should not have side effects. That is, they should not change anything in the program state other than what is being returned by the function.&lt;/p&gt;

&lt;h5&gt;
  
  
  5. Classes (OOP)
&lt;/h5&gt;

&lt;p&gt;When designing classes, a few key principles should be kept in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Dependency Injection (Increased cohesion and reduced coupling):&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Dependency Injection is a technique where an object receives other objects that it depends on. This can help to reduce the coupling between classes and increase the cohesion of the class.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Law of Demeter:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Law of Demeter is a design guideline for developing software, particularly object-oriented programs. It promotes loose coupling between software components.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Principles&lt;/strong&gt;:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I14R8k9q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://d33wubrfki0l68.cloudfront.net/1efe60cb6e778c3aa6d3606307f89ef44cfa8786/4b3ca/img/blog/object-oriented/programming/4-principles/principles-of-oo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I14R8k9q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://d33wubrfki0l68.cloudfront.net/1efe60cb6e778c3aa6d3606307f89ef44cfa8786/4b3ca/img/blog/object-oriented/programming/4-principles/principles-of-oo.png" alt="Image of OOP Principles" width="800" height="685"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;source: khalilstemmler.com&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- **Encapsulation**
- **Abstraction**
- **Polymorphism**
- **Inheritance**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h5&gt;
  
  
  6. Code Formatting
&lt;/h5&gt;

&lt;p&gt;Code should be formatted consistently to improve readability. Python's PEP 8 provides a set of guidelines for code formatting. Tools like pylint or flake8 can be used to check your code for PEP 8 compliance. For more complex projects, you might consider using a tool like Black to automatically format your code. Also, &lt;strong&gt;whitespace and spaces&lt;/strong&gt; between &lt;strong&gt;functions&lt;/strong&gt;, &lt;strong&gt;classes&lt;/strong&gt;, or &lt;strong&gt;code blocks&lt;/strong&gt; are necessary since it seperates each block than the other visually.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. Debugging and Error Handling
&lt;/h3&gt;
&lt;h4&gt;
  
  
  &lt;strong&gt;Debugging&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;involves identifying and fixing errors while programming and writing code. It's the first step after a run command that does not work. &lt;/p&gt;

&lt;p&gt;Debugging can be made more efficient by following a systematic approach: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Understanding the problem&lt;/li&gt;
&lt;li&gt;Reproducing the error&lt;/li&gt;
&lt;li&gt;Diagnosing the problem&lt;/li&gt;
&lt;li&gt;Planning a solution&lt;/li&gt;
&lt;li&gt;Implementing the solution&lt;/li&gt;
&lt;li&gt;Testing the solution.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Tools like Python's built-in debugger (pdb) can be used to step through the code, inspect variables, and understand what's going wrong.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;strong&gt;Error handling&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;refers to the process of responding to errors during program execution. Python provides several tools for this, including the try/except block:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;ZeroDivisionError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"You can't divide by zero!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In addition to Python's built-in exceptions, you can define your own custom exceptions. &lt;/p&gt;

&lt;p&gt;Custom exceptions can make your code more reliable and easier to debug by providing more specific error messages. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CustomError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="n"&gt;CustomError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"This is a custom error"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;CustomError&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Writing Tests
&lt;/h3&gt;

&lt;p&gt;Writing tests is a crucial part of software development. It ensures that your code works as expected and helps prevent future bugs. Python's unittest module is a powerful tool for writing and running tests. Other popular testing libraries in Python include pytest and nose. &lt;/p&gt;

&lt;h4&gt;
  
  
  Unit Tests
&lt;/h4&gt;

&lt;p&gt;Here's an example of a unit test for a simple sum function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;test_sum&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Integration Tests
&lt;/h4&gt;

&lt;p&gt;Integration tests, on the other hand, check that different parts of your code work together correctly. For example, if you have a function that reads data from a database and another function that processes that data, an integration test might check that these functions work correctly together.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We will cover testing as a topic in detail in the next article.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Documentation
&lt;/h3&gt;

&lt;p&gt;Documentation is the written text that accompanies your code, explaining how it works and how to use it. &lt;/p&gt;

&lt;p&gt;Documentations may be websites, comments, or external documents. In this section, we will focus on web and external document documentation instead of "Docstrings as comments". &lt;/p&gt;

&lt;p&gt;Tools like Sphinx can be used to generate HTML documentation for Python code. &lt;/p&gt;

&lt;p&gt;You can also use platforms like Read the Docs to host your documentation online. &lt;/p&gt;

&lt;p&gt;Good documentation makes your code easier to understand and use, and it's especially important if your code is going to be used by other people. Also, it gives a good overview of the codebase, functions, classes, variables, and codeblocks.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Refactoring
&lt;/h3&gt;

&lt;p&gt;Refactoring is the process of restructuring existing code without changing its external behavior, with the goal of improving code readability and reducing complexity. &lt;/p&gt;

&lt;p&gt;Also, may improve non-functional attributes, such as performance, reliability, etc. &lt;/p&gt;

&lt;p&gt;Refactoring is usually the last step when you finally ensure that your code is working as intended.&lt;/p&gt;

&lt;p&gt;A good pattern to follow when refactoring is the Red-Green-Refactor cycle: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write a failing test (red)&lt;/li&gt;
&lt;li&gt;Write code to make the test pass (green)&lt;/li&gt;
&lt;li&gt;Refactor the code to improve its structure and readability.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's an example of a code block that could be refactored:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calculate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;operation&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;'add'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;operation&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;'subtract'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;operation&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;'multiply'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;operation&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;'divide'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Refactored code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;subtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;multiply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;divide&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;

&lt;span class="n"&gt;OPERATIONS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s"&gt;'add'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;'subtract'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;subtract&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;'multiply'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;multiply&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;'divide'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;divide&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calculate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;OPERATIONS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nb"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;'Invalid operation: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the refactored code, each operation is a separate function, which makes the code more modular and easier to read and test. The calculate function uses a dictionary to map operation names to functions, which makes it easier to add new operations in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Smells (Bad Code Practices)
&lt;/h2&gt;

&lt;p&gt;Code smells are bad code practices that atleast even if your code is not clean you try to avoid, this is a list of bad code practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rigidity - code is difficult to change&lt;/li&gt;
&lt;li&gt;Fragility - code breaks easily with changes&lt;/li&gt;
&lt;li&gt;Immobility - cannot reuse code&lt;/li&gt;
&lt;li&gt;Needless Complexity - overcomplicated code&lt;/li&gt;
&lt;li&gt;Needless Repetition - duplicated code&lt;/li&gt;
&lt;li&gt;Opacity - hard to understand&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Good Codebase Folder Structre
&lt;/h2&gt;

&lt;p&gt;Folder structre is very important in finding files and searching for functions and bugs, so here are some best practices on structuring the codebase of your project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Organize by feature rather than file type&lt;/li&gt;
&lt;li&gt;Locate files based on dependencies&lt;/li&gt;
&lt;li&gt;Group related files together&lt;/li&gt;
&lt;li&gt;Use descriptive folder and file names&lt;/li&gt;
&lt;li&gt;Limit nesting to avoid deep hierarchies&lt;/li&gt;
&lt;li&gt;Be consistent across project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You may see software projects that include folders such as src, public, build, utils, core, test, config, controllers, views, middlewares, models, services, assets, .env, .gitignore, ts.config, package.json, etc.. You can make your own folder structure since it is well-known and easy to navigate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Software Development Types
&lt;/h2&gt;

&lt;p&gt;In software engineering, there are several types of applications that is being developed. Most of it falls of one of these or more:&lt;/p&gt;

&lt;h3&gt;
  
  
  Desktop Applications
&lt;/h3&gt;

&lt;p&gt;Desktop applications were widely used. However, with the expansion of web and mobile applications its development is decreasing, but there are several applications in the real-world until now, such as companies' management systems, and apps that need to write/read files in the computer. Desktop applications are seperated into two types:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Native Development
&lt;/h4&gt;

&lt;p&gt;This type of development is OS-Based development, so you develop to Windows or MacOS only. Some examples are; Objective-C.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Cross-Platform Development
&lt;/h4&gt;

&lt;p&gt;This type is not OS-Based, so when you develop a codebase, it is deployable and built for different OS and platforms. Some examples are; Electron, and Java Swing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Web Applications
&lt;/h3&gt;

&lt;p&gt;Web applications is widely used due to the wide spread of internet, you can see websites everywhere. Web applications can contain several types:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Static Website
&lt;/h4&gt;

&lt;p&gt;This type is without using an external server other than the webserver that serves frontend files. So, there is no backend nor database. Using only HTML, CSS, and JS.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Backend (API) and Frontend Applications
&lt;/h4&gt;

&lt;p&gt;This type of development is so common nowadays, you develop a seperate backend server that is called "API Server" that returns usually JSON data, and develop the frontend externally, then you can call you API server endpoints from the frontend application to use its services. Some examples are; Django Rest Framework (API), FastAPI (API), and React (Frontend).&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Full-Stack Web Applications
&lt;/h4&gt;

&lt;p&gt;This type of development combines the both of two types, It is a development of a webserver, where you develop the backend and frontend in the same codebase, so the backend server usually serves Frontend server when its endpoints is hit (instead of JSON in the API type). Some examples are; Django, NextJS, and Laravel.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mobile Applications
&lt;/h3&gt;

&lt;p&gt;Mobile applications are also widely used. It has two types similar to Desktop applications:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Native Development
&lt;/h4&gt;

&lt;p&gt;This type focuses on a single OS such as Android or IOS, it has several benifits such as performance, OS-Based styles, and more. Some examples are; Kotlin, and Swift.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Cross-Platform Development
&lt;/h4&gt;

&lt;p&gt;This type doesnt focus on a single OS, it develops for both platforms (Android and IOS). Some examples are; Flutter, and React Native.&lt;/p&gt;

&lt;h3&gt;
  
  
  CLI Applications
&lt;/h3&gt;

&lt;p&gt;This type doesnt care about graphical interfaces, it is usually developed for developers. Also, bash scripts may fall to this type, where you develop bash scripts that run automatically desktop functions. You can develop CLI applications with any programming language that interacts with the console/terminal. Some examples are; Powershell, bash script, and Python.&lt;/p&gt;

&lt;h3&gt;
  
  
  Embedded Systems Softwares
&lt;/h3&gt;

&lt;p&gt;This type is neglected by alot of software engineers, where you develop systems specific for some hardwares, such as car, flight, and IoT systems. These systems are common to use low-level languages such as Assembly, or C. Some systems are now developing a higher level such as Raspberrypi (Python) and Arduino (C++) where you can develop embedded systems with these two microcontrollers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some Useful Tools for Software Implementation
&lt;/h2&gt;

&lt;p&gt;There are many tools available to help with software development. &lt;/p&gt;

&lt;p&gt;Some are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;source code management tools&lt;/li&gt;
&lt;li&gt;integrated development environments (IDEs)&lt;/li&gt;
&lt;li&gt;autocompletion and Intellisense tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;References: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clean Code: A Handbook of Agile Software Craftsmanship&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/news/how-to-write-clean-code/#documentation"&gt;How to Write Clean Code – Tips and Best Practices (Full Handbook)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Real-World Skills and Diving Deeper
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://roadmap.sh/full-stack"&gt;Fullstack Engineer Roadmap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://roadmap.sh/frontend"&gt;Frontend Developer Roadmap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://roadmap.sh/backend"&gt;Backend Developer Roadmap&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Jobs:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Programmer&lt;/li&gt;
&lt;li&gt;Software Developer &lt;/li&gt;
&lt;li&gt;Software Engineer&lt;/li&gt;
&lt;li&gt;Database Engineer&lt;/li&gt;
&lt;li&gt;AI and ML Engineer&lt;/li&gt;
&lt;li&gt;Data Scientist or Analyst&lt;/li&gt;
&lt;/ol&gt;




&lt;h1&gt;
  
  
  What's Next?
&lt;/h1&gt;

&lt;p&gt;Next activity is the Verification and Validation, where we start making tests and verifying and validating that the software meets the requirements and make better quality code.&lt;/p&gt;




&lt;p&gt;TODO:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add more tools&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>softwareengineering</category>
      <category>designpatterns</category>
      <category>softwaredevelopment</category>
      <category>programming</category>
    </item>
    <item>
      <title>Internet And Network</title>
      <dc:creator>Anmar Hani</dc:creator>
      <pubDate>Thu, 07 Sep 2023 16:33:33 +0000</pubDate>
      <link>https://forem.com/anmarhaniv1/internet-and-network-4623</link>
      <guid>https://forem.com/anmarhaniv1/internet-and-network-4623</guid>
      <description>&lt;h1&gt;
  
  
  Internet
&lt;/h1&gt;

&lt;h2&gt;
  
  
  WWW (World Wide Web)
&lt;/h2&gt;

&lt;p&gt;The World Wide Web (also known as the &lt;strong&gt;web&lt;/strong&gt; or &lt;strong&gt;WWW&lt;/strong&gt;) refers to &lt;strong&gt;all the public websites or pages that users can access&lt;/strong&gt; on their local computers and other devices through the internet. These pages and documents are &lt;strong&gt;interconnected by means of hyperlinks that users click&lt;/strong&gt; on for information. This information can be in different formats, including text, images, audio and video.&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;The World Wide Web (WWW), often simply referred to as the web, has undergone a remarkable evolution since its inception. This evolution can be categorized into &lt;strong&gt;three key phases&lt;/strong&gt;: &lt;strong&gt;Web1, Web2, and Web3&lt;/strong&gt;. we'll explore the history of the web and delve into each phase with examples.&lt;/p&gt;

&lt;h3&gt;
  
  
  History
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Web 1
&lt;/h4&gt;

&lt;p&gt;also known as the &lt;strong&gt;Static Web&lt;/strong&gt;, represents the early days of the internet. During this phase, &lt;strong&gt;web pages were primarily static&lt;/strong&gt; and &lt;strong&gt;consisted of simple HTML&lt;/strong&gt; (Hypertext Markup Language) code. &lt;strong&gt;Interactivity was limited&lt;/strong&gt;, and the focus was on presenting information in a straightforward manner.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example
&lt;/h4&gt;

&lt;p&gt;The first web page ever created by &lt;strong&gt;Tim Berners-Lee in 1991&lt;/strong&gt; serves as a quintessential example of Web1. &lt;strong&gt;It was a basic HTML document with no multimedia elements&lt;/strong&gt;, and it aimed to provide &lt;strong&gt;information about the World Wide Web project itself&lt;/strong&gt;. Here's a simplified version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;The World Wide Web&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Welcome to the World Wide Web&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is the first web page ever created.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://www.example.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Visit Example.com&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Web 2
&lt;/h4&gt;

&lt;p&gt;Web2 brought a significant transformation to the web. It introduced &lt;strong&gt;interactive and dynamic web applications&lt;/strong&gt;, &lt;strong&gt;user-generated content&lt;/strong&gt;, and a strong focus on &lt;strong&gt;user engagement&lt;/strong&gt; and &lt;strong&gt;collaboration&lt;/strong&gt;. This phase marked the rise of social media, online communities, and e-commerce.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Facebook&lt;/strong&gt;, founded by Mark Zuckerberg in 2004, is a &lt;strong&gt;prime example of Web2&lt;/strong&gt;. It is a &lt;strong&gt;social networking platform&lt;/strong&gt; that revolutionized online communication. Facebook allows users to &lt;strong&gt;create profiles&lt;/strong&gt;, &lt;strong&gt;connect with friends&lt;/strong&gt;, &lt;strong&gt;share content&lt;/strong&gt;, and engage in &lt;strong&gt;real-time interactions&lt;/strong&gt;. Features like the news feed, status updates, and photo sharing exemplify the interactivity and user-generated content of Web2.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Key Features of Web2&lt;/strong&gt;:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User-generated content&lt;/strong&gt;: Users contribute to the platform by sharing text, images, videos, and more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Interactivity&lt;/strong&gt;: Real-time communication and feedback mechanisms enhance user engagement.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Online communities&lt;/strong&gt;: Social media platforms and forums foster communities and discussions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Collaboration&lt;/strong&gt;: Users can collaborate on projects, documents, and content creation.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Web 3
&lt;/h4&gt;

&lt;p&gt;Web3 represents the future of the internet, emphasizing &lt;strong&gt;decentralization&lt;/strong&gt;, &lt;strong&gt;blockchain&lt;/strong&gt; technology, and &lt;strong&gt;user empowerment&lt;/strong&gt;. While it is still evolving, Web3 aims to provide &lt;strong&gt;users with greater control&lt;/strong&gt; over their data and online identities, prioritizing trust and security.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Ethereum&lt;/strong&gt;, launched by Vitalik Buterin in 2015, &lt;strong&gt;serves as a prominent example of Web3 principles&lt;/strong&gt;. It is a decentralized &lt;strong&gt;blockchain platform&lt;/strong&gt; that enables the development of decentralized applications (DApps) and smart contracts. Ethereum's core features include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Decentralization&lt;/strong&gt;: No single entity controls Ethereum; it relies on a distributed network of nodes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Smart contracts&lt;/strong&gt;: Self-executing contracts with predefined rules and conditions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Digital identity&lt;/strong&gt;: Users have ownership of their online identities and data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cryptocurrency&lt;/strong&gt;: Ethereum introduced its cryptocurrency, Ether (ETH), which powers transactions and operations within the network.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As Web3 continues to evolve, it holds the promise of reshaping online interactions, governance, and commerce, while giving individuals more control over their digital lives.&lt;/p&gt;

&lt;h1&gt;
  
  
  Networking
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Network Layers (OSI Model)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;The OSI model is a &lt;strong&gt;conceptual framework that defines how different networking protocols and technologies interact to enable seamless communication between devices across a network&lt;/strong&gt;. It was developed by the International Organization for Standardization (ISO) in the late 1970s, and &lt;strong&gt;it consists of seven distinct layers&lt;/strong&gt;, each responsible for specific functions in the data transmission process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QKokwa_7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.discordapp.com/attachments/887387395538948166/1148996912855404574/image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QKokwa_7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.discordapp.com/attachments/887387395538948166/1148996912855404574/image.png" alt="image" width="329" height="662"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Physical Layer&lt;/strong&gt;:
&lt;/h3&gt;

&lt;p&gt;At the bottom of the OSI model, the Physical Layer &lt;strong&gt;deals with the physical medium&lt;/strong&gt; through which data is transmitted. It encompasses hardware aspects like cables, connectors, and electrical signals.&lt;/p&gt;

&lt;p&gt;Some common protocols are (That are mentioned in previous article Wired Communication):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ethernet&lt;/li&gt;
&lt;li&gt;USB&lt;/li&gt;
&lt;li&gt;Fiber Channel&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This Layer associated with Wired/Wireless Communication.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Data Link Layer&lt;/strong&gt;:
&lt;/h3&gt;

&lt;p&gt;The Data Link Layer focuses on &lt;strong&gt;establishing a reliable link between two directly connected nodes&lt;/strong&gt;. It manages &lt;strong&gt;data framing&lt;/strong&gt;, &lt;strong&gt;error detection&lt;/strong&gt;, and &lt;strong&gt;flow control&lt;/strong&gt;. Protocols like Ethernet and Wi-Fi operate within this layer.&lt;/p&gt;

&lt;p&gt;Some common protocols are:&lt;/p&gt;

&lt;h4&gt;
  
  
  - MAC Address (Media Access Control Address)
&lt;/h4&gt;

&lt;p&gt;MAC (Media Access Control) addresses are vital at the Data Link Layer. They &lt;strong&gt;are hardware-based addresses assigned to network interface cards (NICs)&lt;/strong&gt; and play a crucial role in local network communication. &lt;strong&gt;MAC addresses ensure data frames are sent to the correct destination within the local network&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This Layer associated with Wired/Wireless Communication.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Network Layer&lt;/strong&gt;:
&lt;/h3&gt;

&lt;p&gt;The Network Layer is &lt;strong&gt;responsible for routing data packets from the source to the destination across multiple networks&lt;/strong&gt;. IP (Internet Protocol) is a key protocol in this layer, and it &lt;strong&gt;enables devices to locate and communicate with each other&lt;/strong&gt; on a global scale.&lt;/p&gt;

&lt;p&gt;Some common protocols are:&lt;/p&gt;

&lt;h4&gt;
  
  
  - &lt;strong&gt;IP (Internet Protocol)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;IP, or Internet Protocol, is a cornerstone of the OSI model's Network Layer. Its primary function is to route data packets across networks. IP addresses are used to &lt;strong&gt;uniquely identify devices on a network&lt;/strong&gt;, allowing global connectivity across the internet.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Transport Layer&lt;/strong&gt;:
&lt;/h3&gt;

&lt;p&gt;The Transport Layer ensures &lt;strong&gt;end-to-end communication reliability&lt;/strong&gt;. It &lt;strong&gt;divides data into smaller segments and provides error checking&lt;/strong&gt; and correction. &lt;strong&gt;TCP&lt;/strong&gt; (Transmission Control Protocol) and &lt;strong&gt;UDP&lt;/strong&gt; (User Datagram Protocol) are common transport layer protocols.&lt;/p&gt;

&lt;p&gt;Some common protocols are:&lt;/p&gt;

&lt;h4&gt;
  
  
  - &lt;strong&gt;TCP (Transmission Control Protocol)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;TCP operates within the Transport Layer of the OSI model. &lt;strong&gt;It provides reliable&lt;/strong&gt;, &lt;strong&gt;connection-oriented communication&lt;/strong&gt;. &lt;strong&gt;TCP ensures data integrity&lt;/strong&gt;, &lt;strong&gt;sequencing&lt;/strong&gt;, and &lt;strong&gt;error correction&lt;/strong&gt;, making it suitable for applications where &lt;strong&gt;data accuracy is critical&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  - &lt;strong&gt;UDP (User Datagram Protocol)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;UDP, also at the Transport Layer, offers a &lt;strong&gt;lightweight, connectionless communication&lt;/strong&gt; approach. It is ideal &lt;strong&gt;for applications that prioritize speed over data integrity&lt;/strong&gt;, such as &lt;strong&gt;real-time video&lt;/strong&gt; and &lt;strong&gt;voice streaming&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Session Layer&lt;/strong&gt;:
&lt;/h3&gt;

&lt;p&gt;The Session Layer &lt;strong&gt;establishes, maintains, and terminates communication sessions between two devices&lt;/strong&gt;. It also manages synchronization and checkpointing. &lt;strong&gt;NetBIOS&lt;/strong&gt; and &lt;strong&gt;RPC&lt;/strong&gt; (Remote Procedure Call) are examples of session layer protocols.&lt;/p&gt;

&lt;p&gt;Some common protocols are:&lt;/p&gt;

&lt;h4&gt;
  
  
  - &lt;strong&gt;NetBIOS (Network Basic Input/Output System)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;NetBIOS resides within the Session Layer of the OSI model. It &lt;strong&gt;provides session establishment, maintenance, and termination services&lt;/strong&gt;, making it essential for legacy Windows networking and file sharing.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Presentation Layer&lt;/strong&gt;:
&lt;/h3&gt;

&lt;p&gt;This layer deals with &lt;strong&gt;data translation&lt;/strong&gt;, &lt;strong&gt;encryption&lt;/strong&gt;, and &lt;strong&gt;compression&lt;/strong&gt;. It ensures that &lt;strong&gt;data sent by one device can be understood by another&lt;/strong&gt;. Common encryption protocols like &lt;strong&gt;SSL/TLS&lt;/strong&gt; operate here.&lt;/p&gt;

&lt;p&gt;Some common protocols are:&lt;/p&gt;

&lt;h4&gt;
  
  
  - &lt;strong&gt;SSL/TLS (Secure Sockets Layer/Transport Layer Security)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;SSL/TLS protocols operate across two layers of the OSI model. At the &lt;strong&gt;Presentation&lt;/strong&gt; Layer, they handle &lt;strong&gt;data encryption&lt;/strong&gt;, &lt;strong&gt;decryption&lt;/strong&gt;, and presentation to &lt;strong&gt;ensure secure data exchange&lt;/strong&gt;. At the &lt;strong&gt;Transport&lt;/strong&gt; Layer, they provide &lt;strong&gt;data integrity&lt;/strong&gt;, &lt;strong&gt;authentication&lt;/strong&gt;, and &lt;strong&gt;encryption during communication&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Application Layer&lt;/strong&gt;:
&lt;/h3&gt;

&lt;p&gt;The Application Layer is the topmost layer and is responsible for &lt;strong&gt;end-user services and applications&lt;/strong&gt;. It provides an &lt;strong&gt;interface for software&lt;/strong&gt; to interact with the network. Protocols such as &lt;strong&gt;HTTP&lt;/strong&gt;, &lt;strong&gt;FTP&lt;/strong&gt;, and &lt;strong&gt;SMTP&lt;/strong&gt; are part of this layer.&lt;/p&gt;

&lt;h4&gt;
  
  
  - &lt;strong&gt;HTTP (Hypertext Transfer Protocol)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;HTTP operates at the OSI model's Application Layer. It is the &lt;strong&gt;foundation of data communication on the World Wide Web&lt;/strong&gt; and governs how web browsers and web servers interact, allowing &lt;strong&gt;users to access and retrieve web pages and resources&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  - &lt;strong&gt;HTTPS (Hypertext Transfer Protocol Secure)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;HTTPS, an &lt;strong&gt;extension of HTTP&lt;/strong&gt;, also operates within the Application Layer. It &lt;strong&gt;adds a layer of security by encrypting data exchanged between web browsers and servers&lt;/strong&gt;. This encryption helps protect sensitive information, making it suitable for secure online transactions.&lt;/p&gt;

&lt;h4&gt;
  
  
  - &lt;strong&gt;SMTP (Simple Mail Transfer Protocol)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;SMTP operates within the OSI model's Application Layer and is &lt;strong&gt;responsible for sending and receiving email messages&lt;/strong&gt;. It ensures that emails are routed correctly and delivered to the intended recipients.&lt;/p&gt;

&lt;h3&gt;
  
  
  The OSI Model in Action
&lt;/h3&gt;

&lt;p&gt;To understand how the OSI model works in practice, let's consider a scenario where you visit a website:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;When you enter a website's URL in your browser, the Application Layer initiates the request.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The browser uses HTTP (Hypertext Transfer Protocol) at the Application Layer to request the web page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The request is passed down through each lower layer. The Transport Layer may use TCP to ensure data integrity, and the Network Layer uses IP to route the request across the internet.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Data Link Layer, which handles data framing, sends the request to the appropriate router, and the Physical Layer manages the actual transmission of data over cables or wireless signals.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once the request reaches the destination server, the process reverses through the layers, and the server sends back the requested web page.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Credits
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Fawaz Khosifan &lt;a class="mentioned-user" href="https://dev.to/fawazkh80"&gt;@fawazkh80&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>networking</category>
      <category>network</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Wired and Wireless Communication</title>
      <dc:creator>Anmar Hani</dc:creator>
      <pubDate>Thu, 07 Sep 2023 16:31:50 +0000</pubDate>
      <link>https://forem.com/anmarhaniv1/wired-and-wireless-communication-5h8d</link>
      <guid>https://forem.com/anmarhaniv1/wired-and-wireless-communication-5h8d</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;
Wired Communication

&lt;ul&gt;
&lt;li&gt;Twisted Pair Cable&lt;/li&gt;
&lt;li&gt;Co-axial Cable&lt;/li&gt;
&lt;li&gt;Fiber Optic Cable&lt;/li&gt;
&lt;li&gt;Ethernet&lt;/li&gt;
&lt;li&gt;Wires&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
Wireless Communication

&lt;ul&gt;
&lt;li&gt;Radio Frequency Communication&lt;/li&gt;
&lt;li&gt;Wifi&lt;/li&gt;
&lt;li&gt;Bluetooth&lt;/li&gt;
&lt;li&gt;Mobile Networks&lt;/li&gt;
&lt;li&gt;Microwave Communication&lt;/li&gt;
&lt;li&gt;Infrared Communication&lt;/li&gt;
&lt;li&gt;Lightwave Communication&lt;/li&gt;
&lt;li&gt;Satellite Communication&lt;/li&gt;
&lt;li&gt;Near Field Communication (NFC)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Communication technologies have evolved significantly over the years, enabling us to connect and share information across vast distances. This guide provides an overview of both wired and wireless communication technologies, their types, and how they work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wired Communication
&lt;/h2&gt;

&lt;p&gt;Wired communication refers to the transmission of data over a wire-based communication technology. Examples include telephones, cable television, and internet broadband. &lt;strong&gt;"Wired communications is any type of movement of data between or among devices using a wired connection."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We will discuss some methods and ways for wired communication:&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Twisted Pair Cable
&lt;/h3&gt;

&lt;p&gt;Twisted pair cables are a type of wiring in which &lt;strong&gt;two conductors are twisted together for the purposes of canceling out electromagnetic interference (EMI) from external sources&lt;/strong&gt;. They are widely used in different kinds of data and voice communication applications, including &lt;strong&gt;telephone&lt;/strong&gt; and &lt;strong&gt;network cabling&lt;/strong&gt; such as &lt;strong&gt;Ethernet&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Co-axial Cable
&lt;/h3&gt;

&lt;p&gt;Co-axial cable is a type of cable that has an &lt;strong&gt;inner conductor surrounded by a tubular insulating layer, surrounded by a tubular conducting shield&lt;/strong&gt;. It is used as a transmission line for &lt;strong&gt;radio frequency signals&lt;/strong&gt;, in applications such as connecting &lt;strong&gt;radio transmitters&lt;/strong&gt; and &lt;strong&gt;receivers&lt;/strong&gt; with their antennas, &lt;strong&gt;computer network connections&lt;/strong&gt;, and distributing &lt;strong&gt;cable television signals&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fiber Optic Cable
&lt;/h3&gt;

&lt;p&gt;Fiber optic cables are cables that contain several strands of glass fibers, where the diameter of each strand is slightly thicker than a human hair. The glass fiber core is surrounded by a layer called cladding which is again covered by an outer protective layer. Fiber optic cables are used for high-speed data transmission.&lt;/p&gt;

&lt;h3&gt;
  
  
  Jumper wires
&lt;/h3&gt;

&lt;p&gt;These are electrical wires or group of wires in a cable with a connector or pin at each end, which is normally used to interconnect the components of a breadboard or other prototype or test circuit, internally or with other equipment or components, without soldering.&lt;/p&gt;

&lt;h3&gt;
  
  
  TX/RX
&lt;/h3&gt;

&lt;p&gt;These are used in serial communication, which is the process of sending data one bit at a time, sequentially, over a communication channel or computer bus. TX stands for transmit and RX stands for receive. Also, &lt;strong&gt;USB&lt;/strong&gt; is considered to use TX/RX communication protocol.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wireless Communication
&lt;/h2&gt;

&lt;p&gt;Wireless communication is the transfer of information between two or more points that are not connected by an electrical conductor. It encompasses various types of fixed, mobile, and portable applications, including two-way radios, cellular telephones, personal digital assistants (PDAs), and wireless networking.&lt;/p&gt;

&lt;h3&gt;
  
  
  Radio Frequency Communication
&lt;/h3&gt;

&lt;p&gt;Radio frequency (RF) is a rate of oscillation in the range of about 3 kHz to 300 GHz, which corresponds to the frequency of radio waves, and the alternating currents which carry radio signals.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Wifi
&lt;/h4&gt;

&lt;p&gt;Wi-Fi is a wireless networking technology that uses radio waves to provide wireless high-speed Internet and network connections. Wi-Fi networks are based on the IEEE 802.11 standards. A Wi-Fi network can be used to connect computers to each other, to the internet, and to wired networks. Wi-Fi networks operate in the 2.4 GHz and 5 GHz bands, with either single-band or dual-band routers. Wi-Fi allows for high-speed data transfers, enables a device to connect to the internet, and provides connectivity to other devices in the network. Wi-Fi has various security protocols including WEP, WPA, and WPA2 that encrypt the data sent over the network to protect the user's privacy.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Bluetooth
&lt;/h4&gt;

&lt;p&gt;Bluetooth is a wireless technology standard used for exchanging data between fixed and mobile devices over short distances.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Mobile Networks
&lt;/h4&gt;

&lt;p&gt;Mobile networks are communication networks where the last link is wireless. The network is distributed over land areas called cells, each served by at least one fixed-location transceiver, known as a cell site or base station.&lt;/p&gt;

&lt;h3&gt;
  
  
  Microwave Communication
&lt;/h3&gt;

&lt;p&gt;Microwave communication is the transmission of information or energy by microwave radio waves. It is used in point-to-point communication links, wireless networks, and satellite communications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Infrared Communication
&lt;/h3&gt;

&lt;p&gt;Infrared communication is a method of wireless communication used to transmit data over short distances (up to a few meters) using infrared light signals.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lightwave Communication
&lt;/h3&gt;

&lt;p&gt;Lightwave communication uses light waves to transmit data. It is commonly used in fiber-optic communications, where it allows for the transmission of large amounts of data over long distances.&lt;/p&gt;

&lt;h3&gt;
  
  
  Satellite Communication
&lt;/h3&gt;

&lt;p&gt;Satellite communication is a type of wireless communication that uses satellites to provide communication links between various points on Earth.&lt;/p&gt;

&lt;h3&gt;
  
  
  Near Field Communication (NFC)
&lt;/h3&gt;

&lt;p&gt;Near Field Communication (NFC) is a set of communication protocols that enable two electronic devices, one of which is usually a portable device such as a smartphone, to establish communication by bringing them within 4 cm (1.6 in) of each other.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This guide provides a basic understanding of the various types of communication technologies. In the next section, we will delve deeper into network and internet technologies, exploring how they leverage these communication types to provide connectivity and services.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Geeksforgeeks&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Credits
&lt;/h2&gt;

</description>
      <category>webdev</category>
      <category>learning</category>
      <category>network</category>
      <category>networking</category>
    </item>
    <item>
      <title>Software Technology Stacks</title>
      <dc:creator>Anmar Hani</dc:creator>
      <pubDate>Wed, 05 Jul 2023 09:33:13 +0000</pubDate>
      <link>https://forem.com/anmarhaniv1/technology-stacks-56jc</link>
      <guid>https://forem.com/anmarhaniv1/technology-stacks-56jc</guid>
      <description>&lt;h1&gt;
  
  
  Overview
&lt;/h1&gt;

&lt;p&gt;In this article I will try to cover most things so you do not have to. &lt;/p&gt;

&lt;p&gt;A technology stack is the combination of programming languages, frameworks, and tools that developers use to build a web application. A typical technology stack consists of several layers, each with its own responsibilities and functions. &lt;/p&gt;

&lt;p&gt;It is a &lt;strong&gt;layered pattern as module view&lt;/strong&gt; and a &lt;strong&gt;multi-tier pattern as allocation view&lt;/strong&gt;, I explained that in a past article you can see &lt;strong&gt;&lt;a href="https://dev.to/anmarhaniv1/software-development-in-the-process-design-22pi"&gt;Software Architecture Design&lt;/a&gt;&lt;/strong&gt; These layers are often referred to as tiers, and they include the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend Tier&lt;/strong&gt;: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This layer is responsible for the user interface of the web application. It includes HTML, CSS, and JavaScript, as well as frontend frameworks such as React, Angular, and Vue.js. The frontend tier is what users see and interact with when they use the web application.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend Tier&lt;/strong&gt;: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This layer is responsible for the server-side logic of the web application. It includes server-side languages such as PHP, Python, and Ruby, as well as serverless technologies such as AWS Lambda and Google Cloud Functions. The backend tier handles data processing, authentication, and business logic.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Database Tier&lt;/strong&gt;: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This layer is responsible for storing and managing the data used by the web application. It includes SQL databases such as MySQL and PostgreSQL, NoSQL databases such as MongoDB and Cassandra, and cloud-based databases such as Amazon RDS and Google Cloud SQL.&lt;/p&gt;

&lt;p&gt;All these tiers combined together in multiple servers -&lt;a href="https://dev.to/anmarhaniv1/internet-basics-15o3"&gt;Network Series&lt;/a&gt;- to work and we will start by explaining every tier, then we will combine them all in one picture.&lt;/p&gt;




&lt;h2&gt;
  
  
  Frontend
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--keGoY6uW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0atlb0pv0son2o6g5nmb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--keGoY6uW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0atlb0pv0son2o6g5nmb.png" alt="Frontend Technologies" width="800" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;HTML&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML&lt;/strong&gt;: HTML is the markup language used to structure content on the web. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Templating Languages&lt;/strong&gt;: Templating languages allow developers to generate dynamic HTML content based on data that changes depending on user input or other factors. This can be useful for creating more complex web applications that require dynamic content.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;CSS&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CSS&lt;/strong&gt;: CSS is the styling language used to control the layout, typography, and visual design of web pages. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSS Frameworks&lt;/strong&gt;: CSS frameworks provide pre-written CSS code that can be used to style HTML elements and create consistent and attractive designs across a web application. Some popular CSS frameworks include Bootstrap, Tailwind, and Foundation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SASS&lt;/strong&gt;: Sass is a CSS preprocessor that extends the capabilities of CSS by adding variables, mixins, and other features. This can make CSS code more modular and reusable, and can help developers write stylesheets more quickly and efficiently.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;JavaScript (JS)&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JavaScript&lt;/strong&gt;: JavaScript is the programming language used to add interactivity and dynamic behavior to web pages. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JS Frameworks&lt;/strong&gt;: JS frameworks provide pre-written code and libraries that help developers build web applications more efficiently. Some popular JS frameworks include React, Angular, and Vue.js.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript&lt;/strong&gt;: TypeScript is a superset of JavaScript that adds optional static typing and other features. This can help make JS code more maintainable and easier to debug, particularly in larger codebases.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Package Managers&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Package Managers&lt;/strong&gt;: Package managers such as &lt;strong&gt;NPM&lt;/strong&gt; and &lt;strong&gt;Yarn&lt;/strong&gt; help developers manage dependencies and packages for their web applications. This can make it easier to install and update third-party libraries and frameworks, and can help ensure that all dependencies are up to date and compatible.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Build Tools&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Build Tools&lt;/strong&gt;: Build tools such as &lt;strong&gt;Webpack&lt;/strong&gt; and &lt;strong&gt;Vite&lt;/strong&gt; help automate repetitive tasks in the frontend development workflow, such as compiling CSS and JavaScript, optimizing images, and live-reloading web pages as changes are made. This can save developers time and effort, and can help ensure that code is consistently optimized and error-free.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Testing Tools&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Testing Tools&lt;/strong&gt;: Testing tools such as &lt;strong&gt;Jest&lt;/strong&gt; and &lt;strong&gt;Selenium&lt;/strong&gt; help developers write and run automated tests to ensure that their web applications are functioning correctly. This can help catch bugs and errors early in the development process, and can help ensure that code is robust and reliable.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Other Tools&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;State Management&lt;/strong&gt;: State management tools such as Redux and MobX help developers manage the state of their web applications more effectively. This can be useful for creating more complex web applications that require multiple components to share data and communicate with each other.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server-Side Rendering (SSR)&lt;/strong&gt;: Server-side rendering tools such as Next.js and Nuxt.js allow developers to render web pages on the server side rather than the client side. This can improve performance and accessibility, particularly for web applications that require fast page load times or need to be accessible to users with slower internet connections.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  API
&lt;/h2&gt;

&lt;p&gt;Ways to communicate between frontend and backend.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yFvgJDDd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cr0gh29690gx7tkap0ej.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yFvgJDDd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cr0gh29690gx7tkap0ej.png" alt="API Types" width="800" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Synchronous
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;HTTP REST&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Definition: APIs that adhere to a set of constraints for identifying and manipulating resources can be with &lt;strong&gt;JSON&lt;/strong&gt; format.&lt;/li&gt;
&lt;li&gt;Frontend libraries: Axios, Fetch API.&lt;/li&gt;
&lt;li&gt;Backend libraries: Flask-RESTful, Django REST framework, Express.js, Ruby on Rails.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;HTTP SOAP&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Definition: APIs that use the SOAP protocol to send and receive data in &lt;strong&gt;XML&lt;/strong&gt; format.&lt;/li&gt;
&lt;li&gt;Frontend libraries: XMLHTTPRequest object, SOAP client library for JavaScript.&lt;/li&gt;
&lt;li&gt;Backend libraries: Zeep, Suds, Apache CXF, Spring.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;GraphQL&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Definition: APIs that use a query language to define the data that should be returned in each response.&lt;/li&gt;
&lt;li&gt;Frontend libraries: Apollo Client, Relay.&lt;/li&gt;
&lt;li&gt;Backend libraries: Apollo Server, GraphQL Yoga.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;RPC&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Definition: APIs that allow clients to invoke procedures or functions on a remote server or service.&lt;/li&gt;
&lt;li&gt;Frontend libraries: gRPC-Web, JSON-RPC.&lt;/li&gt;
&lt;li&gt;Backend libraries: gRPC, Apache Thrift.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Asynchronous
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;WebSocket&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Definition: APIs that use the WebSocket protocol to enable real-time, bidirectional communication between clients and servers.&lt;/li&gt;
&lt;li&gt;Frontend libraries: WebSocket API, Socket.IO.&lt;/li&gt;
&lt;li&gt;Backend libraries: Flask-SocketIO, Django Channels, Socket.IO Server.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Server Sent Events&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Definition: APIs that enable servers to send real-time updates to clients over a single HTTP connection. The updates are sent as a stream of text-based events, which can be displayed in the browser using JavaScript.&lt;/li&gt;
&lt;li&gt;Frontend libraries: EventSource API.&lt;/li&gt;
&lt;li&gt;Backend libraries: Flask-SSE, Django-SSE.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Webhooks&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Definition: APIs that allow servers to send real-time notifications to clients by making HTTP requests to a preconfigured endpoint. The notifications can be triggered by events such as data updates or user actions.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Backend
&lt;/h2&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>frontend</category>
      <category>backend</category>
    </item>
    <item>
      <title>DevOps Types and Tools</title>
      <dc:creator>Anmar Hani</dc:creator>
      <pubDate>Tue, 04 Jul 2023 14:05:23 +0000</pubDate>
      <link>https://forem.com/anmarhaniv1/devops-types-and-tools-5h2l</link>
      <guid>https://forem.com/anmarhaniv1/devops-types-and-tools-5h2l</guid>
      <description>&lt;h1&gt;
  
  
  A Comprehensive Guide to DevOps Tools
&lt;/h1&gt;

&lt;p&gt;DevOps is a software development methodology that emphasizes collaboration, communication, and automation between software development, quality assurance, and IT operations teams. DevOps tools play a key role in supporting these principles by automating processes, facilitating communication, and enabling collaboration across teams. In this article, we'll explore a comprehensive list of DevOps tools and provide examples of tools used in each category.&lt;/p&gt;

&lt;h2&gt;
  
  
  Version Control and Source Code Management Tools
&lt;/h2&gt;

&lt;p&gt;Version control and source code management tools are used to track changes to source code and enable collaboration among developers. These tools help to ensure that developers can work together effectively and that changes are tracked and managed in a systematic and organized way. Examples of version control and source code management tools include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Git: a distributed version control system that is widely used in software development.&lt;/li&gt;
&lt;li&gt;SVN: a centralized version control system that is widely used in software development.&lt;/li&gt;
&lt;li&gt;Mercurial: a distributed version control system that is similar to Git.&lt;/li&gt;
&lt;li&gt;Perforce: a centralized version control system that is widely used in game development.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Build Automation Tools
&lt;/h2&gt;

&lt;p&gt;Build automation tools are used to automate the process of building software from source code. These tools help to ensure that software is built consistently and reliably across different environments. Examples of build automation tools include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maven: a build automation tool that is widely used in Java development.&lt;/li&gt;
&lt;li&gt;Gradle: a build automation tool that is used to build software for a variety of platforms, including Android and Java.&lt;/li&gt;
&lt;li&gt;Ant: a build automation tool that is widely used in Java development.&lt;/li&gt;
&lt;li&gt;MSBuild: a build automation tool that is used to build software for the .NET platform.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Continuous Integration/Continuous Delivery (CI/CD) Tools
&lt;/h2&gt;

&lt;p&gt;CI/CD tools are used to automate the process of building, testing, and deploying code changes. These tools help to ensure that code changes are integrated and tested quickly and efficiently, and that the resulting software is delivered to end-users in a timely manner. Examples of CI/CD tools include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Jenkins: an open-source automation server that supports the entire software development lifecycle.&lt;/li&gt;
&lt;li&gt;Travis CI: a cloud-based CI service that integrates with GitHub and Bitbucket repositories.&lt;/li&gt;
&lt;li&gt;GitLab CI/CD: a CI/CD tool that is integrated into the GitLab platform.&lt;/li&gt;
&lt;li&gt;CircleCI: a cloud-based CI/CD service that supports a range of programming languages and platforms.&lt;/li&gt;
&lt;li&gt;GitHub Actions: a CI/CD service that is integrated into GitHub repositories and allows you to automate workflows using YAML files.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Testing Tools
&lt;/h2&gt;

&lt;p&gt;Testing tools are used to automate the process of testing software to ensure that it meets the desired quality and functionality requirements. These tools help to ensure that software is thoroughly tested and that defects are identified and corrected before the software is released to end-users. Examples of testing tools include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Selenium: a tool for automating web browser testing.&lt;/li&gt;
&lt;li&gt;JUnit: a unit testing framework for Java.&lt;/li&gt;
&lt;li&gt;NUnit: a unit testing framework for .NET.&lt;/li&gt;
&lt;li&gt;TestNG: a testing framework for Java that supports a wide range of testing scenarios.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Configuration Management Tools
&lt;/h2&gt;

&lt;p&gt;Configuration management tools are used to automate the process of configuring and managing software and infrastructure components. These tools help to ensure that software and infrastructure components are consistent and configured correctly across different environments. Examples of configuration management tools include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ansible: an automation tool that simplifies configuration management and application deployment.&lt;/li&gt;
&lt;li&gt;Chef: a configuration management tool that automates infrastructure configuration and application deployment.&lt;/li&gt;
&lt;li&gt;Puppet: a configuration management tool that automates infrastructure configuration and application deployment.&lt;/li&gt;
&lt;li&gt;SaltStack: a configuration management tool that automates infrastructure configuration and application deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Infrastructure as Code (IaC) Tools
&lt;/h2&gt;

&lt;p&gt;IaC tools are used to automate the process of managing infrastructure through code. These tools help to ensure that infrastructure components are defined and managed consistently across different environments. Examples of IaC tools include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Terraform: a tool for building, changing, and versioning infrastructure.&lt;/li&gt;
&lt;li&gt;AWS CloudFormation: a service that helps you model and set up AWS resources.&lt;/li&gt;
&lt;li&gt;Ansible: a tool for automating infrastructure provisioning, configuration management, and application deployment.&lt;/li&gt;
&lt;li&gt;Puppet: a tool for automating infrastructure provisioning, configuration management, and application deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Containerization Tools
&lt;/h2&gt;

&lt;p&gt;Containerization tools are used to package software and dependencies into containers that can be easily deployed and managed across different environments. These tools help to ensure that software and dependencies are consistent and isolated across different environments. Examples of containerization tools include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker: an open-source platform for building, shipping, and running applications in containers.&lt;/li&gt;
&lt;li&gt;Kubernetes: an open-source platform for automating deployment, scaling, and management of containerized applications.&lt;/li&gt;
&lt;li&gt;OpenShift: a container application platform that enables developers to build, deploy, and manage applications.&lt;/li&gt;
&lt;li&gt;Rancher: a platform for managing and deploying containerized applications across multiple clusters and clouds.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Deployment Automation Tools
&lt;/h2&gt;

&lt;p&gt;Deployment automation tools are used to automate the process of deploying software releases to various environments. These tools help toensure that software releases are deployed consistently and reliably across different environments. Examples of deployment automation tools include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Octopus Deploy: a deployment automation tool that supports a range of deployment scenarios, including cloud, on-premise, and hybrid environments.&lt;/li&gt;
&lt;li&gt;AWS CodeDeploy: a deployment automation service that automates the deployment of code to Amazon EC2 instances and on-premise servers.&lt;/li&gt;
&lt;li&gt;Microsoft Azure DevOps: a suite of tools for managing the entire software development lifecycle, including deployment automation.&lt;/li&gt;
&lt;li&gt;Jenkins: an open-source automation server that supports deployment automation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Monitoring and Logging Tools
&lt;/h2&gt;

&lt;p&gt;Monitoring and logging tools are used to monitor the performance and availability of software systems and to log and analyze system events and errors. These tools help to ensure that software systems are running smoothly and that issues are identified and resolved quickly. Examples of monitoring and logging tools include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nagios: a popular open-source monitoring system that can monitor hosts, services, and network devices.&lt;/li&gt;
&lt;li&gt;Prometheus: an open-source monitoring system that collects metrics from configured targets at given intervals.&lt;/li&gt;
&lt;li&gt;ELK Stack: a combination of three open-source tools (Elasticsearch, Logstash, and Kibana) used for centralized logging and log analysis.&lt;/li&gt;
&lt;li&gt;Splunk: a platform for analyzing and visualizing machine-generated data, including logs, metrics, and security data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, DevOps tools play a critical role in supporting the DevOps methodology by automating processes, facilitating communication, and enabling collaboration across software development, quality assurance, and IT operations teams. The tools we've explored in this article are just a subset of the many DevOps tools available, and the choice of tools will depend on the specific needs of your organization. By selecting the right tools and implementing them effectively, you can streamline your software development processes, improve collaboration among teams, and deliver high-quality software to your end-users more quickly and efficiently.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>cicd</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Software Development (Design) in The Process</title>
      <dc:creator>Anmar Hani</dc:creator>
      <pubDate>Tue, 04 Jul 2023 12:22:57 +0000</pubDate>
      <link>https://forem.com/anmarhaniv1/software-development-in-the-process-design-22pi</link>
      <guid>https://forem.com/anmarhaniv1/software-development-in-the-process-design-22pi</guid>
      <description>&lt;h1&gt;
  
  
  Overview
&lt;/h1&gt;

&lt;p&gt;Software architecture is a complex and challenging topic that requires a deep understanding of the system's structures and elements. In this article, we will only scratch the surface of software architecture and focus on showing the system's structures and design with non-functional attributes rather than its functionality, as we obtain it in the requirements specification phase using diagrams.&lt;/p&gt;

&lt;p&gt;When understanding Software Architecture you need to consider five things, &lt;strong&gt;Structures&lt;/strong&gt;, &lt;strong&gt;Patterns&lt;/strong&gt;, &lt;strong&gt;Tactics&lt;/strong&gt;, &lt;strong&gt;levels&lt;/strong&gt;, and &lt;strong&gt;Domains&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture Domains
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---b8lO389--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.visual-paradigm.com/servlet/editor-content/guide/enterprise-architecture/enterprise-architects-vs-solution-architects-vs-domain-architects/sites/7/2020/01/four-architecture-domains.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---b8lO389--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.visual-paradigm.com/servlet/editor-content/guide/enterprise-architecture/enterprise-architects-vs-solution-architects-vs-domain-architects/sites/7/2020/01/four-architecture-domains.png" alt="Architecture Domains" width="729" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Business:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Describes how the enterprise is organizationally structured and what functional capabilities are necessary to deliver the business vision. Business architecture addresses the questions WHAT and WHO:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHAT&lt;/strong&gt; is the organization’s business vision, strategy, and objectives that guide the creation of business services or capabilities?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHO&lt;/strong&gt; is executing defined business services or capabilities?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Application:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Describes the individual applications, their interactions, and their relationships to the core business processes of the organization. Application architecture addresses the question HOW:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HOW&lt;/strong&gt; are previously defined as business services or capabilities implemented?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Data:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Describes the structure of an organization’s logical and physical data assets and data management resources. Knowledge about your customers from data analytics lets you improve and continuously evolving business processes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Technology:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Describes the software and hardware needed to implement the business, data, and application services.&lt;/p&gt;

&lt;h2&gt;
  
  
  Domain Architects
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Sv3RM-ZZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.visual-paradigm.com/servlet/editor-content/guide/enterprise-architecture/enterprise-architects-vs-solution-architects-vs-domain-architects/sites/7/2020/01/enterprise-architects-domain-architects.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sv3RM-ZZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.visual-paradigm.com/servlet/editor-content/guide/enterprise-architecture/enterprise-architects-vs-solution-architects-vs-domain-architects/sites/7/2020/01/enterprise-architects-domain-architects.png" alt="Domain Architects" width="800" height="630"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enterprise Architect&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Solutions Architect&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Business Architect&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Application Architect&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Chief Architect&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data &amp;amp; Information Architect&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Integration Architect&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Security Architect&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Technology Architect&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cloud Architect&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;source: Visual Paradigm&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Software Design Levels
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Architectural Design
&lt;/h4&gt;

&lt;p&gt;The architectural design is the highest abstract version of the system. It identifies the software as a system with many components interacting with each other. At this level, the designers get the idea of proposed solution domain. &lt;/p&gt;

&lt;p&gt;The overall system architecture is defined here, so you can look at it as &lt;strong&gt;Allocation Structure&lt;/strong&gt; design.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. High-level Design
&lt;/h4&gt;

&lt;p&gt;The high-level design is a lower abstraction level from architectural design, it breaks the ‘single entity-multiple component’ concept of architectural design into less-abstracted view of sub-systems and modules and depicts their interaction with each other. &lt;/p&gt;

&lt;p&gt;High-level design focuses on how the system along with all of its components can be implemented in forms of modules.&lt;/p&gt;

&lt;p&gt;So, dividing the &lt;strong&gt;-overall system-&lt;/strong&gt; into &lt;strong&gt;sub-systems&lt;/strong&gt; and into &lt;strong&gt;classes&lt;/strong&gt; should be made here, so you can look at it as &lt;strong&gt;Module Structure&lt;/strong&gt; design.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Detailed Design
&lt;/h4&gt;

&lt;p&gt;Detailed design deals with the implementation part of what is seen as a system and its sub-systems in the previous two designs. &lt;/p&gt;

&lt;p&gt;It is more detailed towards modules and their implementations. &lt;/p&gt;

&lt;p&gt;So, dividing the &lt;strong&gt;-sub-systems-&lt;/strong&gt; and &lt;strong&gt;-classes-&lt;/strong&gt; into data and functions communications should be made here, so you can look at it as &lt;strong&gt;C&amp;amp;C Structure&lt;/strong&gt; design.&lt;/p&gt;

&lt;p&gt;There are two parts of this level, the first is non-functional based design, and the second is functional based design.&lt;/p&gt;

&lt;h5&gt;
  
  
  1. Non-functional based design
&lt;/h5&gt;

&lt;p&gt;This type of design in Detailed Design level will use &lt;strong&gt;C&amp;amp;C&lt;/strong&gt; structures, views, and architectural patterns, and it focuses on the communications between components (modules). However, it does not focus on functionality nor the internal design.&lt;/p&gt;

&lt;h5&gt;
  
  
  2. Functional based design
&lt;/h5&gt;

&lt;p&gt;This type of design in Detailed Design level is often neglected espcially as architects (that focus mostly on non-functional attributes). However, it is good to mention this type, also it is better to design it as an architect. So, you will start getting into internal design of (modules) such as classes and functions such as writing &lt;strong&gt;Pseudocode&lt;/strong&gt; or &lt;strong&gt;Flow chart diagrams&lt;/strong&gt; to show the implementation code flow.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;source: tutorialspoint&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Architectural Structures or Views
&lt;/h2&gt;

&lt;p&gt;Software architecture is a set of structures that represent the system's components and their relationships, &lt;strong&gt;Structures&lt;/strong&gt; are referred to the set of elements itself and &lt;strong&gt;Views&lt;/strong&gt; are the representation of the structures, so it is documented, but the two words are similar in terms of categorizing. There are three main ways to look at a system or an architecture, known as structures or views:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Module View&lt;/strong&gt;: 
The module view represents the system's functional decomposition into modules and their dependencies. It shows how the system's components use each other, or how they are divided into layers, classes, data models, or decomposed components. The module view can be represented using different types of structures:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Uses Structure&lt;/strong&gt;: Represents how the system's components use each other.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Layers Structure&lt;/strong&gt;: Divides the system into layers, each responsible for a specific set of functionalities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Class Structure&lt;/strong&gt;: Represents the system's classes and their relationships.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Model Structure&lt;/strong&gt;: Represents the system's entities, attributes, and relationships.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Decomposition Structure&lt;/strong&gt;: Represents the system as a collection of decomposed components.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;C&amp;amp;C View&lt;/strong&gt;:
The C&amp;amp;C (Component&amp;amp;Connector) or (Control&amp;amp;Communication) view defines the system's control and communication flows. It shows how the system's components communicate with each other, or how they handle concurrent requests. This view can be represented using different types of structures such as service structure, concurrency structure, event-driven structure, etc. The C&amp;amp;C view can be represented using different types of structures:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Service Structure&lt;/strong&gt;: Represents the system as a collection of services that communicate with each other.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Concurrency Structure&lt;/strong&gt;: Represents how the system handles concurrent requests.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Allocation View&lt;/strong&gt;:
The allocation view defines the system's physical distribution onto hardware components. It shows how the system's deployment components are distributed across different nodes, or how the system's implementation components are related to each other. This view can be represented using different types of structures such as deployment structure, implementation structure, work assignment structure, etc. The Allocation view can be represented using different types of structures:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Deployment Structure&lt;/strong&gt;: Represents the system's deployment components and their distribution across different nodes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Implementation Structure&lt;/strong&gt;: Represents the system's implementation components and their relationships.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Work Assignment Structure&lt;/strong&gt;: Represents the system's work assignment components and their distribution across different nodes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;





&lt;p&gt;Each of these views can be represented using different types of diagrams, such as class diagrams (class structure), EER diagrams (data model structure), and deployment diagrams (deployment structure).&lt;/p&gt;




&lt;h2&gt;
  
  
  Architectural Patterns
&lt;/h2&gt;

&lt;p&gt;Architectural patterns are a &lt;strong&gt;set of tactics that provide proven solutions to recurring design problems in software architecture&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;These patterns are reusable, abstract solutions that can be applied to different systems to improve their quality attributes such as performance, availability, modifiability, security, and more. &lt;/p&gt;

&lt;p&gt;So, instead of just starting from scratch and try to solve problems with tactics, just use a patterns that solve the quality attributes you need, we will talk about tactics more later.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Module Structure Patterns
&lt;/h3&gt;

&lt;p&gt;The module structure defines the system's functional decomposition into modules and their dependencies. Some Patterns Are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Layered Pattern&lt;/strong&gt;: Uses the uses and layers structures. It is strong in modifiability and reusability but weak in performance and scalability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Model Pattern&lt;/strong&gt;: Uses the data model structure. It is strong in data integrity and consistency but weak in performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Component-Based Pattern&lt;/strong&gt;: Uses the decomposition structure. It is strong in modifiability and reusability but weak in performance and scalability.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. C&amp;amp;C Structure Patterns
&lt;/h3&gt;

&lt;p&gt;The C&amp;amp;C (Control and Communication) view defines the system's control and communication flows. Some Patterns Are::&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Publish-Subscribe Pattern&lt;/strong&gt;: Uses the event-driven structure. It is strong in scalability but weak in performance and security.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Peer-to-Peer Pattern&lt;/strong&gt;: Uses the decentralized structure. It is strong in scalability but weak in security and reliability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Service-Oriented Architecture (SOA) Pattern&lt;/strong&gt;: Uses the service structure. It is strong in modifiability, reusability, and scalability but weak in performance and security.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Client-Server Pattern&lt;/strong&gt;: Uses the two-tier structure. It is strong in scalability and security but weak in performance and modifiability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Shared-Data (Repository Model) Pattern&lt;/strong&gt;: Uses the shared data structure. It is strong in simplicity and modifiability but weak in scalability and performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Model-View-Controller (MVC) Pattern&lt;/strong&gt;: Uses the separation of concerns structure. It is strong in modifiability, reusability, and testability but weak in performance and simplicity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pipe-and-Filter Pattern&lt;/strong&gt;: Uses the data transformation structure. It is strong in modifiability and flexibility but weak in performance and scalability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Broker Pattern&lt;/strong&gt;: Uses the distributed communication structure. It is strong in scalability and modifiability but weak in performance and simplicity.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Allocation Structure Patterns
&lt;/h3&gt;

&lt;p&gt;The allocation view defines the system's physical distribution onto hardware components. Some Patterns Are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Map-Reduce Pattern&lt;/strong&gt;: Uses the work assignment and other allocation structures. It is strong in scalability and performance but weak in simplicity and modifiability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multi-Tier Pattern&lt;/strong&gt;: Uses the deployment and other allocation structures. It is strong in scalability and security but weak in simplicity and performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Micro-Services Pattern&lt;/strong&gt;: Uses the deployment and other allocation structures. It is widely used nowadays, it is strong in scalability and performance but weak in security.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Tactics
&lt;/h2&gt;

&lt;p&gt;Remember that every pattern has got strengths and weaknesses in some quality attributes?&lt;/p&gt;

&lt;p&gt;Let's take &lt;strong&gt;Multi-Tier Pattern&lt;/strong&gt; as an example, when using it we do not need to be so much concerned about security so much, because the pattern itself has it as a strength. However, we want to use tactics to overcome performance issues.&lt;/p&gt;

&lt;p&gt;Architects can also use tactics to achieve specific quality attributes. Tactics are design decisions that address specific quality attributes, such as performance, availability, reusability, modifiability, security, and so on.&lt;/p&gt;

&lt;h4&gt;
  
  
  Some common tactics that can be used to achieve different quality attributes include:
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Performance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Caching: Stores frequently accessed data in memory to reduce response time.&lt;/li&gt;
&lt;li&gt;Load balancing: Distributes workloads evenly across multiple nodes to improve response time.&lt;/li&gt;
&lt;li&gt;Parallelism: Divides workloads across multiple processors or nodes to improve response time.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Availability:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Redundancy: Provides backup resources to ensure system availability in the event of a failure.&lt;/li&gt;
&lt;li&gt;Replication: Duplicatesdata or components across multiple nodes to ensure system availability in the event of a failure.&lt;/li&gt;
&lt;li&gt;Fault tolerance: Uses mechanisms to detect and recover from system failures to ensure system availability.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HKFQBs33--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ovussc70xnvoiozzk6p4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HKFQBs33--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ovussc70xnvoiozzk6p4.png" alt="Availability Tactics" width="800" height="859"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reusability:

&lt;ul&gt;
&lt;li&gt;Modularity: Divides the system into smaller, independent modules that can be reused across different parts of the system.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Encapsulation: Hides the implementation details of a module and provides a well-defined interface for other modules to use.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Modifiability:

&lt;ul&gt;
&lt;li&gt;Loose coupling: Reduces the dependencies between components to make it easier to make changes to the system.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Separation of concerns: Divides the system into distinct components, each responsible for a specific set of functionalities.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Security:

&lt;ul&gt;
&lt;li&gt;Encryption: Protects sensitive data by encoding it to prevent unauthorized access.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Access control: Restricts access to sensitive data or components to authorized users only.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Auditing: Monitors system activities to detect and prevent security breaches.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jpl9AVVk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0vtx9ikako3sykfyna9a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jpl9AVVk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0vtx9ikako3sykfyna9a.png" alt="Security Tactics" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Architects often use ASR (Attribute-Scenario-Response) utility trees to prioritize tactics for each quality attribute. ASR utility trees help architects identify the most critical quality attributes and the tactics that can achieve them.&lt;/p&gt;

&lt;p&gt;Also, they use Scenarios. &lt;/p&gt;

&lt;p&gt;An example of an availability general scenario is when a user initiates a request for a service or data from the system, and the system must respond within an acceptable time frame and provide the requested service or data, with response time and uptime measured and monitored to ensure the required availability level is met.&lt;/p&gt;

&lt;p&gt;They can extract stimulus, source of stimulus, artifact, environment, response, and response measure from the general scenario and know the appropriate tactic used here or want to be used here.&lt;/p&gt;

&lt;p&gt;Lastly, a general rule of thumb in patterns' attributes, whenever the system is seperated with layers, it will increase modifiability but decrease performance and security. Also, &lt;/p&gt;




&lt;h1&gt;
  
  
  Real-World Skills and Diving Deeper
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://roadmap.sh/software-architect"&gt;Software Architect Roadmap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://roadmap.sh/software-design-architecture"&gt;Software Design and Architecture Roadmap&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Jobs:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Software Architect: 
Responsible for designing the system's architecture and ensuring that it meets the required quality attributes.&lt;/li&gt;
&lt;/ol&gt;




&lt;h1&gt;
  
  
  What's Next?
&lt;/h1&gt;

&lt;p&gt;Next activity is the Implementation, where we start making the design and architecture something that works.&lt;/p&gt;

</description>
      <category>softwareengineering</category>
      <category>architecture</category>
      <category>career</category>
      <category>design</category>
    </item>
    <item>
      <title>Make AI Help You Instead of Taking Your Job</title>
      <dc:creator>Anmar Hani</dc:creator>
      <pubDate>Wed, 11 Jan 2023 10:33:48 +0000</pubDate>
      <link>https://forem.com/anmarhaniv1/make-ai-help-you-instead-of-taking-your-job-oc5</link>
      <guid>https://forem.com/anmarhaniv1/make-ai-help-you-instead-of-taking-your-job-oc5</guid>
      <description>&lt;p&gt;Using AI in the workplace doesn't have to be a threat to your job, instead, it can be a valuable tool to help you improve your work and make it more efficient. &lt;/p&gt;




&lt;h2&gt;
  
  
  As a software engineer,
&lt;/h2&gt;

&lt;p&gt;you can use AI to automate repetitive tasks such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;writing unit tests&lt;/li&gt;
&lt;li&gt;improving the cleanliness and security of your code&lt;/li&gt;
&lt;li&gt;making your code run faster &lt;/li&gt;
&lt;li&gt;documenting your code&lt;/li&gt;
&lt;li&gt;adding comments&lt;/li&gt;
&lt;li&gt;improving typing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  For writers,
&lt;/h2&gt;

&lt;p&gt;AI can serve as a useful tool to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;generate ideas and topics for articles &lt;/li&gt;
&lt;li&gt;rephrase and improve existing content &lt;/li&gt;
&lt;li&gt;add points and details to your writing. 
It can also serve as a starting point for new articles, providing a base for you to build upon.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Front-end developers
&lt;/h2&gt;

&lt;p&gt;can also benefit from AI by using it to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;automate and improve coding tasks&lt;/li&gt;
&lt;li&gt;make front-end-backend integration easier and faster. 
However, AI may struggle with creating good designs as code so designers may provide a baseline.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cyber Security
&lt;/h2&gt;

&lt;p&gt;AI can be used to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;automatically detect and prevent cyber attacks&lt;/li&gt;
&lt;li&gt;monitor network traffic for suspicious activity.
It can also help organizations with compliance and threat intelligence.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Data Scientists
&lt;/h2&gt;

&lt;p&gt;AI can help with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;data cleaning&lt;/li&gt;
&lt;li&gt;feature engineering&lt;/li&gt;
&lt;li&gt;model selection
and also increase the accuracy and speed of predictions. 
By automating these tasks, data scientists can focus on more important work such as data interpretation, business strategy and identifying new opportunities.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Overall, AI can be a powerful tool in the workplace, but it should be used in conjunction with human intelligence, rather than as a replacement for it. &lt;/p&gt;

&lt;p&gt;You can see how it would change the work flow of every role, for example as a writer you should search for ideas and topics, compare which the best, get references for your article, write it all. &lt;/p&gt;

&lt;p&gt;However, with the new AI capabilities it may change the way you work, instead of doing this, you would think on how to write the input, and give the AI a good baseline to start with.&lt;/p&gt;

&lt;p&gt;By harnessing the capabilities of AI, we can work smarter and more efficiently, ultimately allowing us to achieve greater success in our roles.&lt;/p&gt;

&lt;p&gt;Also, this article is made with the help of AI.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>softwareengineering</category>
      <category>career</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Requirements Specification in The Process</title>
      <dc:creator>Anmar Hani</dc:creator>
      <pubDate>Wed, 11 Jan 2023 08:47:29 +0000</pubDate>
      <link>https://forem.com/anmarhaniv1/software-engineering-processess-p2-3ni1</link>
      <guid>https://forem.com/anmarhaniv1/software-engineering-processess-p2-3ni1</guid>
      <description>&lt;h1&gt;
  
  
  Specification and Requirements Engineering
&lt;/h1&gt;

&lt;p&gt;In the specification activity, also known as &lt;strong&gt;requirements engineering&lt;/strong&gt;, the goal is to identify and understand the needs and requirements for the software being developed. &lt;/p&gt;

&lt;p&gt;The process of gathering, analyzing, specifying and validating the requirements is called &lt;strong&gt;Requirements Engineering&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;This activity sets the foundation of the software development, it helps defining the scope, constraints, and objectives of the project. &lt;/p&gt;

&lt;p&gt;It also helps identifying the stakeholders and the users of the software.&lt;/p&gt;




&lt;p&gt;First it is good to mention that there are different types of requirements that can be identified during the specification activity, including:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F08avr7e7j3p49jkp7giz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F08avr7e7j3p49jkp7giz.png" alt="Image description" width="800" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Functional requirements:
&lt;/h3&gt;

&lt;p&gt;These describe the specific actions or features that the software should be able to perform or the user will do to the system.&lt;/p&gt;

&lt;p&gt;It includes two types:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;User Requirements&lt;/strong&gt;:
User requirements describe the functionality that the software system must provide from the user's perspective. User requirements are typically expressed in terms of high-level features and capabilities that the software system should provide. Some examples and diagrams used:&lt;/li&gt;
&lt;/ol&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use case Diagram&lt;/strong&gt;: A diagram that shows a system and user actions as circles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User stories&lt;/strong&gt;: "As a [user role], I want [goal or objective], so that [reason or benefit]."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Activity diagram&lt;/strong&gt;: A diagram that also shows sequence of activites with arrows and order.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UI/UX Prototype&lt;/strong&gt;: Also, you can start making the User interface design as an initial prototype.&lt;/li&gt;
&lt;/ul&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;System Requirements&lt;/strong&gt;: 
System requirements describe the functionality that the software system must provide from a technical perspective. System requirements are typically expressed in terms of low-level technical details and are focused on how the software system should operate. Some examples and diagrams used:&lt;/li&gt;
&lt;/ol&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Requirement template&lt;/strong&gt;: "The software system shall [perform a specific action or function] under [specific conditions or constraints]."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sequence diagram&lt;/strong&gt;: A diagram that shows sequence of activites and actions on the system.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State diagram&lt;/strong&gt;: A diagram that shows sequence and details of activites, a much more detailed version of activity diagram.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UI/UX Prototype&lt;/strong&gt;: Also, you can start finishing the User interface design and add more details after making an initial prototype from the user requirements (or just start making it in this stage).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Non-functional requirements:
&lt;/h3&gt;

&lt;p&gt;These describe the overall characteristics and quality of the software &lt;strong&gt;(Quality Attributes)&lt;/strong&gt;, on the other side also describe constraints that is made by stakeholders or others &lt;strong&gt;(Constraints)&lt;/strong&gt;. Examples include reliability, security, performance, usability, and scalability.&lt;/p&gt;

&lt;p&gt;They define how the software should perform, rather than what the software should do. &lt;/p&gt;

&lt;p&gt;2.1. &lt;strong&gt;Quality Attributes&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Quality Attributes&lt;/strong&gt; can be grouped into 3 categories:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuuwgp6u3tp0l8xfi9tj6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuuwgp6u3tp0l8xfi9tj6.png" alt="Non-functional Quality Attributes types" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.1.1. &lt;strong&gt;Product requirements&lt;/strong&gt;: &lt;br&gt;
These describe how the software should perform, and are related to the technical aspects of the product. &lt;/p&gt;

&lt;p&gt;They include subtypes such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Performance requirement&lt;/strong&gt;: &lt;br&gt;
These describe how well the software should perform in terms of speed, scalability, and throughput. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Security requirements&lt;/strong&gt;: &lt;br&gt;
These describe how well the software should protect against security threats and vulnerabilities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reliability requirements&lt;/strong&gt;: &lt;br&gt;
These describe how well the software should be able to operate without errors or failures.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.1.2. &lt;strong&gt;Organizational requirements&lt;/strong&gt;: &lt;br&gt;
These describe how the software should be developed, deployed and maintained, and are related to the organization. &lt;/p&gt;

&lt;p&gt;They include subtypes such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Maintainability requirements&lt;/strong&gt;: &lt;br&gt;
These describe how easy it is to maintain the software.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Portability requirements&lt;/strong&gt;: These describe how easy it is to move the software to a different environment or platform.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reusability requirements&lt;/strong&gt;: &lt;br&gt;
These describe how easy it is to reuse the software components.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.1.3. &lt;strong&gt;External requirements&lt;/strong&gt;: &lt;br&gt;
These describe how the software should interact with external systems and environments. &lt;/p&gt;

&lt;p&gt;They include subtypes such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Interoperability requirements&lt;/strong&gt;: &lt;br&gt;
These describe how well the software can exchange information and work with other systems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Accessibility requirements&lt;/strong&gt;: These describe how well the software accommodates users with disabilities.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;2.2. &lt;strong&gt;Constraints&lt;/strong&gt;: &lt;br&gt;
These are factors that restrict or limit the design and development of the software.&lt;/p&gt;

&lt;p&gt;They can be &lt;strong&gt;technical&lt;/strong&gt;, &lt;strong&gt;organizational&lt;/strong&gt;, or &lt;strong&gt;environmental&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Technical constraints&lt;/strong&gt;: &lt;br&gt;
These include limitations imposed by the technology or platform that the software is being built on.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Organizational constraints&lt;/strong&gt;: &lt;br&gt;
These include limitations imposed by the organization, such as budget, time frame, or available resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Environmental constraints&lt;/strong&gt;: These include limitations imposed by the environment, such as network infrastructure or legal regulations.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Business requirements:
&lt;/h3&gt;

&lt;p&gt;These define the business objectives that the software should support and align with.&lt;/p&gt;

&lt;p&gt;They describe the business needs that the software is being developed to address. &lt;/p&gt;

&lt;p&gt;Examples include being able to increase sales, being able to reduce costs, or being able to improve customer satisfaction.&lt;/p&gt;




&lt;h2&gt;
  
  
  Requirements engineering is a superset of two subtypes:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Requirements Development&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Requirements Management&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Requirements Development:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Requirements development&lt;/strong&gt; is the process of defining a project's scope, and it has a process of 4 activities:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnp0oy88w0g1vydlthqxi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnp0oy88w0g1vydlthqxi.png" alt="This image shows the 4 activites of requirements development" width="800" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Requirements Elicitation:
&lt;/h4&gt;

&lt;p&gt;This is the process of gathering and collecting information about the requirements from stakeholders, and users through various techniques such as interviews, questionnaires, observations, and workshops.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Requirements Analysis:
&lt;/h4&gt;

&lt;p&gt;This is the process of analyzing, interpreting, and understanding the requirements collected during elicitation. The goal of this process is to identify any ambiguities, inconsistencies, or gaps in the requirements.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Requirements Specification:
&lt;/h4&gt;

&lt;p&gt;This is the process of formally documenting the requirements in a clear and concise manner. The goal is to communicate the requirements to all stakeholders in a consistent way.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Requirements Validation:
&lt;/h4&gt;

&lt;p&gt;This is the process of checking and verifying that the requirements meet the needs of the stakeholders and are complete, consistent, and accurate.&lt;/p&gt;




&lt;h3&gt;
  
  
  Requirements Management:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Requirements Management&lt;/strong&gt; is the process of defining, documenting, analyzing, tracing, prioritizing, agreeing, and controlling the changing requirements of a project throughout its life cycle.&lt;/p&gt;

&lt;p&gt;It includes all activities that maintain the integrity, accuracy, and currency of requirements agreements throughout the project.&lt;/p&gt;

&lt;p&gt;There are core activites that are categorized into 4 categories:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr4wazph1g1xw7nlv5o7z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr4wazph1g1xw7nlv5o7z.png" alt="This image shows the categories of the core activities in the requirements management" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Version Control:
&lt;/h4&gt;

&lt;p&gt;This activity involves keeping track of different versions of the requirements document and maintaining a history of changes. &lt;/p&gt;

&lt;h4&gt;
  
  
  2. Change Control:
&lt;/h4&gt;

&lt;p&gt;This activity involves managing and controlling changes to the requirements throughout the development process. &lt;/p&gt;

&lt;h4&gt;
  
  
  3. Requirements Status Tracking:
&lt;/h4&gt;

&lt;p&gt;This activity involves keeping track of the current status of each requirement throughout the development process. &lt;/p&gt;

&lt;h4&gt;
  
  
  4. Requirements Tracing:
&lt;/h4&gt;

&lt;p&gt;This activity involves tracing the relationship between the requirements and other artifacts in the project such as design, code, and test cases. &lt;/p&gt;




&lt;h2&gt;
  
  
  In The End:
&lt;/h2&gt;

&lt;p&gt;Requirements shouldnt be just telling we need this or this, there are characteristics for perfect quality attributes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    Unambiguous&lt;/li&gt;
&lt;li&gt;    Correct&lt;/li&gt;
&lt;li&gt;    Complete&lt;/li&gt;
&lt;li&gt;    Consistent&lt;/li&gt;
&lt;li&gt;    Testable&lt;/li&gt;
&lt;li&gt;    Traceable&lt;/li&gt;
&lt;li&gt;    Relevant&lt;/li&gt;
&lt;li&gt;    Feasible&lt;/li&gt;
&lt;li&gt;    Modifiable&lt;/li&gt;
&lt;li&gt;    Prioritized&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also, ways to write a good quality attribute, ASR Utility Trees, Extracting quality attributes from Bussiness goals instead of asking what needed.&lt;/p&gt;



&lt;p&gt;Bad Quality Attribute: The software system should be fast.&lt;/p&gt;

&lt;p&gt;Better Quality Attribute: The software system should respond to user requests within 3 seconds.&lt;/p&gt;




&lt;h2&gt;
  
  
  Jobs:
&lt;/h2&gt;

&lt;p&gt;Roles involved in Specifying the requirements:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Business Analysts:
&lt;/h3&gt;

&lt;p&gt;These professionals are responsible for understanding the business needs of the organization and how the software will support them. &lt;/p&gt;

&lt;p&gt;They work closely with stakeholders to gather, analyze and document requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Systems Analysts:
&lt;/h3&gt;

&lt;p&gt;These professionals are responsible for understanding the technical requirements of the system and how the software will support them. &lt;/p&gt;

&lt;p&gt;They work closely with developers to gather, analyze and document requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Project Managers:
&lt;/h3&gt;

&lt;p&gt;These professionals are responsible for the planning and execution of the project. &lt;/p&gt;

&lt;p&gt;They work closely with the stakeholders and the development team to ensure that the requirements are met.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. UI/UX Designers:
&lt;/h3&gt;

&lt;p&gt;Those designers may take requirements and design a User Interface for architects and developers.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;Next activity is the Development, requirements here play a very important role on making the development better.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Software Engineering Process Activities</title>
      <dc:creator>Anmar Hani</dc:creator>
      <pubDate>Tue, 10 Jan 2023 18:44:20 +0000</pubDate>
      <link>https://forem.com/anmarhaniv1/software-engineering-4h8b</link>
      <guid>https://forem.com/anmarhaniv1/software-engineering-4h8b</guid>
      <description>&lt;h1&gt;
  
  
  Overview of Software Process Activities
&lt;/h1&gt;

&lt;p&gt;Software development is a complex process that involves numerous activities and tasks. In order to ensure that software products are developed efficiently and effectively, it is important to follow a structured software process. This article will provide an overview of software process activities, including project management, software process definition, software process models, and roles involved in software development.&lt;/p&gt;




&lt;h2&gt;
  
  
  Project Management Activities
&lt;/h2&gt;

&lt;p&gt;Project management activities involve planning, organizing, and managing resources to achieve specific software development goals and objectives within a given timeline and budget. There are five key project management activities:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F62fcmiyyat0qk95yhsas.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F62fcmiyyat0qk95yhsas.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Reference: By Sandeep Kashyap, Published in ProofHub Blog&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Initiation: Defining the project goals and objectives, assembling the project team, and conducting initial planning activities.

&lt;/li&gt;
&lt;li&gt;Planning: Creating a project plan that includes the project scope, timeline, budget, and resource allocation.

&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Execution (SOFTWARE PROCESSES): Implementing the project plan and completing project tasks&lt;/strong&gt;.

&lt;/li&gt;
&lt;li&gt;Monitoring and Control: Monitoring the project's progress and taking corrective action as necessary.

&lt;/li&gt;
&lt;li&gt;Closing: Completing the project and conducting a post-project evaluation.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Software Process and its Activities
&lt;/h2&gt;

&lt;p&gt;Software process refers to the set of activities and methodologies used to develop and plan and complete software products which is the &lt;strong&gt;Execution phase in Project Management&lt;/strong&gt;. The activities involved in software process include:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxmhk0hjkipyzk6v7p6p6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxmhk0hjkipyzk6v7p6p6.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Reference: Sommerville, Software Engineering, 10 ed., Chapter 2&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Requirements Specification&lt;/strong&gt;: Gathering and defining software requirements.

&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Development&lt;/strong&gt;: Creating the software product through design and implementation.

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Design&lt;/strong&gt;: Designing the software architecture.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implementation&lt;/strong&gt;: Implementing (programming) the design and creating the software product.

&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validation &amp;amp; Verification&lt;/strong&gt;: Testing the software product to ensure that we are building the right product (validation) and building the product right (verification).

&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evolution&lt;/strong&gt;: Maintaining and updating the software product over time.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Software Process Models
&lt;/h2&gt;

&lt;p&gt;Software process models provide a framework for organizing and defining the software process four activities and tasks necessary to develop software products. There are several types of software process models, including:&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  General Models
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Waterfall Model: A linear and sequential model that progresses through the software development life cycle in asequential manner.

&lt;/li&gt;
&lt;li&gt;Evolutionary Development Model: An iterative and incremental model that involves developing and refining the software product through repeated cycles of requirements gathering, design, implementation, and testing.

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Formal Systems Development Model: A model that emphasizes the use of formal methods and mathematical techniques in software development.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Lean Models
&lt;/h3&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Kanban: A model that emphasizes the use of visual aids and continuous improvement to manage software development.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Agile: An iterative and incremental model that emphasizes flexibility and collaboration between the development team and the customer. There are several types of agile models, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Extreme Programming (XP)&lt;/li&gt;
&lt;li&gt;Dynamic Systems Development Method (DSDM)&lt;/li&gt;
&lt;li&gt;Agile Software Development (ASD)&lt;/li&gt;
&lt;li&gt;Crystal&lt;/li&gt;
&lt;li&gt;Test-Driven Development (TDD)&lt;/li&gt;
&lt;li&gt;Rapid Application Development (RAD)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Jobs:
&lt;/h2&gt;

&lt;p&gt;Roles Involved in Project Management &amp;amp; Software Process Planning&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Project Manager:
&lt;/h3&gt;

&lt;p&gt;Responsible for managing the project and choosing the appropriate software process model.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;In the next article, we will focus on the first activity of software process activities: &lt;strong&gt;Requirements Specification&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>tutorial</category>
      <category>career</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
