bentrask.com > Notes & Essays >
Object Oriented
April 2011
What Object Oriented Isn’t:
- Overriding
- Subclassing
- Classes
- Prototypes
- Inheritance
- Types
- Overloading
- Static dispatch
- Virtual functions
- Dynamic dispatch
- Messaging
- Polymorphism
- Factories
- Singletons
- Interfaces
- Information hiding
- A silver bullet
What Object Oriented Is:
- State with behavior
- A natural way of looking at the world
- Fundamentally equivalent to lexically scoped closures (behavior with state)
What Object Oriented Means:
Give the different pieces of data (objects) control of tasks that act on them (methods).
What Object Oriented Implies:
- The data that your application acts on should be divided into a wide array of distinct groups based on concrete, logical distinctions.
- The different groups of data should be given meaningful noun-form titles.
- The tasks that your application performs should be naturally categorized based on the group of data on which they operate.
- The different tasks should be given meaningful command-form titles.
What Object Oriented Produces:
Code with a fundamental unified style for all of its most basic parts. Terrible code translated into object oriented style will at least gain structure; great code will remain great (as long as higher-level constructs are preserved).
Remember:
Any program can be rewritten in an infinite number of functionally equivalent ways. As the programmer, your job is to find the way that best conveys the code’s meaning.