Posts

Showing posts from 2022

SOLID Principles

  SOLID Principles S - Single Responsibility Principle A class is responsible only for a single task Suppose we need to process a order where set of task need to be done like validate order, save order and send notification to the customer. Bad Practice: public class OrderProcessor {     //define the subtask to process order     public void ValidateOrder() { //definition goes here}     p ublic void SaveOrder() { //definition goes here }     p ublic void SendNotification() { //definition goes here }     public void Process()     {          ValidateOrder();          SaveOrder();          SendNotification();     } } The above example violates the single responsibility principle. Because a single class take all the responsibility to process order. Good Practice: public class OrderProcessor ...

Git Workflows

Image
  What is git workflow: A set of guidelines developers can follow when using version control Referred to as a Branching Model Not rules, but guidelines which are not set in stone. Different types of workflow Centralized/trunk based Workflow Feature Branch Workflow Release Branch workflow Gitflow Workflow Environment Branching  Forking Workflow Details of git workflow : Click here Gitflow Command: Git flow init Initialize git flow. After that two branches are created master and develop Git flow feature start feature_branch Start to create the feature branch Git flow feature finish feature_branch Finish the feature branch. Then it automatically merges with the develop branch and deletes itself. Git flow release start 0.1.0 Start to create release branch Git flow release finish 0.1.0 After fixing bug it will merge the branch with master and developer

Git cheat sheet

Creating Snapshots Initializing a repository git init Staging files git add file1.js                          # Stages a single file git add file1.js file2.js           # Stages multiple files git add *.js                                  # Stages with a pattern git add .                                         # Stages the current directory and all its content Viewing the status git status                # Full status git status -s             # Short status Committing the staged files git c...

Git Essentials

Git Introduction Version control system falls into two categories: Centralized (Subversion, Team foundation server) Distributed (Git, Mercurial) Using Git: The command line Code editors and IDE (VSCode, GitLens) Graphical user interface (GUI Client, GitKraken, Sourcetree) Installing git: Download Link: https://git-scm.com/downloads   (Git, Git clients) Windows tool: https://gitforwindows.org/ (Git bash, Git GUI) Configuring Git: We need to specify four settings while configuring git… Name Email Default Editor Line Ending There are three levels where we can add this settings System - All users Global - All repositories of the current user Local - The current repository Settings command: Git config --global user.name “Monowarul Islam” Git config --global user.email abc@gmail.com Git config --global core.editor “code --wait” Git config --global core.autocrlf true   (For windows set true, For mac/linux set input) git config --global pull.rebase true   ( git pull always mak...