Chapter 4. Object Interactions

As you learned in Chapter 3, objects are the building blocks of an object-oriented (OO) software system. In such a system, objects collaborate with one another to accomplish common system goals, similar to ants in an anthill, employees of a corporation, or cells in your body. Each object has a specific structure and "mission"; these respective missions complement one another in accomplishing the mission of the system as a whole.

In this chapter, you'll learn:

  • How external events set the objects within an OO application in motion.

  • How methods can be used to specify an object's behaviors. We'll talk about the various code elements that make up a method and how methods are invoked.

  • How objects publicize their methods as services to one another.

  • How objects communicate with one another to request one another's services.

  • How objects maintain their data and how they "guard" their data to ensure its integrity.

  • About the power of encapsulation and how it can be used to limit "ripple effects" when the private implementation details of a class change.

  • How constructors can be used to initialize field values when an object is instantiated.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset