Improve your code by replacing concrete base classes with interfaces The extends keyword is evil; maybe not at the Charles Manson level, but bad enough that it should be shunned whenever possible. The Gang of Four Design Patterns book discusses at length replacing implementation inheritance (extends) with interface inheritance (implements). Good designers write most of their code in terms … Continue reading Why extends is evil
Tag: inheritance
Strategy Pattern – Chiến lược với những thay đổi
Chào mừng đến với THẾ GIỚI VỀ SỰ CHUẨN MỰC TRONG VIỆC THIẾT KẾ VÀ XÂY DỰNG KIẾN TRÚC CHƯƠNG TRÌNH. Như đã nói ở bài trước, mình sẽ bắt đầu viết những đoạn code đơn giản để minh họa bài toán CON VỊT áp dụng các kỹ thuật trong lập trình hướng đối tượng … Continue reading Strategy Pattern – Chiến lược với những thay đổi