This file contains basic and advanced about Object Oriented Programming in Python. Some of the below concepts has been discussed -->
- Object and Classes
- Encapsulation
- Inheritence
- Abstruct Class In # main.py file , you will get most of the things .
-
SOLID Principles
- Single Responsibility Principle (SRP): A class should have one and only one reason to change.
- Open/Closed Principle (OCP): Software entities should be open for extension but closed for modification.
- Liskov Substitution Principle (LSP): Derived classes should be substitutable for their base classes.
- Interface Segregation Principle (ISP): Clients should not be forced to depend on methods they do not use.
- Dependency Inversion Principle (DIP): High-level modules should not depend on low-level modules; both should depend on abstractions.
-
Design Patterns
- Singleton Pattern: Ensures a class has only one instance and provides a global point of access to it. Both metaclass-based and
__new__-based implementations are demonstrated. - Strategy Pattern: Enables selecting an algorithm's behavior at runtime. Examples include different shipping cost strategies based on flat rate and weight-based calculations.
- Singleton Pattern: Ensures a class has only one instance and provides a global point of access to it. Both metaclass-based and