Posts

Creational Design Pattern - Software Engineering

Image
Creational Design Pattern -  Software Engineering   👽 In the industry we have to use Design Patterns to develop systems. There are 3 types of design patterns. You can use below link to get an small idea about design patterns. https://miyurangika1223.blogspot.com/2024/09/design-patterns.html   In this blog we can discuss about Creational Design Pattern. Creational Design Patterns  Creational design patterns provide various object creation mechanisms where objects are create in a manner suitable for a given situation  It increases flexibility and reuse of existing code. Some creational  design patterns: Factory method design pattern It defines a method to create objects and lets subclasses decide the exact type of object to create. We use this pattern when we don't know in advance what type of object to create and subclasses might want to control object creation. Example: creating different types of notifications like SMS and Email. Abstract f...

Structural Design Pattern - Software Engineering

Image
Structural Design Pattern -  Software Engineering  👽 In the industry we have to use Design Patterns to develop systems. There are 3 types of design patterns. Creational Design Pattern - helps instantiate objects Structural Design Pattern - helps organize relationships between objects Behavioral Design Pattern - helps solve communication problems between objects In this blog we will discuss about Structural Design Pattern. Structural Design Patterns  Structural design patterns focus on the composition of classes and objects to form larger structures while ensuring flexibility and maintainability.  These patterns provide solutions to ease the design of relationships between entities, making systems easier to extend and change. Key characteristics of structural design patterns  :  Flexibility : Allowing changes to a software system's structure without major modifications to its individual components. Reusability : By defining relationships between e...

Design Patterns

Image
 Design Patterns - JAVA🔧👽 In software engineering, a design pattern is a repeatable solution to a common problem in software design. A design pattern is not a ready-made design that can be converted directly into code. It is a description or template of how to solve a problem that can be used in different situations. Why we use design patterns ?  Improved Code Quality and Readability Increased Reusability and Efficiency Better Maintainability and Extensibility Improved Collaboration and Communication Mitigates Risks Reduces errors Enhances reliability We can break these design patterns in terms of those categories. First criteria is Purpose and other one is . First we discuss the types of design patterns using Purpose criteria. 1) Purpose           What is the purpose any design pattern solves. There are 3 purposes that any design patterns would be solving. Creational Design Pattern : Used for creating or instantiating objects and classes. Struc...

Behavioral Design Pattern - Software Engineering

Image
 Behavioral Design Pattern - Software Engineering  👽 In the industry we have to use Design Patterns to develop systems. There are 3 types of design patterns. Creational Design Pattern - helps instantiate objects Structural Design Pattern - helps organize relationships between objects Behavioral Design Pattern - helps solve communication problems between objects In here we will discuss about Behavioral Design Pattern. Behavioral Design Patterns  Behavioral patterns focus on the interactions between cooperating objects. Behavioral design patterns are concerned with the interaction and responsibility of objects. Behavioral patterns only concern about the communication between the objects. The interaction between the object should be in such a way that they can talk to each other easily and should be loosely coupled. That means the implementation and the client should be loosely coupled avoid any hard coding or dependencies. The interaction between the cooperating objec...

Sorting Algorithms - JAVA👽

Image
 Sorting Algorithms - JAVA👽  Sorting algorithms are used to arrange data into a specific pattern (ascending or descending).We mainly discuss 5 patterns in this blog.  We can use any of this methods to sort an array. Selection sort Insertion sort Bubble sort Merge sort Quick sort  Selection sort ... Selection sort is well perform for small arrays and doesn't require extra temporary storage.  It uses selection method. It is poor to deal with huge list of items. It simple and easy to implement. It's time complexity is O(n^2) and space complexity is O(1). Here is the basic code for selection sort. for (int i=0; i< array.length-1; i++){             int curruntMinimum = i;             for (int curruntItem=i+1; curruntItem<array.length;curruntItem++){                 if(array[curruntItem] < array[curruntMinimum]){         ...

Object Oriented Programming - JAVA - Abstract / Abstract classes

Image
Object Oriented Programming - JAVA👽 Abstract / Abstract classes ..... Abstraction in OOPS is used to hide unnecessary information and show only necessary information to interacting users. We can modify a class or method into abstract class or abstract method using Abstract keyword. Let's continue this discussion using example code in the below. class Vehicle {    void park(){   } } class Bicycle extends Vehicle {    void park(){      // break      // putting a foot on the ground      // getting off the bike   } } A bodyless method is in the Vehicle class because it needs to be overridden.   Open and closing curly brackets are not needed for the method because it is bodyless.  But we can't use like  void park(); , That's why we look like a command using method run.  When we use Abstract keyword, we can show bodyless methods without open and closing curly brackets. So we can show that "...

Object Oriented Programming - JAVA - Polymorphism

Image
  Object Oriented Programming - JAVA 👽 Polymorphism is the ability of any data to hold more than one form. Plural means many, and morph means the same word as categories. Polymorphism is an important concept in object-oriented programming languages. Before when we learn polymorphism, we have to know about override and casting. If you have no idea about those things then you can use below links.  Method Override Blog -  https://miyurangika1223.blogspot.com/2024/02/object-oriented-programming-java-method.html Casting Blog -  https://miyurangika1223.blogspot.com/2024/03/object-oriented-programming-java-casting.html After overriding a method in a superclass in a subclass, the process of upcasting and calling the subclass method through the superclass reference is called Polymorphism. class A {   void print (){     sout ("A");   } } class B extends A{    void print (){     sout ("B");   } } class Test {   public stat...