Posts

What are the SOLID principles, and why are they important

 The SOLID principles are a set of five design principles in object-oriented programming that help developers create more understandable, flexible, and maintainable software. These principles were introduced by Robert C. Martin, also known as Uncle Bob. They are: Single Responsibility Principle (SRP) Open/Closed Principle (OCP) Liskov Substitution Principle (LSP) Interface Segregation Principle (ISP) Dependency Inversion Principle (DIP) 1. Single Responsibility Principle (SRP) A class should have only one reason to change, meaning it should have only one job or responsibility. Importance: Promotes cohesive functionality. Simplifies debugging and testing. Makes the system more understandable and reduces the risk of changes affecting unrelated functionalities. 2. Open/Closed Principle (OCP) Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification. Importance: Encourages code reuse and flexibility. Reduces the risk of introducing bugs

Solid Principles with Usage Scenario

 The SOLID principles are a set of design principles intended to make software designs more understandable, flexible, and maintainable. Let's break down each principle and provide a scenario where it would be particularly useful: 1. Single Responsibility Principle (SRP) Definition: A class should have only one reason to change, meaning it should only have one job or responsibility. Scenario: Imagine you have a class ReportGenerator that generates reports and also handles the logic for saving the report to a database. If you need to change the database saving logic, you'll have to modify ReportGenerator , even though the report generation logic hasn't changed. To adhere to SRP, you can split this into two classes: ReportGenerator (responsible for generating reports) and ReportSaver (responsible for saving reports). 2. Open/Closed Principle (OCP) Definition: Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification. S

Insecure cookie setting: missing Secure flag

  Issue Description: Insecure Cookie Setting - Missing Secure Flag Explanation: The "Secure" flag is an attribute that can be set for cookies in web applications. When the Secure flag is enabled for a cookie, the cookie is only transmitted over HTTPS connections, ensuring that it is sent securely over an encrypted channel. This is crucial for security because it helps prevent the exposure of sensitive information contained in cookies, such as session tokens or authentication credentials, to potential attackers. When the Secure flag is missing from a cookie, it means that the cookie can be sent over both secure (HTTPS) and non-secure (HTTP) connections. This can pose a significant security risk, as sensitive information could be exposed if the cookie is transmitted over an insecure connection. Impact: The impact of missing the Secure flag on a cookie depends on the context in which the cookie is used. Here are some potential risks: Session Hijacking: If an attacker can inter

Angular Issue:- ng.ps1 cannot be loaded because running scripts is disabled on this system

Image
Here Create a component get following Error. Why this Error Occured ? we set Permission in the Powershell  PS H:\Working Folder\ngApps\MyTest1Project> ng g c test ng : File C:\Users\AppData\Roaming\npm\ng.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see  about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:1 Solution : Open PowerShell Administrator Mode set-ExecutionPolicy Unrestricted  execute this Query and It ask to You Type Yes then it will Works     

signed app bundle with Mach-O thin (x86_64) [com.App.Name]

Image
Hi folks,   I develop a project using Xamarin.Mac when executing the application got signed app bundle with Mach-O thin (x86_64) [com.App.Name]  Error. I fixed the using the following steps. open that project option Menu. Build -> Mac Signing untick the Enable Hardened Runtime now it works.

Toast Notification message In UWP

Image
In UWP - Universal Windows Platform application sent Toast Notification content two ways one is Html content and another one was XML Content. It was support windows 8.1 onwards Systems. In Toast message with use Buttons and Images and sound.    Toast Message is very effective and comforts to sent messages to all. It sent multiple people at the same time. The client also replies to that notification. Notification design is suitable for the latest Technology. default stand time is 5 seconds and will increase 25-30 seconds. This Article Shows three types of Toast message. Simple Notification Toast With Button Textbox Message Sent. Header     install packages from NuGet. using Windows.Data.Xml.Dom; using Windows.UI.Notifications; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; Design XAML < Page x : Name ="Notification"     x : Class ="App.MainPage"     xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/