Cricinfo Live Scores

Sunday, February 24, 2008

OOA/OOD/OOP

Object-Oriented Analysis

  • It's general, and thus reusable.
  • Information access is enough. Objects that don't need information can't get to it. Objects that do need information can get to it (i.e., either they have it, or they have an instance variable that points to an object that has it.)
  • Responsibility, control, and communication is distributed. One object doesn't do everything. Makes it easier to reuse, easier to develop and manage.
  • Minimize assumptions of language or system. Try to describe the world, not a program.
  • Define objects not functions or managers. Objects are nouns.
  • Don't include things you don't need, even if it is part of the real world. Sure, everything is made up of molecules, but you probably don't need a molecules class.
  • Good hierarchy is always linked by IsA relationships.
  • Attributes and services should be factored out as high in the hierarchy as possible.
  • It should be easy to add on to, and thus reusable.
  • There should be little or no redundancy.
  • Again, objects are NOUNS.

Object-Oriented Design

  • Implementable. You can see how you'd write code from here.
  • Complete. It's obvious that the OOA is right because everything you need to do is (1) covered in the OOD and (2) matches the OOA.
  • Removes unnecessary middlemen. If A needs to reach B, but can only do it through C...think about allowing A to reach B directly.
The idea is that the OOD is where you patch the pieces together, where you make sure that messages are caught, important information is known at the right places, that all the important services are accounted for.

Object-Oriented Programming

  • NEVER change a reused class! Use subclasses.
Collection
Kazi Masudul Alam
Software Engineer