Skip to main content
Best Coding Practice
Naming
- Interfaces
- Should be a good Object Name
- Never start with an 'i' (This is a dot net thing)
- Implementation
- With only 1 implementation: user + Impl
- With more than one the name should indicate the difference of implementation
SOLID Principals
- Single Responsibillity Principal
- Each class jas a single repsonsibillity
- No more than a screen full of code per class
- Open/Closed Principal
- Classes should be open for extension but closed for modification
- Use private getters and setters ONLY when you need them
- Liskov Substitution Principal
- Objects should be replaceable with instances of their subtypes without altering correctness
- E.g. A sqaure is a rectangle
- Interface Segregation Principal
- Make fine-grained interfaces that are client specific
- Keep components focused and minimize shared dependencies
- Dependency Inversion Principal
- Abstraction should not depend on details
- Important that high and low level objects depend on the same abstract implementation
No Comments