From http://pivotallabs.com/write-private-functions-not-private-methods/ Jared Carroll Sunday, June 30, 2013 Khi một class có quá nhiều private method (được gọi là "Lớp tảng băng trôi" - Iceberg class) thì đó là dấu hiệu cho biết class đó có thể đang làm hơn 1 nhiệm vụ (responsibility). Vì vậy việc tách (extract) những private method đó ra class khác giúp lớp … Continue reading Write Private Functions Not Private Methods
Tag: OOP
Liskov Substitution Principle
Liskov Substitution (LSP) Đây là nguyên lý thứ 3 trong SOLID. Nguyên lý này nói rằng các lớp dẫn xuất phải có thể được thay thế bởi lớp cha. Nguyên lý này được Barbara Liskov đề cập lần đầu tiên trong quyển “Data Abstraction and Hiearchy” xuất bản năm 1988. Xin nói thêm rằng Barbara … Continue reading Liskov Substitution Principle
Encapsulation in java and its relation with abstraction
Most of you will agree that encapsulation and abstraction together brings a lot of confusion. Most blogs add only confusion further. Lets solve this puzzle. I started working on this post after my previous post “Understanding abstraction in Java“. My goal was to understand encapsulation in java and how it relates to abstraction. As soon … Continue reading Encapsulation in java and its relation with abstraction
Understanding abstraction in java
In computer science, abstraction is the process by which data and programs are defined with a representation similar in form to its meaning (semantics), while hiding away the implementation details. Source : WikiPedia abstraction – a concept or idea not associated with any specific instance. Sections: What is abstraction Types of abstraction How to use abstraction in … Continue reading Understanding abstraction in java