Kamis, 11 Oktober 2012

SUMMARY OF CHAPTER 2

SUMMARY OF CHAPTER 2


  •  Object Orientation is a significantly different way of thinking about  solving problems and developing software solutions.
  •  An Object-Oriented System is one that has been designed using abstraction with objects, encapsulated classes, communication via messages, object lifetime, class hierarchies, and polymorphism.
  • An object represents an instance of a real or abstract thing.
  • Encapsulation is one of the most important aspects of  OO. It is what allows each object to be independent. The exact implementation of attributes and of object behavior is hidden from the rest of the world through encapsulation.
  • The attributes of  a class are defined by the declaration of  variables of  various types such as int or boolean.
  •  A Java class includes the definitions of  the methods used to implement the behaviors of  the class.
  •  The method definitions are integral parts of the class definition.
  •    Object-oriented languages usually provide four levels of visibility for classes.
  • Public Visibility. Public attributes and operations are visible to the whole world. Any other class can access the public items of a class.
  •   Private Visibility. Private attributes and operations are visible only to members of the given class.
  •      Protected Visibility. Protected attributes and operations are visible to the class and its subclasses.

  •   Friend Visibility. Friend attributes and operations are visible to a specified set of other classes. In Java, the package is used to define friend visibility. In C++, the friend specifier is used.
  •    Identity The characteristics or state of an object that allows it to be distinguished from other objects.
  •        A class is the definition of the attributes and methods needed to model a related group of objects.
  •   Classes can be organized into hierarchies. Association is a relationship between classes. Aggregation and compositionrepresent whole/part relationships. Inheritance represents generalization/specialization.
  •  An aggregate object includes (has-a) other objects, each of which is considered to be a part of (part-of) the aggregate object.
  •     A composition is a form of aggregation where the whole cannot exist without having the parts.
  •   The communication via message. A message is sent by a method call as a normal part of the execution of the program logic of an object.
  •   Object Lifetime. The time an object exists - from its instantiation in its constructor until the object no longer exists and has been finalized by the Java garbage collector.
  •      An object becomes available for garbage collection when it is no longer referred to by any other object in Java.
  • Inheritance allows subclasses to selectively derive the properties of a superclass.
  • Polymorphism is a characteristic of inheritance that ensures that instances of such subclasses behave correctly.
  •   Polymorphism goes hand in hand with inheritance, and means the right methods are used for individual objects in a derived class.An understanding of how objects are created and implemented can make it easier to write good OO programs.
  • Just as any other specialized discipline, object-orientation has its own vocabulary.

0 komentar:

Posting Komentar