oop and datacenter
Notes on Object-Oriented Programming (OOP) and Datacenter Basics
Object-Oriented Programming (OOP) Basics
Concepts: OOP revolves around creating objects (instances of classes) that combine data (attributes) and behavior (methods).
Class: A blueprint for creating objects
(e.g., Car class with attributes like color and speed).
Object: An instance of a class
(e.g., a specific Car with color = red and speed = 100).
Inheritance: Allows a class to inherit properties and methods from another clas
(e.g., ElectricCar inherits from Car).
Encapsulation: Bundling data and methods together
Restricting access to some components to not be changed
Polymorphism: Allows objects to be treated as instances of their parent class, while specific methods may behave differently based on the object's actual class
(e.g., a Car and Bike both have a start method, but they start differently).
Abstraction: Hiding complex implementation details and showing only the necessary parts to the user
(e.g., you drive a car without needing to understand how the engine works).
Datacenter Basics
Servers: Powerful computers that provide data or services to other devices over a network.
They can be physical machines or virtual ones,
where multiple virtual servers run on a single physical machine.
Networks: Systems that connect devices (like servers and computers) to share resources and information. Key parts include:
Router: Directs data between different networks.
Switch: Connects devices within the same network and sends data to the correct one.
Firewall: Manages and protects network traffic based on security rules.
Databases: Where data is stored and managed.
SQL Databases: Organize data into tables with relationships, good for complex queries (e.g., MySQL, PostgreSQL).
NoSQL Databases: Handle unstructured data, more flexible, often used for big data or real-time applications (e.g., MongoDB).
Connectivity: Understanding how servers, networks, and databases work together is crucial. For example, in a web application, the server runs the app, connects to a database to retrieve data, and uses a network to send that data to users.