Skip to content

Details

In this chapter, Metz wraps up the discussion of code arrangement with object composition. While not fit for every situation, Metz maintains that composition works well for “has-a” relationships, where an object logically contains several other objects with a role that has specific behavior.
Below are a few questions to get our conversation started around Chapter 8. Feel free to answer any one of these and reply with a helpful comment on someone else’s post as well.

  1. What is the meaning of “has-a” versus “is-a” relationships in the context of inheritance and composition?
  2. How might you implement the PartsFactory pattern in a different domain?
  3. Any other thoughts or questions you have on this chapter?
Ruby
Ruby On Rails
Computer Programming
Technology

Members are also interested in