Skip to main content

Posts

3_Abstract Factory Pattern

Abstract factory pattern provide concept of factory of factories.  Abstract design pattern is on of the creational design pattern that provide us the interface of creating related or independent objects without specifying the concrete classes and their specifications. In other words,  Abstract design pattern is the way of organizing, How we can create groups of things that are related to each other. Think of it, like factory of factories. Let walk through the practical example of car production system using abstract factory design pattern for getting better understanding. Scenario: we are building card of two different types , ElectricCars and PetrolCars. Each car have different types of  1) Engine 2)Tyres Goals: Using abstract design pattern we have to create families of Electric and Petrol car parts. What types of classes will be use in this design pattern. 1) Abstract Products (Interface). 2) Concrete Products: These are concrete classes which implement Abstract Produ...

2_Factory Design Pattern

Factory design pattern, Super class having multiple subclasses, create object of the subclass based on the input/requirement. We create Factory class that take the responsibility of creating object of the subclass. Super class will represent things so, you have to design it will be abstract class or interface. Things to consider before making object using client class. 1) Object should be created with loose coupling. 2) Create object based on input dynamically. Implement with code, here is the scenario.  1) We have Interface of Employee  declaring a method salary. 2) Now make two subclasses names WebDeveloper, AndroidDeveloper that defining the salary method and return employee salary. 3) We have master abstract class named as FactoryEmployee having static method getEmployee that receive an string type argument. based on argument there is an if condition to create object of spacific class of WebDeveloper or AndroidDeveloper.  4) Now We have an  DeveloperClient c...

Interviews Questions

 Q1: Introduce Yourself My Name is [YourName]. I'm originally Lahore, Pakistan. I'm professional software engineer having 5 years of experience in web development, Backend-Systems, Android Apps and Build Environment on servers for the deployment of the project. I specialize in technologies like Php, Laravel, React, React Native and much more. I have works on different project in my career with highly demanded framework like Laravel and MERN stack.  I have worked with some company, where i got work experience. In my current company where i'm working as a senior Back-End Developer. Q2: What are your Roles and Responsibilities in you current company. Divide this answer into two parts Primary and Secondary Primary Explain your technical responsibilities. As a Senior Software Developer at [Company Name]. I lead the development and maintenance of the web and android based systems and application process. My responsibilities including gather and understand the business need than d...

1_Design Patterns in Software Engineering

Design Pattern In Software Engineering Design pattern in software develop are general, reusable solutions to the most acurring problem in designing software design. What are those problems? While designing of the system to face the scenarios where you have to decide which approach or method  use to solve the problem. 1) Problem can be the structure of the system. 2) The flow of the data in the system. 3) The interaction between different modules in the same system. While developing the system you came to face with different problem. Now you have a developer team. You assign this task to these developer individually and every develop solve the problem according to its approach. Now question is which approach/solution is efficient rest of others. Now after analysis you decide If certain problem you face in developing software, solve it with that particular solution. Example If you want, at loading of the application you want to create single object and access each module/class data u...

Docker Installation and Management

 # Step 1: Uninstall older versions of Docker if they exist sudo dnf remove docker \                 docker-client \                 docker-client-latest \                 docker-common \                 docker-latest \                 docker-latest-logrotate \                 docker-logrotate \                 docker-engine # Step 2: Add Docker's official repository sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo # Step 3: Install Docker Engine sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin # Step 4: Start and enable Docker service sudo systemctl start docker sudo systemctl enable docker # Step 5: Verify that Docker...

OOP concept Interface VS Abstract class in php

 What is the key difference between Interface and Abstract Class The key difference lies in purpose and approach of their usage.  1. Key Differences Between Interface and Abstract Class Feature Interface Abstract Class Method Implementation Only method signatures (no implementation) Can have both abstract and concrete (implemented) methods Properties Cannot have properties (variables) Can have properties (variables) Constructor Cannot have a constructor Can have a constructor Multiple Inheritance A class can implement multiple interfaces A class can extend only one abstract class Access Modifiers All methods must be public Methods can have public , protected , or private visibility Use Case Defines a contract that multiple classes must follow Provides a base class with some common functionality Interface An interface in php is a contract, set of rules that classes need to follow. Interface define set of method that classes must impliment. Interface only contain signature/dec...

Setup OpenApI in Microsoft Azure

 Step 1: Goto QuickStart guide and search for Azure OpenAI, Click and land to the OpenAI dashboard. Step 2:  Create Azure openAI Account Add 1.Azure subscription 1 2. New Resource Group 3. Request to access to Azure OpenAI service Note: This is just really to get confirmation of your identity. 4. Name to your OpenAI account 5. Pricing tier: Standard SO Step 3: Network (select default) Step 4: Select tags Step 5: Review + Submit Microsoft AI will load in background and create deployement instance of OpenAI service. Let see How to use Microsoft Azure OpenAI and OpenAI Studio. Microsoft AI Studio is the combination of AI tools like open ai, machine learning etc.