Object-Orient Thinking

  • Software
    • model of real world
      • an abstraction
        • precise
        • simplifies
          • ignore irrelevant aspects
          • retain relevant concepts and detail
      • the model must reflect the real world with perspective
    • algorithms to manipulate the model
    • object
      • field/attribute
        • stores values and entities
      • methods
        • mechanism to pass a message to object
        • accessor methods
          • access or calculate value base on input
          • do not change state
        • mutator methods
          • change state
          • do not return
        • hybird
          • both accessor and mutator
      • constructor
        • return a instance of current type

留下评论