Software Engineering - spinningideas/resources GitHub Wiki
Engineering Management
Laws
Learning
- https://github.com/AlexGalhardo/Software-Engineering
- https://github.com/charlax/professional-programming
Patterns
SOLID
SOLID is a mnemonic for five object-oriented design principles introduced by Robert C. Martin in his 2000 paper Design Principles and Design Patterns and later popularized in Agile Software Development, Principles, Patterns, and Practices. Michael Feathers coined the acronym itself around 2004. Applying these principles reduces software rot, lowers coupling, and makes code easier to understand, test, and maintain.
Benefits
- Understandability: Each module has a clear, focused purpose.
- Maintainability: Changes are localized, reducing the risk of regressions.
- Testability: Small, decoupled components can be tested in isolation.
- Flexibility: New behavior can be added without modifying proven code.
Principles
- Single Responsibility Principle (SRP) - A class should have only one reason to change. Example: separate
InvoiceCalculatorfromInvoicePrinterinstead of one class doing both. - Open/Closed Principle (OCP) - Software entities should be open for extension, but closed for modification. Example: add new payment methods by implementing a
PaymentProcessorinterface rather than editing the checkout service. - Liskov Substitution Principle (LSP) - Objects of a superclass must be replaceable with objects of a subclass without altering program correctness. Example: a
PremiumCustomershould be usable anywhere aCustomeris expected without special-case discount checks. - Interface Segregation Principle (ISP) - Clients should not be forced to depend on interfaces they do not use. Example: split a monolithic
Machineinterface into focusedPrinter,Scanner, andFaxinterfaces so clients only implement what they need. - Dependency Inversion Principle (DIP) - High-level modules should depend on abstractions, not concrete implementations. Example:
OrderServicedepends onIOrderRepositorysoSqlOrderRepositorycan be swapped withInMemoryOrderRepositoryfor testing.