Showing posts with label principals. Show all posts
Showing posts with label principals. Show all posts

Tuesday, November 10, 2009

OO Design Principles

Here are some important principles of Object Oriented Design
       
  • Identify the aspects of your application that vary and seperate them from what stays the same.
  •    
  • Take what varies and encapsulate it so it won't affect the rest of the code.
  •    
  • Program to an interface, not an implementation.
  •    
  • Favour composition over inheritance.
  •    
  • Strive for loosely coupled designs between objects that interact.
  •    
  • Classes should be open for extension but closed for modification.
  •    
  • Depend on abstractions, do not depend on concrete classes.
  •    
  • Talk only to your immediate friends.
  •    
  • A class should have only one reason to change.